-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add logs and add error if serverDetails not provided #189
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import ( | |
"fmt" | ||
"github.com/jfrog/gofrog/parallel" | ||
jfrogappsconfig "github.com/jfrog/jfrog-apps-config/go" | ||
"github.com/jfrog/jfrog-cli-core/v2/utils/config" | ||
"github.com/jfrog/jfrog-cli-security/jas" | ||
"github.com/jfrog/jfrog-cli-security/jas/applicability" | ||
"github.com/jfrog/jfrog-cli-security/jas/iac" | ||
|
@@ -20,11 +19,10 @@ import ( | |
"golang.org/x/exp/slices" | ||
) | ||
|
||
func AddJasScannersTasks(securityParallelRunner *utils.SecurityParallelRunner, scanResults *utils.Results, directDependencies *[]string, | ||
serverDetails *config.ServerDetails, thirdPartyApplicabilityScan bool, scanner *jas.JasScanner, scanType applicability.ApplicabilityScanType, | ||
func AddJasScannersTasks(securityParallelRunner *utils.SecurityParallelRunner, scanResults *utils.Results, directDependencies *[]string, thirdPartyApplicabilityScan bool, scanner *jas.JasScanner, scanType applicability.ApplicabilityScanType, | ||
secretsScanType secrets.SecretsScanType, errHandlerFunc func(error), scansToPreform []utils.SubScanType, configProfile *services.ConfigProfile, scansOutputDir string) (err error) { | ||
if serverDetails == nil || len(serverDetails.Url) == 0 { | ||
log.Warn("To incorporate the ‘Advanced Security’ scans into the audit output make sure platform url is provided and valid (run 'jf c add' prior to 'jf audit' via CLI, or provide JF_URL via Frogbot)") | ||
// Set the analyzer manager executable path. | ||
if scanner.AnalyzerManager.AnalyzerManagerFullPath, err = jas.GetAnalyzerManagerExecutable(); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we doing this here? what is changed in the logic that we didn't need it before and now we do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing has changed. the logic was just moved from one place to another. (Refactoring...) |
||
return | ||
} | ||
// For docker scan we support only secrets and contextual scans. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under which circumstances that weren't exist before the jasScanner can be nil after we tried to create it? If it is not trivial to infer - please add a comment what can result this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look at
CreateScanner
. iflen(serverDetails.Url) == 0
is true we log the usual warning and return nil scanner, we should not continue after that just like the check was atJasRunner
. we need a way to separate the case that serverDetails is nil (err, should not be nil at this point) or the user did not configure the right things (URL, warning)