Trivy not detecting package upgrades in Kroki hardened image #6286
Closed
DavidACastagna
started this conversation in
False Detection
Replies: 1 comment
-
Hello @DavidACastagna I created #6297 for this task. Regards, Dmitriy |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IDs
All of them? They're listed in the attached JSON.
Description
Creating a "hardened" verison of an image is not resulting in a clean Trivy scan - although I'm pretty sure it should. And the fix we had to make to get Trivy to see the package updates ended up erasing the base image's
ENTRYPOINT
andENV
blocks rendering the base image useless. So we need to figure out how to get Trivy to see the correctly installed packages so we don't need to try to use a workaround that doesn't break the container.I'm hoping the issue is simple to resolve with a trivy option of some kind? Or with a copy of some specific content from the base image? But I'm guessing that there is something more difficult going on here.
Consider these two trivy reports:
The baseline report: kroki-0.24.1.trivy.json
The report post-hardening: kroki-0.24.1-hardened.trivy.json
The vulnerabilities section of both of these are the same. Even though this is the Dockerfile used to construct the "hardened" image:
Using this Dockerfile instead seems to fix the trivy issue (it sees the installed packages) but the
ENTRYPOINT
andENV
blocks are purged rendering the base image useless (that part is obviously not trivy's doing):Reproduction Steps
To verify the image contains the right stuff I ran apt show on curl and libc-bin and got:
Which are upgraded from the baseline and match or exceed what was in the original trivy report.
Version
Checklist
-f json
that shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions