microsoft / microsoft/retina

Images seem to contain a lot of unused binaries

Open
#1,791 0 comments 1 reaction 1 assignee Assigned to @ibezrukavyi View on GitHub
Dominant language
Go
Stars
3.2k
Forks
304
Avg merge
1d 19h
Merged PRs (30d)
78

Description

**Is your feature request related to a problem? Please describe.**
When scanning the images produced for retina we see a lot of supposed security vulnerabilities. Some of these look like they come from things might not actually need to be part of the image.

E.g. scanning retina-operator:v1.0.0-rc1 results in:
```
$ grype ghcr.io/microsoft/retina/retina-operator:v1.0.0-rc1
NAME INSTALLED FIXED IN TYPE VULNERABILITY SEVERITY EPSS % RISK
lua 5.4.6 0:5.4.6-1.azl3 rpm CVE-2020-24370 Medium 85.31 1.4
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2023-4806 Medium 77.19 0.6
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2024-33599 High 61.41 0.3
libxml2 2.11.5-5.azl3 0:2.11.5-6.azl3 rpm CVE-2025-49794 Critical 33.62 0.1
libxml2 2.11.5-5.azl3 0:2.11.5-6.azl3 rpm CVE-2025-49796 Critical 33.47 0.1
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2024-33600 Medium 43.45 0.1
libxml2 2.11.5-5.azl3 0:2.11.5-6.azl3 rpm CVE-2025-6021 Medium 40.43 < 0.1
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2025-0395 Low 50.32 < 0.1
gcc 13.2.0 0:13.2.0-7.azl3 rpm CVE-2023-4039 Medium 36.25 < 0.1
jq 1.7.1-3.azl3 0:1.7.1-4.azl3 rpm CVE-2025-48060 High 24.65 < 0.1
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2023-4527 Medium 29.38 < 0.1
elfutils 0.189-4.azl3 0:0.189-5.azl3 rpm CVE-2025-1352 Low 34.04 < 0.1
glibc 2.38-10.azl3 0:2.38-11.azl3 rpm CVE-2024-33601 High 11.42 < 0.1
pam 1.5.3-4.azl3 0:1.5.3-5.azl3 rpm CVE-2025-6020 High 2.88 < 0.1
binutils 2.41-5.azl3 0:2.41-6.azl3 rpm CVE-2025-5244 Medium 3.40 < 0.1
binutils 2.41-5.azl3 0:2.41-6.azl3 rpm CVE-2025-5245 Medium 3.40 < 0.1
stdlib go1.24.4 1.23.11, 1.24.5 go-module CVE-2025-4674 Unknown 2.87 < 0.1
libxml2 2.11.5-5.azl3 0:2.11.5-6.azl3 rpm CVE-2025-6170 Low 2.07 < 0.1
```
Looking at the contents of the image there are a lot of lib files that at first glance do not seem directly related to what retina is doing. E.g. libraries like libxml, krb5, systemd and so on.

**Describe the solution you'd like**
Retina derives from a distroless image. However the build then continues to copy the full lib directories from another build image. I assume some of this is required for compiling ebpf, but I would be surprised if it was all of it. Having only what is actually needed in the container should greatly reduce the burden due to false positives and will also make the container lighter.

**Describe alternatives you've considered**
We can vendor the image and try to remove libraries we guess to be unused. However it would be better if this could be done at the source to reduce the workload on everyone.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.