forked from jfrog/jfrog-cli-security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
0fc5abe
commit 9a72b94
Showing
11 changed files
with
195 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package scan | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/jfrog/jfrog-cli-core/v2/utils/config" | ||
"github.com/jfrog/jfrog-cli-security/commands/audit/jas" | ||
"github.com/jfrog/jfrog-cli-security/commands/audit/jas/applicability" | ||
"github.com/jfrog/jfrog-cli-security/commands/audit/jas/secrets" | ||
|
||
"github.com/jfrog/jfrog-cli-security/utils" | ||
"github.com/jfrog/jfrog-client-go/utils/log" | ||
) | ||
|
||
func runJasScannersAndSetResults(scanResults *utils.Results, cveList []string, | ||
serverDetails *config.ServerDetails, workingDirs []string) (err error) { | ||
|
||
if serverDetails == nil || len(serverDetails.Url) == 0 { | ||
log.Warn("To include 'Advanced Security' scan as part of the audit output, please run the 'jf c add' command before running this command.") | ||
return | ||
} | ||
scanner, err := jas.NewJasScanner(workingDirs, serverDetails) | ||
if err != nil { | ||
return | ||
} | ||
|
||
defer func() { | ||
cleanup := scanner.ScannerDirCleanupFunc | ||
err = errors.Join(err, cleanup()) | ||
}() | ||
|
||
scanResults.ExtendedScanResults.ApplicabilityScanResults, err = applicability.RunApplicabilityWithScanCves(scanResults.GetScaScansXrayResults(), cveList, scanResults.GetScaScannedTechnologies(), scanner) | ||
if err != nil { | ||
fmt.Println("there was an error:", err) | ||
return | ||
} | ||
|
||
scanResults.ExtendedScanResults.SecretsScanResults, err = secrets.RunSecretsScan(scanner, secrets.SecretsScannerDockerScanType) | ||
if err != nil { | ||
return | ||
} | ||
return | ||
} |
Oops, something went wrong.