Skip to content

Commit 040f98e

Browse files
authored
fix(CxOne) Use ProjectID instead of ScanID in SARIF Configuration ID (#5517)
1 parent cae453f commit 040f98e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/checkmarxone/cxjson_to_sarif.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func ConvertCxJSONToSarif(sys System, serverURL string, scanResults *[]ScanResul
2525
rulesArray := []format.SarifRule{}
2626

2727
baseURL := serverURL + "/results/" + scanMeta.ScanID + "/" + scanMeta.ProjectID
28+
projectBaseURL := serverURL + "/projects/" + scanMeta.ProjectID + "/"
2829

2930
cweIdsForTaxonomies := make(map[int]int) //use a map to avoid duplicates
3031
cweCounter := 0
@@ -261,7 +262,8 @@ func ConvertCxJSONToSarif(sys System, serverURL string, scanResults *[]ScanResul
261262
sarif.Runs[0].Tool = tool
262263

263264
//handle automationDetails
264-
sarif.Runs[0].AutomationDetails = &format.AutomationDetails{Id: fmt.Sprintf("%v/sast", baseURL)} // Use deeplink to pass a maximum of information
265+
// This field corresponds to the configuration category in GitHub Security tab, it is meant to be used for monorepos so that each project can have its own findings
266+
sarif.Runs[0].AutomationDetails = &format.AutomationDetails{Id: projectBaseURL}
265267

266268
//handle taxonomies
267269
//Only one exists apparently: CWE. It is fixed

0 commit comments

Comments
 (0)