Skip to content

Commit 34cf1bd

Browse files
committed
feat(parsers): configure Xygeni deduplication algorithms
Wire the three Xygeni scan types into DEDUPLICATION_ALGORITHM_PER_PARSER in settings.dist.py so re-imports dedup against the vendor-stable uniqueHash instead of the legacy heuristic: - Xygeni SAST Scan, Xygeni Secrets Scan: DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL. - Xygeni SCA Scan: DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL_OR_HASH_CODE with HASHCODE_FIELDS_PER_SCANNER set to (vulnerability_ids, component_name, component_version) and HASHCODE_ALLOWS_NULL_CWE: True, enabling cross-tool dedup with other SCA parsers when a CVE matches a package at the same version. Document the per-scan-type algorithm in the parser docs page. Refs: #14755
1 parent 0f3942c commit 34cf1bd

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

docs/content/supported_tools/parsers/file/xygeni.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,18 @@ The kind-specific payload then follows:
6262
Sample Xygeni JSON reports can be found
6363
[here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/xygeni).
6464

65-
### Default Deduplication Hashcode Fields
66-
The parser sets `unique_id_from_tool` from each finding's vendor-stable
67-
`uniqueHash`, so re-importing the same Xygeni report does not duplicate
68-
findings. `vuln_id_from_tool` is set from `issueId`.
65+
### Deduplication
66+
67+
Every finding carries `unique_id_from_tool` (set from Xygeni's vendor-stable
68+
`uniqueHash`) and `vuln_id_from_tool` (set from `issueId`). The deduplication
69+
algorithm is configured per scan type:
70+
71+
| Scan type | Algorithm | Hash-code fields (fallback) |
72+
| -------------------- | ---------------------------------- | -------------------------------------------------------------- |
73+
| Xygeni SAST Scan | `unique_id_from_tool` | n/a |
74+
| Xygeni SCA Scan | `unique_id_from_tool_or_hash_code` | `vulnerability_ids`, `component_name`, `component_version` |
75+
| Xygeni Secrets Scan | `unique_id_from_tool` | n/a |
76+
77+
For SCA the hash-code fallback enables cross-tool deduplication: the same
78+
CVE on the same package@version reported by Xygeni and another SCA scanner
79+
(Snyk, Trivy, etc.) collapse into a single Finding.

dojo/settings/settings.dist.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ def saml2_attrib_map_format(din):
15121512
"n0s1 Scanner": ["description"],
15131513
"IriusRisk Threats Scan": ["title", "component_name"],
15141514
"Orca Security Alerts": ["title", "component_name"],
1515+
"Xygeni SCA Scan": ["vulnerability_ids", "component_name", "component_version"],
15151516
}
15161517

15171518
# Override the hardcoded settings here via the env var
@@ -1586,6 +1587,7 @@ def saml2_attrib_map_format(din):
15861587
"Cyberwatch scan (Galeax)": True,
15871588
"OpenVAS Parser v2": True,
15881589
"OpenReports": True,
1590+
"Xygeni SCA Scan": True,
15891591
}
15901592

15911593
# List of fields that are known to be usable in hash_code computation)
@@ -1781,6 +1783,9 @@ def saml2_attrib_map_format(din):
17811783
"OpenReports": DEDUPE_ALGO_HASH_CODE,
17821784
"IriusRisk Threats Scan": DEDUPE_ALGO_HASH_CODE,
17831785
"Orca Security Alerts": DEDUPE_ALGO_HASH_CODE,
1786+
"Xygeni SAST Scan": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL,
1787+
"Xygeni SCA Scan": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL_OR_HASH_CODE,
1788+
"Xygeni Secrets Scan": DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL,
17841789
}
17851790

17861791
# Override the hardcoded settings here via the env var

0 commit comments

Comments
 (0)