Set unique_id_from_tool from matrix field in Dependency Track parser#14380
Conversation
|
This appears to be a different approach to #14346 |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
@samiat4911 Didn't realize the |
…uln_id_from_tool - Initialize unique_id_from_tool from the top-level matrix field (backward compat) - Override with vulnerability.matrix if present (newer DT export formats) - Initialize vuln_id_from_tool to None before conditional assignment - Remove duplicate unique_id_from_tool kwarg that caused a syntax error - Update test assertion to expect the full composite matrix string
|
I did some checking in my instance of Dependency Track and turns out the |
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
FYI @AndreVirtimo |
|
Thanks for the quick review and for taking care of those merge conflicts, @valentijnscholten Glad the matrix field ended up doing the trick. Appreciate you getting this into 2.56.0! ): |
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.