diff --git a/dojo/fixtures/dojo_testdata.json b/dojo/fixtures/dojo_testdata.json index 50707a2d2bf..444f8349833 100644 --- a/dojo/fixtures/dojo_testdata.json +++ b/dojo/fixtures/dojo_testdata.json @@ -1607,7 +1607,7 @@ "url": null, "notes": [], "dynamic_finding": false, - "hash_code": "9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa", + "hash_code": "bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8", "last_reviewed": null } }, @@ -1655,7 +1655,7 @@ "url": null, "notes": [], "dynamic_finding": false, - "hash_code": "9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa", + "hash_code": "bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8", "last_reviewed": null } }, diff --git a/dojo/fixtures/dojo_testdata_locations.json b/dojo/fixtures/dojo_testdata_locations.json index 3d4eb06ff9b..a83cf20d84c 100644 --- a/dojo/fixtures/dojo_testdata_locations.json +++ b/dojo/fixtures/dojo_testdata_locations.json @@ -1632,7 +1632,7 @@ "url": null, "notes": [], "dynamic_finding": false, - "hash_code": "9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa", + "hash_code": "bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8", "last_reviewed": null } }, @@ -1680,7 +1680,7 @@ "url": null, "notes": [], "dynamic_finding": false, - "hash_code": "9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa", + "hash_code": "bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8", "last_reviewed": null } }, diff --git a/dojo/settings/settings.dist.py b/dojo/settings/settings.dist.py index adcd4b2f2fe..bc7febc0a44 100644 --- a/dojo/settings/settings.dist.py +++ b/dojo/settings/settings.dist.py @@ -1081,6 +1081,15 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param "Burp Scan": ["title", "severity", "vuln_id_from_tool"], "CargoAudit Scan": ["vulnerability_ids", "severity", "component_name", "component_version", "vuln_id_from_tool"], "Checkmarx Scan": ["cwe", "severity", "file_path"], + # Same three fields as "Checkmarx CxFlow SAST" below, and for the same reason: the + # detailed mode of this parser sets vuln_id_from_tool (queryId), file_path (sinkFilename) + # and line (sinkLineNumber) on every finding, so all three are populated and none of them + # carries scan text. Without an entry here the scan type fell through to the legacy field + # set, which includes `description` -- so a parser change that reworded a finding moved its + # hash_code, which is the fragility this list exists to avoid. The algorithm for this scan + # type is unique_id_from_tool, so the change moves the stored hash without changing how + # candidates are looked up. + "Checkmarx Scan detailed": ["vuln_id_from_tool", "file_path", "line"], "Checkmarx OSA": ["vulnerability_ids", "component_name"], "Cloudsploit Scan": ["title", "description"], "Coverity Scan JSON Report": ["title", "cwe", "line", "file_path", "description"], diff --git a/unittests/test_deduplication_logic.py b/unittests/test_deduplication_logic.py index 85cf9127775..caa75f1872b 100644 --- a/unittests/test_deduplication_logic.py +++ b/unittests/test_deduplication_logic.py @@ -112,8 +112,8 @@ # engagement 5: April monthly engagement (dedupe_inside: True) # test 55: Checkmarx Scan detailed (algo=unique_id_from_tool, dynamic=False) # findings: -# 124 : "Low Impact Test Find": Low : act: True : ver: True : mit: False: dup: False: dup_id: None: hash_code: 9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa: eps: 0: notes: []: uid: 12345 -# 125 : "Low Impact Test Find": Low : act: True : ver: True : mit: False: dup: True : dup_id: None: hash_code: 9aca00affd340c4da02c934e7e3106a45c6ad0911da479daae421b3b28a2c1aa: eps: 0: notes: []: uid: 12345 +# 124 : "Low Impact Test Find": Low : act: True : ver: True : mit: False: dup: False: dup_id: None: hash_code: bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8: eps: 0: notes: []: uid: 12345 +# 125 : "Low Impact Test Find": Low : act: True : ver: True : mit: False: dup: True : dup_id: None: hash_code: bc912aacda3a8707cbf94b96e6350a5cc77e7ef4a29a1442cb1a041e4e1f38d8: eps: 0: notes: []: uid: 12345 # endpoints # 2: ftp://localhost/ # 1: http://127.0.0.1/endpoint/420/edit/