You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(flag): --compliance uses the previous spec when Trivy updates the checks bundle #11690
Trivy loads the built-in compliance spec before checking for a bundle update. When it downloads a new bundle during a scan, it runs the new checks but generates the report using the spec from the previous bundle.
Steps to reproduce
Reproduced on the branch from PR #11675, which makes built-in compliance specs respect --cache-dir.
In trivy-checks, run make start-registry. Change the title in pkg/compliance/docker-cis-1.6.0.yaml to Local bundle A and run make push-bundle.
In a separate working directory, create target/Dockerfile with FROM alpine:3.20. Run the following command to populate the cache.
Hey @nikpivkin, I believe this happens because the spec is already baked into opts.Compliance when it runs first and when the report is generated the bundle update is completely invisible to the report generator. We can either defer spec loading until after bundle download Or We can Reload the spec after bundle download.
Once the other issues are done with, I can try working on this one
Your analysis of the cause is correct, but deferring won't work because the spec selects the scanners when flags are parsed, and the scanners decide whether the bundle is downloaded at all. Reload the spec after InitBuiltinChecks succeeds instead, and make sure trivy k8s gets the new copy too. Feel free to take it.
Activity
Aakarsh133 commentedon Nov 20, 2026
Hey @nikpivkin, I believe this happens because the spec is already baked into
opts.Compliancewhen it runs first and when the report is generated the bundle update is completely invisible to the report generator. We can either defer spec loading until after bundle download Or We can Reload the spec after bundle download.Once the other issues are done with, I can try working on this one
Aakarsh133 commentedon Nov 26, 2026
Hey @nikpivkin, what do you think about this proposal? Should I take this one?
nikpivkin commentedon Nov 26, 2026
Your analysis of the cause is correct, but deferring won't work because the spec selects the scanners when flags are parsed, and the scanners decide whether the bundle is downloaded at all. Reload the spec after
InitBuiltinCheckssucceeds instead, and make suretrivy k8sgets the new copy too. Feel free to take it.