diff --git a/commands/audit/audit.go b/commands/audit/audit.go index 683c8cca3..eb2dfc6e2 100644 --- a/commands/audit/audit.go +++ b/commands/audit/audit.go @@ -470,7 +470,22 @@ func getTargetResultsToCompare(cmdResults, resultsToCompare *results.SecurityCom return } +func scaIndependentScans(scans []utils.SubScanType) bool { + for _, scan_type := range scans { + if (scan_type != utils.SecretsScan && scan_type != utils.SastScan && scan_type != utils.IacScan) { + return false + } + } + return true +} + func detectScanTargets(cmdResults *results.SecurityCommandResults, params *AuditParams) { + + if scaIndependentScans(params.ScansToPerform()) { + cmdResults.NewScanResults(results.ScanTarget{Target: params.workingDirs[0]}) + return + } + for _, requestedDirectory := range params.workingDirs { if !fileutils.IsPathExists(requestedDirectory, false) { log.Warn("The working directory", requestedDirectory, "doesn't exist. Skipping SCA scan...")