Skip to content

Commit 0255e48

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into add_config_flag_to_docker_scan
2 parents 339dd2c + b8fc35f commit 0255e48

File tree

17 files changed

+113
-97
lines changed

17 files changed

+113
-97
lines changed

cli/gitcommands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func GitAuditCmd(c *components.Context) error {
8787
sbomGenerator, scaScanStrategy := getScanDynamicLogic(c)
8888
gitAuditCmd.SetSbomGenerator(sbomGenerator).SetScaScanStrategy(scaScanStrategy)
8989
// Run the command with progress bar if needed, Reporting error if Xsc service is enabled
90-
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(gitAuditCmd))
90+
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, gitAuditCmd.GetProjectKey(), progressbar.ExecWithProgress(gitAuditCmd))
9191
}
9292

9393
func GetCountContributorsParams(c *components.Context) (*contributors.CountContributorsParams, error) {

cli/scancommands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func AuditCmd(c *components.Context) error {
413413
}
414414
auditCmd.SetThreads(threads)
415415
// Reporting error if Xsc service is enabled
416-
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(auditCmd))
416+
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, auditCmd.GetProjectKey(), progressbar.ExecWithProgress(auditCmd))
417417
}
418418

419419
func CreateAuditCmd(c *components.Context) (string, string, *coreConfig.ServerDetails, *audit.AuditCommand, error) {
@@ -507,7 +507,7 @@ func AuditSpecificCmd(c *components.Context, technology techutils.Technology) er
507507
technologies := []string{string(technology)}
508508
auditCmd.SetTechnologies(technologies)
509509
// Reporting error if Xsc service is enabled
510-
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(auditCmd))
510+
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, auditCmd.GetProjectKey(), progressbar.ExecWithProgress(auditCmd))
511511
}
512512

513513
func CurationCmd(c *components.Context) error {

cli/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ func shouldAddSubScan(subScan utils.SubScanType, c *components.Context) bool {
9090
(subScan == utils.ContextualAnalysisScan && c.GetBoolFlagValue(flags.Sca) && !c.GetBoolFlagValue(flags.WithoutCA)) || (subScan == utils.SecretTokenValidationScan && c.GetBoolFlagValue(flags.Secrets) && c.GetBoolFlagValue(flags.SecretValidation))
9191
}
9292

93-
func reportErrorIfExists(xrayVersion, xscVersion string, serverDetails *coreConfig.ServerDetails, err error) error {
93+
func reportErrorIfExists(xrayVersion, xscVersion string, serverDetails *coreConfig.ServerDetails, projectKey string, err error) error {
9494
if err == nil || !usage.ShouldReportUsage() {
9595
return err
9696
}
97-
if reportError := xsc.ReportError(xrayVersion, xscVersion, serverDetails, err, "cli"); reportError != nil {
97+
if reportError := xsc.ReportError(xrayVersion, xscVersion, serverDetails, err, "cli", projectKey); reportError != nil {
9898
log.Debug("failed to report error log:" + reportError.Error())
9999
}
100100
return err

commands/audit/audit.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ func (auditCmd *AuditCommand) SetProject(project string) *AuditCommand {
7373
return auditCmd
7474
}
7575

76+
func (auditCmd *AuditCommand) GetProjectKey() string {
77+
return auditCmd.projectKey
78+
}
79+
7680
func (auditCmd *AuditCommand) SetTargetRepoPath(repoPath string) *AuditCommand {
7781
auditCmd.targetRepoPath = repoPath
7882
return auditCmd
@@ -128,7 +132,7 @@ func CreateAuditResultsContext(serverDetails *config.ServerDetails, xrayVersion
128132
return
129133
}
130134
// Get the defined and active watches from the platform.
131-
manager, err := xsc.CreateXscService(serverDetails)
135+
manager, err := xsc.CreateXscService(serverDetails, xrayutils.WithScopedProjectKey(projectKey))
132136
if err != nil {
133137
log.Warn(fmt.Sprintf("Failed to create Xray services manager: %s", err.Error()))
134138
return
@@ -178,6 +182,7 @@ func (auditCmd *AuditCommand) Run() (err error) {
178182
auditCmd.GetXscVersion(),
179183
serverDetails,
180184
xsc.CreateAnalyticsEvent(xscservices.CliProduct, xscservices.CliEventType, serverDetails),
185+
auditCmd.projectKey,
181186
)
182187

183188
auditParams := NewAuditParams().

commands/git/audit/gitaudit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func RunGitAudit(params GitAuditParams) (scanResults *results.SecurityCommandRes
119119
params.xscVersion,
120120
params.serverDetails,
121121
event,
122+
params.GetProjectKey(),
122123
)
123124
params.multiScanId = multiScanId
124125
params.startTime = startTime

commands/git/audit/gitauditparams.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func (gap *GitAuditParams) SetProjectKey(project string) *GitAuditParams {
5757
return gap
5858
}
5959

60+
func (gap *GitAuditParams) GetProjectKey() string {
61+
return gap.resultsContext.ProjectKey
62+
}
63+
6064
func (gap *GitAuditParams) SetFailBuild(failBuild bool) *GitAuditParams {
6165
gap.failBuild = failBuild
6266
return gap

commands/scan/dockerscan.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func (dsc *DockerScanCommand) Run() (err error) {
7878
dsc.xscVersion,
7979
dsc.serverDetails,
8080
xsc.CreateAnalyticsEvent(xscservices.CliProduct, xscservices.CliEventType, dsc.serverDetails),
81+
dsc.resultsContext.ProjectKey,
8182
)
8283

8384
dsc.SetSpec(spec.NewBuilder().

go.mod

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@ module github.com/jfrog/jfrog-cli-security
33
go 1.24.6
44

55
require (
6-
github.com/CycloneDX/cyclonedx-go v0.9.2
6+
github.com/CycloneDX/cyclonedx-go v0.9.3
77
github.com/beevik/etree v1.4.0
8-
github.com/go-git/go-git/v5 v5.16.2
8+
github.com/go-git/go-git/v5 v5.16.3
99
github.com/google/go-github/v56 v56.0.0
1010
github.com/google/uuid v1.6.0
1111
github.com/gookit/color v1.6.0
1212
github.com/hashicorp/go-hclog v1.6.3
1313
github.com/hashicorp/go-plugin v1.6.3
14-
github.com/jfrog/build-info-go v1.11.0
15-
github.com/jfrog/froggit-go v1.20.3
14+
github.com/jfrog/build-info-go v1.12.0
15+
github.com/jfrog/froggit-go v1.20.4
1616
github.com/jfrog/gofrog v1.7.6
1717
github.com/jfrog/jfrog-apps-config v1.0.1
18-
github.com/jfrog/jfrog-cli-artifactory v0.7.2
19-
github.com/jfrog/jfrog-cli-core/v2 v2.60.0
20-
github.com/jfrog/jfrog-client-go v1.55.0
18+
github.com/jfrog/jfrog-cli-artifactory v0.7.3-0.20251021143342-49bab7f38cec
19+
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251023084247-a56afca52451
20+
github.com/jfrog/jfrog-client-go v1.55.1-0.20251023073119-78f187c9afbf
2121
github.com/magiconair/properties v1.8.10
2222
github.com/owenrumney/go-sarif/v3 v3.2.3
2323
github.com/package-url/packageurl-go v0.1.3
2424
github.com/stretchr/testify v1.11.1
2525
github.com/urfave/cli v1.22.17
2626
github.com/virtuald/go-ordered-json v0.0.0-20170621173500-b18e6e673d74
27-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
28-
golang.org/x/sync v0.16.0
29-
golang.org/x/text v0.28.0
27+
golang.org/x/exp v0.0.0-20250911091902-df9299821621
28+
golang.org/x/sync v0.17.0
29+
golang.org/x/text v0.30.0
3030
gopkg.in/yaml.v3 v3.0.1
3131
)
3232

3333
require (
3434
dario.cat/mergo v1.0.2 // indirect
3535
github.com/BurntSushi/toml v1.5.0 // indirect
3636
github.com/Microsoft/go-winio v0.6.2 // indirect
37-
github.com/ProtonMail/go-crypto v1.1.6 // indirect
37+
github.com/ProtonMail/go-crypto v1.3.0 // indirect
3838
github.com/VividCortex/ewma v1.2.0 // indirect
3939
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
40-
github.com/andybalholm/brotli v1.1.1 // indirect
40+
github.com/andybalholm/brotli v1.2.0 // indirect
4141
github.com/buger/jsonparser v1.1.1 // indirect
4242
github.com/c-bata/go-prompt v0.2.6 // indirect
4343
github.com/chzyer/readline v1.5.1 // indirect
@@ -48,7 +48,7 @@ require (
4848
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
4949
github.com/emirpasic/gods v1.18.1 // indirect
5050
github.com/fatih/color v1.16.0 // indirect
51-
github.com/forPelevin/gomoji v1.3.1 // indirect
51+
github.com/forPelevin/gomoji v1.4.0 // indirect
5252
github.com/fsnotify/fsnotify v1.9.0 // indirect
5353
github.com/gfleury/go-bitbucket-v1 v0.0.0-20230825095122-9bc1711434ab // indirect
5454
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
@@ -70,7 +70,7 @@ require (
7070
github.com/jfrog/archiver/v3 v3.6.1 // indirect
7171
github.com/kevinburke/ssh_config v1.2.0 // indirect
7272
github.com/klauspost/compress v1.18.0 // indirect
73-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
73+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
7474
github.com/klauspost/pgzip v1.2.6 // indirect
7575
github.com/ktrysmt/go-bitbucket v0.9.80 // indirect
7676
github.com/manifoldco/promptui v0.9.0 // indirect
@@ -100,7 +100,7 @@ require (
100100
github.com/spf13/pflag v1.0.10 // indirect
101101
github.com/spf13/viper v1.21.0 // indirect
102102
github.com/subosito/gotenv v1.6.0 // indirect
103-
github.com/ulikunitz/xz v0.5.14 // indirect
103+
github.com/ulikunitz/xz v0.5.15 // indirect
104104
github.com/vbauerster/mpb/v8 v8.10.2 // indirect
105105
github.com/xanzy/go-gitlab v0.110.0 // indirect
106106
github.com/xanzy/ssh-agent v0.3.3 // indirect
@@ -110,16 +110,16 @@ require (
110110
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
111111
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
112112
go.yaml.in/yaml/v3 v3.0.4 // indirect
113-
golang.org/x/crypto v0.38.0 // indirect
114-
golang.org/x/mod v0.26.0 // indirect
115-
golang.org/x/net v0.40.0 // indirect
116-
golang.org/x/oauth2 v0.30.0 // indirect
117-
golang.org/x/sys v0.36.0 // indirect
118-
golang.org/x/term v0.35.0 // indirect
113+
golang.org/x/crypto v0.43.0 // indirect
114+
golang.org/x/mod v0.28.0 // indirect
115+
golang.org/x/net v0.45.0 // indirect
116+
golang.org/x/oauth2 v0.31.0 // indirect
117+
golang.org/x/sys v0.37.0 // indirect
118+
golang.org/x/term v0.36.0 // indirect
119119
golang.org/x/time v0.12.0 // indirect
120120
google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
121121
google.golang.org/grpc v1.67.3 // indirect
122-
google.golang.org/protobuf v1.36.6 // indirect
122+
google.golang.org/protobuf v1.36.8 // indirect
123123
gopkg.in/ini.v1 v1.67.0 // indirect
124124
gopkg.in/warnings.v0 v0.1.2 // indirect
125125
)
@@ -128,7 +128,7 @@ require (
128128

129129
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 master
130130

131-
// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory main
131+
//replace github.com/jfrog/jfrog-cli-artifactory => github.com/fluxxBot/jfrog-cli-artifactory v0.0.0-20251017061455-6a03988302bf
132132

133133
// replace github.com/jfrog/build-info-go => github.com/attiasas/build-info-go dev
134134

0 commit comments

Comments
 (0)