diff --git a/pkg/k8s/commands/cluster.go b/pkg/k8s/commands/cluster.go index c0944e3cb368..179a089523df 100644 --- a/pkg/k8s/commands/cluster.go +++ b/pkg/k8s/commands/cluster.go @@ -65,12 +65,14 @@ func nodeCollectorOptions(opts flag.Options) []trivyk8s.NodeCollectorOption { trivyk8s.WithIgnoreLabels(opts.ExcludeNodes), trivyk8s.WithScanJobImageRef(opts.NodeCollectorImageRef), trivyk8s.WithTolerations(opts.Tolerations)} + contentPath, err := operation.InitBuiltinPolicies(context.Background(), opts.CacheDir, opts.Quiet, opts.SkipCheckUpdate, opts.MisconfOptions.ChecksBundleRepository, opts.RegistryOpts()) + if err != nil { log.Error("Falling back to embedded checks", log.Err(err)) nodeCollectorOptions = append(nodeCollectorOptions, @@ -79,6 +81,7 @@ func nodeCollectorOptions(opts flag.Options) []trivyk8s.NodeCollectorOption { trivyk8s.WithEmbeddedNodeConfigFilesystem(trivy_checks.EmbeddedConfigCommandsFileSystem), }...) } + complianceCommandsIDs := getComplianceCommands(opts) nodeCollectorOptions = append(nodeCollectorOptions, []trivyk8s.NodeCollectorOption{ trivyk8s.WithCommandPaths(contentPath),