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
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.
--compliance with a built-in spec name always loads the spec from the checks bundle in the default cache directory, even when --cache-dir is set. Checks and node-collector commands come from the bundle in --cache-dir, so the spec and the commands can come from different bundles. If the default cache has no bundle, the spec embedded in the binary is used.
Steps to reproduce
Download the checks bundle into a custom cache directory.
The report header is still Summary Report for compliance: CIS Docker Community Edition Benchmark v1.6.0. The expected header is Summary Report for compliance: Spec from the cache dir.
The cause is loadComplianceTypes in pkg/flag/report_flags.go. It passes cache.DefaultDir() to spec.GetComplianceSpec instead of the cache directory from the options.
I traced it to loadComplianceTypes in pkg/flag/report_flags.go, which passes cache.DefaultDir() to spec.GetComplianceSpec instead of the configured cache dir. I believe the fix is to hand the folder you chose to the function that loads the checklist, instead of the default one. It is a one-line change, plus a test.
#11675 fixes the --cache-dir handling for built-in compliance specs. Testing also surfaced a separate bug. When Trivy updates the checks bundle during a scan, the compliance report can still use the spec from the old bundle. I’d open a separate issue for that and fix it in a follow-up PR.
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.
Activity
Aakarsh133 commentedon Nov 17, 2026
Hi! I would like to take this one.
I traced it to
loadComplianceTypesinpkg/flag/report_flags.go, which passescache.DefaultDir()tospec.GetComplianceSpecinstead of the configured cache dir. I believe the fix is to hand the folder you chose to the function that loads the checklist, instead of the default one. It is a one-line change, plus a test.I can work on a detailed plan and a PR shortly
nikpivkin commentedon Nov 18, 2026
@Aakarsh133 You can take this.
Aakarsh133 commentedon Nov 18, 2026
@nikpivkin just opened the above mentioned PR for the fix
nikpivkin commentedon Nov 19, 2026
#11675 fixes the
--cache-dirhandling for built-in compliance specs. Testing also surfaced a separate bug. When Trivy updates the checks bundle during a scan, the compliance report can still use the spec from the old bundle. I’d open a separate issue for that and fix it in a follow-up PR.