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: 1 comment 2 replies
|
@DmitriyLewen, could you look at this one, or say if it should be an issue instead? At main (4e94880) an image whose OS Trivy cannot detect still gets a debug line only, The smallest of the three options above is that same warning for the unknown OS when no language packages were found either. Exit codes stay as they are. The CI log then says what was not scanned. |
2 replies
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