fix(sbom): skip executable file analysis if Rekor isn't a specified SBOM source (#6163)

This commit is contained in:
saso
2024-02-20 15:44:35 +09:00
committed by GitHub
parent 74dc5b6804
commit 7694df11fb

View File

@@ -514,7 +514,8 @@ func disabledAnalyzers(opts flag.Options) []analyzer.Type {
analyzers = append(analyzers, analyzer.TypeHistoryDockerfile) analyzers = append(analyzers, analyzer.TypeHistoryDockerfile)
} }
if len(opts.SBOMSources) == 0 { // Skip executable file analysis if Rekor isn't a specified SBOM source.
if !slices.Contains(opts.SBOMSources, types.SBOMSourceRekor) {
analyzers = append(analyzers, analyzer.TypeExecutable) analyzers = append(analyzers, analyzer.TypeExecutable)
} }