mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 15:37:50 -08:00
feat(misconf): add option to pass Rego scanner to IaC scanner (#8369)
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io> Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com> Co-authored-by: Simar <simar@linux.com>
This commit is contained in:
@@ -662,7 +662,7 @@ func initMisconfScannerOption(ctx context.Context, opts flag.Options) (misconf.S
|
||||
return misconf.ScannerOption{}, xerrors.Errorf("load schemas error: %w", err)
|
||||
}
|
||||
|
||||
return misconf.ScannerOption{
|
||||
misconfOpts := misconf.ScannerOption{
|
||||
Trace: opts.Trace,
|
||||
Namespaces: append(opts.CheckNamespaces, rego.BuiltinNamespaces()...),
|
||||
PolicyPaths: policyPaths,
|
||||
@@ -684,5 +684,13 @@ func initMisconfScannerOption(ctx context.Context, opts flag.Options) (misconf.S
|
||||
ConfigFileSchemas: configSchemas,
|
||||
SkipFiles: opts.SkipFiles,
|
||||
SkipDirs: opts.SkipDirs,
|
||||
}, nil
|
||||
}
|
||||
|
||||
regoScanner, err := misconf.InitRegoScanner(misconfOpts)
|
||||
if err != nil {
|
||||
return misconf.ScannerOption{}, xerrors.Errorf("init Rego scanner: %w", err)
|
||||
}
|
||||
|
||||
misconfOpts.RegoScanner = regoScanner
|
||||
return misconfOpts, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user