Set unique_id_from_tool from matrix field in Dependency Track parser#14380
Open
samiat4911 wants to merge 1 commit intoDefectDojo:devfrom
Open
Set unique_id_from_tool from matrix field in Dependency Track parser#14380samiat4911 wants to merge 1 commit intoDefectDojo:devfrom
samiat4911 wants to merge 1 commit intoDefectDojo:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Dependency Track parser currently sets
vuln_id_from_toolbut never setsunique_id_from_tool. Users who configure theunique_id_from_tool_or_hash_codededuplication algorithm experience duplicate findings on reimport because the field is empty.Approach: This PR maps the Dependency Track FPF finding's
matrixfield (a stable composite ofproject_uuid:component_uuid:vulnerability_uuid) to theunique_id_from_toolfield on theFindingmodel. The default deduplication algorithm (hash_code) is unchanged, ensuring existing deployments are not negatively affected.Impact: Enables accurate cross-scan deduplication for Dependency Track imports, improving data integrity and scalability for organisations managing large vulnerability datasets.
Test results
tests/unittests/tools/test_dependency_track_parser.pywithunique_id_from_toolassertions across 4 existing test cases (test_has_one_finding,test_v3_8_0,test_findings_with_alias,test_findings_with_cvssV3_score).matrixfield and pass the new assertions.Visual Evidence (Parser Changes):
Visual Evidence (Test Changes):
Checklist
This checklist is for your information.
dev.dev.bugfixbranch.