Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure IAC_SCAN is included when --detect.tools=ALL #1335

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ public DetectToolFilter createToolFilter(RunDecision runDecision, BlackDuckDecis
AllNoneEnumCollection<DetectTool> excludedTools = detectConfiguration.getValue(DetectProperties.DETECT_TOOLS_EXCLUDED);
ExcludeIncludeEnumFilter<DetectTool> filter = new ExcludeIncludeEnumFilter<>(excludedTools, includedTools, scanTypeEvidenceMap);

boolean iacEnabled = includedTools.containsValue(DetectTool.IAC_SCAN) || !detectConfiguration.getValue(DetectProperties.DETECT_IAC_SCAN_PATHS).isEmpty();

return new DetectToolFilter(filter, impactEnabled.orElse(false), iacEnabled, runDecision, blackDuckDecision);
return new DetectToolFilter(filter, impactEnabled.orElse(false), runDecision, blackDuckDecision);
}

public RapidScanOptions createRapidScanOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public class DetectToolFilter {
private final ExcludeIncludeEnumFilter<DetectTool> excludedIncludedFilter;
private final boolean impactEnabled;
private final boolean iacEnabled;
private final RunDecision runDecision;
private final BlackDuckDecision blackDuckDecision;

Expand All @@ -35,13 +34,11 @@ public class DetectToolFilter {
public DetectToolFilter(
ExcludeIncludeEnumFilter<DetectTool> excludedIncludedFilter,
boolean impactEnabled,
boolean iacEnabled,
RunDecision runDecision,
BlackDuckDecision blackDuckDecision
) {
this.excludedIncludedFilter = excludedIncludedFilter;
this.impactEnabled = impactEnabled;
this.iacEnabled = iacEnabled;
this.runDecision = runDecision;
this.blackDuckDecision = blackDuckDecision;
}
Expand All @@ -50,9 +47,6 @@ public boolean shouldInclude(DetectTool detectTool) { //Only turn tools OFF, tur
if (detectTool == DetectTool.IMPACT_ANALYSIS) {
return impactEnabled;
}
if (detectTool == DetectTool.IAC_SCAN) {
Copy link
Contributor Author

@andrian-sevastyanov andrian-sevastyanov Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this check is being removed, the decision will be made primarily by line 69 in this file.
Check at line 53 will not matter here since Rapid mode does not attempt IaC.

I am looking into whether the check at line 56 is something to take into account here since I don't fully understand stateless mode.

return iacEnabled;
}
if (detectTool == DetectTool.DETECTOR && runDecision.getDockerMode() == DetectTargetType.IMAGE) {
return false;
}
Expand Down