Repository navigation
Exit 0 and no warning when no OS packages are detected, so --exit-code gates pass images Trivy could not read #11403
heyvaldemar
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Scanning an image whose OS Trivy does not detect, such as
busybox, produces a report with noResults, no warning in the log, and exit code 0 even with--exit-code 1 --severity CRITICAL. A CI gate built on the exit code cannot tell "scanned, nothing critical" from "nothing scanned". The same happens in thecosign-vulnoutput, which is signed and attached as a vulnerability attestation, so the absence becomes a signed record that reads as clean.Reproduce with Trivy 0.75.0:
For contrast,
alpine:3.10exits 1 on CVE-2021-36159.The idea, in any of three forms:
The downstream workaround used in https://github.com/heyvaldemar/kubernetes-supply-chain-admission is to require a
Resultsentry of classos-pkgsbefore counting severities.Target
Container Image
Scanner
Vulnerability
All reactions