Skip to content

Commit 7753671

Browse files
committed
Merge branch 'jas-violations-support' of https://github.com/eranturgeman/jfrog-cli-security into skip-not-applicable-cves
# Conflicts: # go.mod # go.sum # utils/results/common.go
2 parents d9dde38 + 5f7f30e commit 7753671

File tree

25 files changed

+577
-227
lines changed

25 files changed

+577
-227
lines changed

commands/audit/audit_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func TestDetectScansToPerform(t *testing.T) {
5757
ScanTarget: results.ScanTarget{
5858
Target: filepath.Join(dir, "Nuget"),
5959
},
60-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
60+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
6161
},
6262
{
6363
ScanTarget: results.ScanTarget{
6464
Technology: techutils.Go,
6565
Target: filepath.Join(dir, "dir", "go"),
6666
},
67-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
67+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
6868
ScaResults: &results.ScaScanResults{
6969
Descriptors: []string{filepath.Join(dir, "dir", "go", "go.mod")},
7070
},
@@ -74,7 +74,7 @@ func TestDetectScansToPerform(t *testing.T) {
7474
Technology: techutils.Maven,
7575
Target: filepath.Join(dir, "dir", "maven"),
7676
},
77-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
77+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
7878
ScaResults: &results.ScaScanResults{
7979
Descriptors: []string{
8080
filepath.Join(dir, "dir", "maven", "maven-sub", "pom.xml"),
@@ -88,7 +88,7 @@ func TestDetectScansToPerform(t *testing.T) {
8888
Technology: techutils.Npm,
8989
Target: filepath.Join(dir, "dir", "npm"),
9090
},
91-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
91+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
9292
ScaResults: &results.ScaScanResults{
9393
Descriptors: []string{filepath.Join(dir, "dir", "npm", "package.json")},
9494
},
@@ -98,7 +98,7 @@ func TestDetectScansToPerform(t *testing.T) {
9898
ScanTarget: results.ScanTarget{
9999
Target: filepath.Join(dir, "yarn"),
100100
},
101-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
101+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
102102
},
103103
},
104104
},
@@ -116,7 +116,7 @@ func TestDetectScansToPerform(t *testing.T) {
116116
Technology: techutils.Nuget,
117117
Target: filepath.Join(dir, "Nuget"),
118118
},
119-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
119+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
120120
ScaResults: &results.ScaScanResults{
121121
Descriptors: []string{filepath.Join(dir, "Nuget", "Nuget-sub", "project.csproj"), filepath.Join(dir, "Nuget", "project.sln")},
122122
},
@@ -126,7 +126,7 @@ func TestDetectScansToPerform(t *testing.T) {
126126
Technology: techutils.Go,
127127
Target: filepath.Join(dir, "dir", "go"),
128128
},
129-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
129+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
130130
ScaResults: &results.ScaScanResults{
131131
Descriptors: []string{filepath.Join(dir, "dir", "go", "go.mod")},
132132
},
@@ -136,7 +136,7 @@ func TestDetectScansToPerform(t *testing.T) {
136136
Technology: techutils.Maven,
137137
Target: filepath.Join(dir, "dir", "maven"),
138138
},
139-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
139+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
140140
ScaResults: &results.ScaScanResults{
141141
Descriptors: []string{
142142
filepath.Join(dir, "dir", "maven", "maven-sub", "pom.xml"),
@@ -150,7 +150,7 @@ func TestDetectScansToPerform(t *testing.T) {
150150
Technology: techutils.Npm,
151151
Target: filepath.Join(dir, "dir", "npm"),
152152
},
153-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
153+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
154154
ScaResults: &results.ScaScanResults{
155155
Descriptors: []string{filepath.Join(dir, "dir", "npm", "package.json")},
156156
},
@@ -160,7 +160,7 @@ func TestDetectScansToPerform(t *testing.T) {
160160
Technology: techutils.Yarn,
161161
Target: filepath.Join(dir, "yarn"),
162162
},
163-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
163+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
164164
ScaResults: &results.ScaScanResults{
165165
Descriptors: []string{filepath.Join(dir, "yarn", "package.json")},
166166
},
@@ -170,7 +170,7 @@ func TestDetectScansToPerform(t *testing.T) {
170170
Technology: techutils.Pip,
171171
Target: filepath.Join(dir, "yarn", "Pip"),
172172
},
173-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
173+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
174174
ScaResults: &results.ScaScanResults{
175175
Descriptors: []string{filepath.Join(dir, "yarn", "Pip", "requirements.txt")},
176176
},
@@ -180,7 +180,7 @@ func TestDetectScansToPerform(t *testing.T) {
180180
Technology: techutils.Pipenv,
181181
Target: filepath.Join(dir, "yarn", "Pipenv"),
182182
},
183-
JasResults: &results.JasScansResults{JasVulnerabilities: &results.JasScanResults{}, JasViolations: &results.JasScanResults{}},
183+
JasResults: &results.JasScansResults{JasVulnerabilities: results.JasScanResults{}, JasViolations: results.JasScanResults{}},
184184
ScaResults: &results.ScaScanResults{
185185
Descriptors: []string{filepath.Join(dir, "yarn", "Pipenv", "Pipfile")},
186186
},

commands/audit/sca/common.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,25 @@ func RunXrayDependenciesTreeScanGraph(scanGraphParams *scangraph.ScanGraphParams
5959
return
6060
}
6161

62+
func GetScaScanStatusCode(err error, result *services.ScanResponse) int {
63+
if err != nil || result == nil || result.ScannedStatus == "Failed" {
64+
return 1
65+
}
66+
return 0
67+
}
68+
69+
func GetScaScansStatusCode(err error, results ...services.ScanResponse) int {
70+
if err != nil {
71+
return 1
72+
}
73+
for _, result := range results {
74+
if result.ScannedStatus == "Failed" {
75+
return 1
76+
}
77+
}
78+
return 0
79+
}
80+
6281
func CreateTestWorkspace(t *testing.T, sourceDir string) (string, func()) {
6382
return tests.CreateTestWorkspace(t, filepath.Join("..", "..", "..", "..", "tests", "testdata", sourceDir))
6483
}

commands/audit/scarunner.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,17 @@ func executeScaScanTask(auditParallelRunner *utils.SecurityParallelRunner, serve
132132
log.Info(clientutils.GetLogMsgPrefix(threadId, false)+"Running SCA scan for", scan.Target, "vulnerable dependencies in", scan.Target, "directory...")
133133
// Scan the dependency tree.
134134
scanResults, xrayErr := runScaWithTech(scan.Technology, auditParams, serverDetails, *treeResult.FlatTree, treeResult.FullDepTrees)
135+
136+
auditParallelRunner.ResultsMu.Lock()
137+
defer auditParallelRunner.ResultsMu.Unlock()
138+
139+
scan.NewScaScanResults(sca.GetScaScansStatusCode(xrayErr, scanResults...), scanResults...).IsMultipleRootProject = clientutils.Pointer(len(treeResult.FullDepTrees) > 1)
140+
addThirdPartyDependenciesToParams(auditParams, scan.Technology, treeResult.FlatTree, treeResult.FullDepTrees)
141+
135142
if xrayErr != nil {
136143
return fmt.Errorf("%s Xray dependency tree scan request on '%s' failed:\n%s", clientutils.GetLogMsgPrefix(threadId, false), scan.Technology, xrayErr.Error())
137144
}
138-
auditParallelRunner.ResultsMu.Lock()
139-
scan.NewScaScanResults(scanResults...).IsMultipleRootProject = clientutils.Pointer(len(treeResult.FullDepTrees) > 1)
140-
addThirdPartyDependenciesToParams(auditParams, scan.Technology, treeResult.FlatTree, treeResult.FullDepTrees)
141145
err = dumpScanResponseToFileIfNeeded(scanResults, auditParams.scanResultsOutputDir, utils.ScaScan)
142-
auditParallelRunner.ResultsMu.Unlock()
143146
return
144147
}
145148
}

commands/enrich/enrich.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/jfrog/jfrog-cli-core/v2/common/spec"
1515
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
1616
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
17+
"github.com/jfrog/jfrog-cli-security/commands/audit/sca"
1718
"github.com/jfrog/jfrog-cli-security/commands/enrich/enrichgraph"
1819
"github.com/jfrog/jfrog-cli-security/utils"
1920
"github.com/jfrog/jfrog-cli-security/utils/results"
@@ -265,7 +266,7 @@ func (enrichCmd *EnrichCommand) createIndexerHandlerFunc(indexedFileProducer par
265266
if err != nil {
266267
return targetResults.AddTargetError(fmt.Errorf("%s failed to import graph: %s", logPrefix, err.Error()), false)
267268
}
268-
targetResults.NewScaScanResults(*scanResults)
269+
targetResults.NewScaScanResults(sca.GetScaScanStatusCode(err, scanResults), *scanResults)
269270
targetResults.Technology = techutils.Technology(scanResults.ScannedPackageType)
270271
return
271272
}

commands/scan/buildscan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (bsc *BuildScanCommand) runBuildScanAndPrintResults(xrayManager *xray.XrayS
147147

148148
cmdResults := results.NewCommandResults(utils.Build).SetXrayVersion(xrayVersion)
149149
scanResults := cmdResults.NewScanResults(results.ScanTarget{Name: fmt.Sprintf("%s (%s)", params.BuildName, params.BuildNumber)})
150-
scanResults.NewScaScanResults(services.ScanResponse{
150+
scanResults.NewScaScanResults(0, services.ScanResponse{
151151
Violations: buildScanResults.Violations,
152152
Vulnerabilities: buildScanResults.Vulnerabilities,
153153
XrayDataUrl: buildScanResults.MoreDetailsUrl,

commands/scan/scan.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"golang.org/x/exp/slices"
1616

1717
jfrogappsconfig "github.com/jfrog/jfrog-apps-config/go"
18+
"github.com/jfrog/jfrog-cli-security/commands/audit/sca"
1819
"github.com/jfrog/jfrog-cli-security/jas"
1920
"github.com/jfrog/jfrog-cli-security/jas/applicability"
2021
"github.com/jfrog/jfrog-cli-security/jas/runner"
@@ -470,7 +471,7 @@ func (scanCmd *ScanCommand) createIndexerHandlerFunc(file *spec.File, cmdResults
470471
if err != nil {
471472
return targetResults.AddTargetError(fmt.Errorf("%s sca scanning '%s' failed with error: %s", scanLogPrefix, graph.Id, err.Error()), false)
472473
} else {
473-
targetResults.NewScaScanResults(*graphScanResults)
474+
targetResults.NewScaScanResults(sca.GetScaScanStatusCode(err, graphScanResults), *graphScanResults)
474475
targetResults.Technology = techutils.Technology(graphScanResults.ScannedPackageType)
475476
}
476477
if !cmdResults.EntitledForJas {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ require (
112112
)
113113

114114
// attiasas:add_repo_context_scan_graph
115-
replace github.com/jfrog/jfrog-client-go => github.com/eranturgeman/jfrog-client-go v0.0.0-20241203155523-a45a65df37a2
115+
replace github.com/jfrog/jfrog-client-go => github.com/attiasas/jfrog-client-go v0.0.0-20241202121042-ba0c6c74db7a
116116

117117
// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev
118118

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW
2222
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
2323
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
2424
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
25+
github.com/attiasas/jfrog-client-go v0.0.0-20241202121042-ba0c6c74db7a h1:47orWZJqdB4YIiqnYd0ysEjvqXiwy3eadwKkHo6s1qg=
26+
github.com/attiasas/jfrog-client-go v0.0.0-20241202121042-ba0c6c74db7a/go.mod h1:1a7bmQHkRmPEza9wva2+WVrYzrGbosrMymq57kyG5gU=
2527
github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs=
2628
github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA=
2729
github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M=
@@ -57,8 +59,6 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcej
5759
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
5860
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
5961
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
60-
github.com/eranturgeman/jfrog-client-go v0.0.0-20241203155523-a45a65df37a2 h1:3CSNTx8Vcr6/BQJY5g38wqZjnoCOYj2EK6sHanyteQI=
61-
github.com/eranturgeman/jfrog-client-go v0.0.0-20241203155523-a45a65df37a2/go.mod h1:1a7bmQHkRmPEza9wva2+WVrYzrGbosrMymq57kyG5gU=
6262
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
6363
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
6464
github.com/forPelevin/gomoji v1.2.0 h1:9k4WVSSkE1ARO/BWywxgEUBvR/jMnao6EZzrql5nxJ8=

jas/analyzermanager.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,27 @@ func GetAnalyzerManagerEnvVariables(serverDetails *config.ServerDetails) (envVar
158158
}
159159

160160
func ParseAnalyzerManagerError(scanner jasutils.JasScanType, err error) (formatErr error) {
161+
exitCode := GetAnalyzerManagerExitCode(err)
162+
if err == nil {
163+
return
164+
}
165+
if exitCodeDescription, exitCodeExists := exitCodeErrorsMap[exitCode]; exitCodeExists {
166+
log.Warn(exitCodeDescription)
167+
return nil
168+
}
169+
return fmt.Errorf(ErrFailedScannerRun, scanner, err.Error())
170+
}
171+
172+
func GetAnalyzerManagerExitCode(err error) int {
161173
var exitError *exec.ExitError
162174
if errors.As(err, &exitError) {
163-
exitCode := exitError.ExitCode()
164-
if exitCodeDescription, exitCodeExists := exitCodeErrorsMap[exitCode]; exitCodeExists {
165-
log.Warn(exitCodeDescription)
166-
return nil
167-
}
175+
return exitError.ExitCode()
168176
}
169177
if err != nil {
170-
return fmt.Errorf(ErrFailedScannerRun, scanner, err.Error())
178+
// An exit code of -1 is used to indicate that an error occurred before the command was executed or that the exit code could not be determined.
179+
return -1
171180
}
172-
return
181+
return 0
173182
}
174183

175184
// Download the latest AnalyzerManager executable if not cached locally.

jas/runner/jasrunner.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,14 @@ func runSecretsScan(securityParallelRunner *utils.SecurityParallelRunner, scanne
134134
securityParallelRunner.JasScannersWg.Done()
135135
}()
136136
vulnerabilitiesResults, violationsResults, err := secrets.RunSecretsScan(scanner, secretsScanType, module, threadId)
137+
securityParallelRunner.ResultsMu.Lock()
138+
defer securityParallelRunner.ResultsMu.Unlock()
139+
140+
extendedScanResults.NewJasScanResults(jasutils.Secrets, vulnerabilitiesResults, violationsResults, jas.GetAnalyzerManagerExitCode(err))
141+
137142
if err != nil {
138143
return fmt.Errorf("%s%s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
139144
}
140-
securityParallelRunner.ResultsMu.Lock()
141-
defer securityParallelRunner.ResultsMu.Unlock()
142-
extendedScanResults.JasVulnerabilities.SecretsScanResults = append(extendedScanResults.JasVulnerabilities.SecretsScanResults, vulnerabilitiesResults...)
143-
extendedScanResults.JasViolations.SecretsScanResults = append(extendedScanResults.JasViolations.SecretsScanResults, violationsResults...)
144145
err = dumpSarifRunToFileIfNeeded(vulnerabilitiesResults, scansOutputDir, jasutils.Secrets)
145146
return
146147
}
@@ -153,13 +154,14 @@ func runIacScan(securityParallelRunner *utils.SecurityParallelRunner, scanner *j
153154
securityParallelRunner.JasScannersWg.Done()
154155
}()
155156
vulnerabilitiesResults, violationsResults, err := iac.RunIacScan(scanner, module, threadId)
156-
if err != nil {
157-
return fmt.Errorf("%s %s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
158-
}
159157
securityParallelRunner.ResultsMu.Lock()
160158
defer securityParallelRunner.ResultsMu.Unlock()
161-
extendedScanResults.JasVulnerabilities.IacScanResults = append(extendedScanResults.JasVulnerabilities.IacScanResults, vulnerabilitiesResults...)
162-
extendedScanResults.JasViolations.IacScanResults = append(extendedScanResults.JasViolations.IacScanResults, violationsResults...)
159+
160+
extendedScanResults.NewJasScanResults(jasutils.IaC, vulnerabilitiesResults, violationsResults, jas.GetAnalyzerManagerExitCode(err))
161+
162+
if err != nil {
163+
return fmt.Errorf("%s%s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
164+
}
163165
err = dumpSarifRunToFileIfNeeded(vulnerabilitiesResults, scansOutputDir, jasutils.IaC)
164166
return
165167
}
@@ -172,13 +174,14 @@ func runSastScan(securityParallelRunner *utils.SecurityParallelRunner, scanner *
172174
securityParallelRunner.JasScannersWg.Done()
173175
}()
174176
vulnerabilitiesResults, violationsResults, err := sast.RunSastScan(scanner, module, signedDescriptions, threadId)
175-
if err != nil {
176-
return fmt.Errorf("%s %s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
177-
}
178177
securityParallelRunner.ResultsMu.Lock()
179178
defer securityParallelRunner.ResultsMu.Unlock()
180-
extendedScanResults.JasVulnerabilities.SastScanResults = append(extendedScanResults.JasVulnerabilities.SastScanResults, vulnerabilitiesResults...)
181-
extendedScanResults.JasViolations.SastScanResults = append(extendedScanResults.JasViolations.SastScanResults, violationsResults...)
179+
180+
extendedScanResults.NewJasScanResults(jasutils.Sast, vulnerabilitiesResults, violationsResults, jas.GetAnalyzerManagerExitCode(err))
181+
182+
if err != nil {
183+
return fmt.Errorf("%s%s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
184+
}
182185
err = dumpSarifRunToFileIfNeeded(vulnerabilitiesResults, scansOutputDir, jasutils.Sast)
183186
return
184187
}
@@ -193,12 +196,14 @@ func runContextualScan(securityParallelRunner *utils.SecurityParallelRunner, sca
193196
// Wait for sca scans to complete before running contextual scan
194197
securityParallelRunner.ScaScansWg.Wait()
195198
caScanResults, err := applicability.RunApplicabilityScan(scanResults.GetScaScansXrayResults(), *directDependencies, scanner, thirdPartyApplicabilityScan, scanType, module, threadId)
196-
if err != nil {
197-
return fmt.Errorf("%s %s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
198-
}
199199
securityParallelRunner.ResultsMu.Lock()
200200
defer securityParallelRunner.ResultsMu.Unlock()
201-
scanResults.JasResults.ApplicabilityScanResults = append(scanResults.JasResults.ApplicabilityScanResults, caScanResults...)
201+
202+
scanResults.JasResults.NewApplicabilityScanResults(caScanResults, jas.GetAnalyzerManagerExitCode(err))
203+
204+
if err != nil {
205+
return fmt.Errorf("%s%s", clientutils.GetLogMsgPrefix(threadId, false), err.Error())
206+
}
202207
err = dumpSarifRunToFileIfNeeded(caScanResults, scansOutputDir, jasutils.Applicability)
203208
return
204209
}

0 commit comments

Comments
 (0)