Skip to content

fix(misconf): Use correct spec when Trivy updates the check bundle. - #11783

Open
Aakarsh133 wants to merge 3 commits into
aquasecurity:mainfrom
Aakarsh133:fix/compliance-bundle-update
Open

Aakarsh133 wants to merge 3 commits into
aquasecurity:mainfrom
Aakarsh133:fix/compliance-bundle-update

Conversation

@Aakarsh133

Copy link
Copy Markdown
Contributor

Description

Compliance spec is correctly reloaded after InitBuiltinChecks.

  • Spec reload (pkg/compliance/spec/spec.go): Store the builtin spec name in an unexported specNameOrPath field (left empty for @-prefixed custom paths) and add (*ComplianceSpec).Reload(cacheDir string) error to reload builtin specs from disk.
  • Artifact runner (pkg/commands/artifact/run.go): Pass *flag.Options to initScannerConfig and initMisconfScannerOption, reload opts.Compliance after operation.InitBuiltinChecks succeeds, store the reloaded spec on runner, and apply it in r.Report so it survives the value copy boundary in the Runner interface.
  • Kubernetes cluster scan (pkg/k8s/commands/cluster.go): Pass *flag.Options to nodeCollectorOptions and reload opts.Compliance after operation.InitBuiltinChecks succeeds.
  • Tests (pkg/compliance/spec/compliance_test.go): Add TestComplianceSpec_Reload covering builtin spec reload from disk, custom @ spec no op, and empty spec no op.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@Aakarsh133 Aakarsh133 changed the title fix(compliance): Use correct spec when Trivy updates the check bundle. fix(misconf): Use correct spec when Trivy updates the check bundle. Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(flag): --compliance uses the previous spec when Trivy updates the checks bundle

1 participant