-
Notifications
You must be signed in to change notification settings - Fork 42
Add diff logic and parallel logger support for audit #642
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
base: dev
Are you sure you want to change the base?
Changes from all commits
18c22a1
6c07738
caf59eb
7fc3bd0
96ae51a
b22d7c4
16f7f21
c38b6c3
5e4a231
86e70fd
37f3743
b0eb167
957b363
809a52f
a5897a9
22f7713
56609db
816605d
1ca4a0a
0b35329
bccd932
7a90d14
ad0f25d
4485151
53833b2
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 |
|---|---|---|
|
|
@@ -292,6 +292,11 @@ func (auditCmd *AuditCommand) CommandName() string { | |
| // Returns an audit Results object containing all the scan results. | ||
| // If the current server is entitled for JAS, the advanced security results will be included in the scan results. | ||
| func RunAudit(auditParams *AuditParams) (cmdResults *results.SecurityCommandResults) { | ||
| // Set up isolated logging if a BufferedLogger is provided for parallel log capture | ||
| if collector := auditParams.GetLogCollector(); collector != nil { | ||
| log.SetLoggerForGoroutine(collector) | ||
| defer log.ClearLoggerForGoroutine() | ||
| } | ||
| // Prepare the command for the scan. | ||
| if cmdResults = prepareToScan(auditParams); cmdResults.GeneralError != nil { | ||
| return | ||
|
|
@@ -623,7 +628,10 @@ func addJasScansToRunner(auditParallelRunner *utils.SecurityParallelRunner, audi | |
| return | ||
| } | ||
| auditParallelRunner.JasWg.Add(1) | ||
| if _, jasErr := auditParallelRunner.Runner.AddTaskWithError(createJasScansTask(auditParallelRunner, scanResults, serverDetails, auditParams, jasScanner), func(taskErr error) { | ||
| jasTask := createJasScansTask(auditParallelRunner, scanResults, serverDetails, auditParams, jasScanner) | ||
| // Wrap task to propagate parent's logger for isolated parallel logging | ||
| wrappedJasTask := utils.WrapTaskWithLoggerPropagation(jasTask) | ||
| if _, jasErr := auditParallelRunner.Runner.AddTaskWithError(wrappedJasTask, func(taskErr error) { | ||
|
Comment on lines
+632
to
+634
Contributor
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. we only want to wrap and change logs if collector is set. |
||
| scanResults.AddGeneralError(fmt.Errorf("failed while adding JAS scan tasks: %s", taskErr.Error()), auditParams.AllowPartialResults()) | ||
| }); jasErr != nil { | ||
| generalError = fmt.Errorf("failed to create JAS task: %s", jasErr.Error()) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/jfrog/jfrog-cli-security | ||
|
|
||
| go 1.25.4 | ||
| go 1.25.5 | ||
|
|
||
| require ( | ||
| github.com/CycloneDX/cyclonedx-go v0.9.3 | ||
|
|
@@ -11,7 +11,7 @@ require ( | |
| github.com/gookit/color v1.6.0 | ||
| github.com/hashicorp/go-hclog v1.6.3 | ||
| github.com/hashicorp/go-plugin v1.6.3 | ||
| github.com/jfrog/build-info-go v1.12.5-0.20251209171349-eb030db986f9 | ||
| github.com/jfrog/build-info-go v1.13.0 | ||
| github.com/jfrog/froggit-go v1.20.6 | ||
| github.com/jfrog/gofrog v1.7.6 | ||
| github.com/jfrog/jfrog-apps-config v1.0.1 | ||
|
|
@@ -135,12 +135,12 @@ require ( | |
| gopkg.in/warnings.v0 v0.1.2 // indirect | ||
| ) | ||
|
|
||
| // replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go master | ||
|
|
||
| // replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 master | ||
|
|
||
| //replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory main | ||
|
|
||
| // replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go dev | ||
|
|
||
| // replace github.com/jfrog/froggit-go => github.com/jfrog/froggit-go master | ||
|
|
||
| replace github.com/jfrog/jfrog-client-go => github.com/eyalk007/jfrog-client-go v0.0.0-20260114112951-67b77f49255f | ||
|
Contributor
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. Reminder to remove replace after merging dependend PR |
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,7 +69,8 @@ func getDiffSbom(sbom *cyclonedx.BOM, params SbomGeneratorParams) *cyclonedx.BOM | |||||||
| return sbom | ||||||||
| } | ||||||||
| log.Debug(fmt.Sprintf("Excluding %s components from %s SBOM", params.TargetResultToCompare.Target, params.Target.Target)) | ||||||||
| return cdxutils.Exclude(*sbom, *params.TargetResultToCompare.ScaResults.Sbom.Components...) | ||||||||
| filteredSbom := cdxutils.Exclude(*sbom, *params.TargetResultToCompare.ScaResults.Sbom.Components...) | ||||||||
| return filteredSbom | ||||||||
|
Comment on lines
+72
to
+73
Contributor
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.
Suggested change
why change is needed? |
||||||||
| } | ||||||||
|
|
||||||||
| func updateTarget(target *results.TargetResults, sbom *cyclonedx.BOM) { | ||||||||
|
|
||||||||
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.
the collector is running on main routine so it will first record all the logs from main and it will collect the other after?