Skip to content

Commit b4e081d

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into static_sca_violations_remediations
2 parents 0daaa3c + b8fc35f commit b4e081d

23 files changed

+176
-99
lines changed

buildscripts/download-jars.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# https://github.com/jfrog/maven-dep-tree
88

99
# Once you have updated the versions mentioned below, please execute this script from the root directory of the jfrog-cli-core to ensure the JAR files are updated.
10-
GRADLE_DEP_TREE_VERSION="3.0.4"
10+
GRADLE_DEP_TREE_VERSION="3.1.0"
1111
# Changing this version also requires a change in mavenDepTreeVersion within utils/java/mvn.go.
1212
MAVEN_DEP_TREE_VERSION="1.1.5"
1313

cli/gitcommands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func GitAuditCmd(c *components.Context) error {
9292
gitAuditCmd.SetViolationGenerator(violationGenerator)
9393
gitAuditCmd.SetUploadCdxResults(uploadResults).SetRtResultRepository(c.GetStringFlagValue(flags.UploadRtRepoPath))
9494
// Run the command with progress bar if needed, Reporting error if Xsc service is enabled
95-
err = reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(gitAuditCmd))
95+
err = reportErrorIfExists(xrayVersion, xscVersion, serverDetails, gitAuditCmd.GetProjectKey(), progressbar.ExecWithProgress(gitAuditCmd))
9696
log.Info("####### jf git audit Scan Finished #######")
9797
return err
9898
}

cli/scancommands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ func AuditCmd(c *components.Context) error {
415415
}
416416
auditCmd.SetThreads(threads)
417417
// Reporting error if Xsc service is enabled
418-
err = reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(auditCmd))
418+
err = reportErrorIfExists(xrayVersion, xscVersion, serverDetails, auditCmd.GetProjectKey(), progressbar.ExecWithProgress(auditCmd))
419419
log.Info("####### jf audit Scan Finished #######")
420420
return err
421421
}
@@ -509,7 +509,7 @@ func AuditSpecificCmd(c *components.Context, technology techutils.Technology) er
509509
technologies := []string{string(technology)}
510510
auditCmd.SetTechnologies(technologies)
511511
// Reporting error if Xsc service is enabled
512-
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, progressbar.ExecWithProgress(auditCmd))
512+
return reportErrorIfExists(xrayVersion, xscVersion, serverDetails, auditCmd.GetProjectKey(), progressbar.ExecWithProgress(auditCmd))
513513
}
514514

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

cli/utils.go

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

109-
func reportErrorIfExists(xrayVersion, xscVersion string, serverDetails *coreConfig.ServerDetails, err error) error {
109+
func reportErrorIfExists(xrayVersion, xscVersion string, serverDetails *coreConfig.ServerDetails, projectKey string, err error) error {
110110
if err == nil || !usage.ShouldReportUsage() {
111111
return err
112112
}
113-
if reportError := xsc.ReportError(xrayVersion, xscVersion, serverDetails, err, "cli"); reportError != nil {
113+
if reportError := xsc.ReportError(xrayVersion, xscVersion, serverDetails, err, "cli", projectKey); reportError != nil {
114114
log.Debug("failed to report error log:" + reportError.Error())
115115
}
116116
return err

commands/audit/audit.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ func (auditCmd *AuditCommand) SetProject(project string) *AuditCommand {
7676
return auditCmd
7777
}
7878

79+
func (auditCmd *AuditCommand) GetProjectKey() string {
80+
return auditCmd.projectKey
81+
}
82+
7983
func (auditCmd *AuditCommand) SetTargetRepoPath(repoPath string) *AuditCommand {
8084
auditCmd.targetRepoPath = repoPath
8185
return auditCmd
@@ -131,7 +135,7 @@ func CreateAuditResultsContext(serverDetails *config.ServerDetails, xrayVersion
131135
return
132136
}
133137
// Get the defined and active watches from the platform.
134-
manager, err := xsc.CreateXscService(serverDetails)
138+
manager, err := xsc.CreateXscService(serverDetails, xrayutils.WithScopedProjectKey(projectKey))
135139
if err != nil {
136140
log.Warn(fmt.Sprintf("Failed to create Xray services manager: %s", err.Error()))
137141
return
@@ -197,6 +201,7 @@ func (auditCmd *AuditCommand) Run() (err error) {
197201
auditCmd.GetXscVersion(),
198202
serverDetails,
199203
xsc.CreateAnalyticsEvent(xscservices.CliProduct, xscservices.CliEventType, serverDetails),
204+
auditCmd.projectKey,
200205
)
201206

202207
auditParams := NewAuditParams().

commands/git/audit/gitaudit.go

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

commands/git/audit/gitauditparams.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func (gap *GitAuditParams) SetProjectKey(project string) *GitAuditParams {
6363
return gap
6464
}
6565

66+
func (gap *GitAuditParams) GetProjectKey() string {
67+
return gap.resultsContext.ProjectKey
68+
}
69+
6670
func (gap *GitAuditParams) SetFailBuild(failBuild bool) *GitAuditParams {
6771
gap.failBuild = failBuild
6872
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: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,45 @@ module github.com/jfrog/jfrog-cli-security
22

33
go 1.24.6
44

5+
// TODO: remove after Xray-Lib new version is released
6+
replace github.com/CycloneDX/cyclonedx-go => github.com/CycloneDX/cyclonedx-go v0.9.2
7+
58
require (
6-
github.com/CycloneDX/cyclonedx-go v0.9.2
9+
github.com/CycloneDX/cyclonedx-go v0.9.3
710
github.com/beevik/etree v1.4.0
8-
github.com/go-git/go-git/v5 v5.16.2
11+
github.com/go-git/go-git/v5 v5.16.3
912
github.com/google/go-github/v56 v56.0.0
1013
github.com/google/uuid v1.6.0
1114
github.com/gookit/color v1.6.0
1215
github.com/hashicorp/go-hclog v1.6.3
1316
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
17+
github.com/jfrog/build-info-go v1.12.0
18+
github.com/jfrog/froggit-go v1.20.4
1619
github.com/jfrog/gofrog v1.7.6
1720
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
21+
github.com/jfrog/jfrog-cli-artifactory v0.7.3-0.20251021143342-49bab7f38cec
22+
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251023084247-a56afca52451
23+
github.com/jfrog/jfrog-client-go v1.55.1-0.20251023073119-78f187c9afbf
2124
github.com/magiconair/properties v1.8.10
2225
github.com/owenrumney/go-sarif/v3 v3.2.3
2326
github.com/package-url/packageurl-go v0.1.3
2427
github.com/stretchr/testify v1.11.1
2528
github.com/urfave/cli v1.22.17
2629
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
30+
golang.org/x/exp v0.0.0-20250911091902-df9299821621
31+
golang.org/x/sync v0.17.0
32+
golang.org/x/text v0.30.0
3033
gopkg.in/yaml.v3 v3.0.1
3134
)
3235

3336
require (
3437
dario.cat/mergo v1.0.2 // indirect
3538
github.com/BurntSushi/toml v1.5.0 // indirect
3639
github.com/Microsoft/go-winio v0.6.2 // indirect
37-
github.com/ProtonMail/go-crypto v1.1.6 // indirect
40+
github.com/ProtonMail/go-crypto v1.3.0 // indirect
3841
github.com/VividCortex/ewma v1.2.0 // indirect
3942
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
40-
github.com/andybalholm/brotli v1.1.1 // indirect
43+
github.com/andybalholm/brotli v1.2.0 // indirect
4144
github.com/buger/jsonparser v1.1.1 // indirect
4245
github.com/c-bata/go-prompt v0.2.6 // indirect
4346
github.com/chzyer/readline v1.5.1 // indirect
@@ -48,7 +51,7 @@ require (
4851
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
4952
github.com/emirpasic/gods v1.18.1 // indirect
5053
github.com/fatih/color v1.16.0 // indirect
51-
github.com/forPelevin/gomoji v1.3.1 // indirect
54+
github.com/forPelevin/gomoji v1.4.0 // indirect
5255
github.com/fsnotify/fsnotify v1.9.0 // indirect
5356
github.com/gfleury/go-bitbucket-v1 v0.0.0-20230825095122-9bc1711434ab // indirect
5457
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
@@ -70,7 +73,7 @@ require (
7073
github.com/jfrog/archiver/v3 v3.6.1 // indirect
7174
github.com/kevinburke/ssh_config v1.2.0 // indirect
7275
github.com/klauspost/compress v1.18.0 // indirect
73-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
76+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
7477
github.com/klauspost/pgzip v1.2.6 // indirect
7578
github.com/ktrysmt/go-bitbucket v0.9.80 // indirect
7679
github.com/manifoldco/promptui v0.9.0 // indirect
@@ -100,7 +103,7 @@ require (
100103
github.com/spf13/pflag v1.0.10 // indirect
101104
github.com/spf13/viper v1.21.0 // indirect
102105
github.com/subosito/gotenv v1.6.0 // indirect
103-
github.com/ulikunitz/xz v0.5.14 // indirect
106+
github.com/ulikunitz/xz v0.5.15 // indirect
104107
github.com/vbauerster/mpb/v8 v8.10.2 // indirect
105108
github.com/xanzy/go-gitlab v0.110.0 // indirect
106109
github.com/xanzy/ssh-agent v0.3.3 // indirect
@@ -110,26 +113,26 @@ require (
110113
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
111114
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
112115
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
116+
golang.org/x/crypto v0.43.0 // indirect
117+
golang.org/x/mod v0.28.0 // indirect
118+
golang.org/x/net v0.45.0 // indirect
119+
golang.org/x/oauth2 v0.31.0 // indirect
120+
golang.org/x/sys v0.37.0 // indirect
121+
golang.org/x/term v0.36.0 // indirect
119122
golang.org/x/time v0.12.0 // indirect
120123
google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
121124
google.golang.org/grpc v1.67.3 // indirect
122-
google.golang.org/protobuf v1.36.6 // indirect
125+
google.golang.org/protobuf v1.36.8 // indirect
123126
gopkg.in/ini.v1 v1.67.0 // indirect
124127
gopkg.in/warnings.v0 v0.1.2 // indirect
125128
)
126129

127130
// attiasas:xray_get_violations_api
128-
replace github.com/jfrog/jfrog-client-go => github.com/attiasas/jfrog-client-go v0.0.0-20250916121001-bf30b1660ad0
131+
replace github.com/jfrog/jfrog-client-go => github.com/attiasas/jfrog-client-go v0.0.0-20251023125440-f42e01cfd9d7
129132

130133
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 master
131134

132-
// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory main
135+
//replace github.com/jfrog/jfrog-cli-artifactory => github.com/fluxxBot/jfrog-cli-artifactory v0.0.0-20251017061455-6a03988302bf
133136

134137
// replace github.com/jfrog/build-info-go => github.com/attiasas/build-info-go dev
135138

0 commit comments

Comments
 (0)