Skip to content

Commit 03faf11

Browse files
committed
fix: Add file_path to deduplication key for Anchore Grype parser
Modified dupe_key in parser to include file_path, preventing same CVE found in different binaries from being merged into a single finding Reference : DefectDojo#14573
1 parent ccb4021 commit 03faf11

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

dojo/tools/anchore_grype/parser.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,15 @@ def get_findings(self, file, test):
185185
if finding_epss_score is None and rel_vuln_id:
186186
finding_epss_score, finding_epss_percentile = self.get_epss_values(vuln_id, vuln_epss)
187187

188-
dupe_key = finding_title
188+
dupe_key = "|".join(
189+
[
190+
vuln_id,
191+
artifact_name,
192+
artifact_version,
193+
file_path,
194+
],
195+
)
196+
189197
if dupe_key in dupes:
190198
finding = dupes[dupe_key]
191199
finding.nb_occurences += 1

0 commit comments

Comments
 (0)