-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker scan JAS support, not tests and unit tests need fix #4
- Loading branch information
1 parent
d44be67
commit cc73f9d
Showing
12 changed files
with
163 additions
and
35 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,45 @@ | ||
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 | ||
} | ||
multiScanId := "" // Also empty for audit | ||
scanner, err := jas.NewJasScanner(workingDirs, serverDetails, multiScanId) | ||
Check failure on line 24 in commands/scan/jasrunner_cves.go GitHub Actions / Static-Check
Check failure on line 24 in commands/scan/jasrunner_cves.go GitHub Actions / Static-Check
Check failure on line 24 in commands/scan/jasrunner_cves.go GitHub Actions / Static-Check
Check failure on line 24 in commands/scan/jasrunner_cves.go GitHub Actions / Go-Sec
|
||
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 | ||
} |
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
1 change: 1 addition & 0 deletions
1
tests/testdata/other/applicability-scan/applicable-docker-scan-cve-results.sarif
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 @@ | ||
TODO |
Oops, something went wrong.