Fix: Add pluginID as unique_id_from_tool for Tenable XML parser #12886
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
This PR adds support for using the pluginID field from Tenable .nessus scan files as the unique_id_from_tool value in DefectDojo findings.
This enables proper deduplication between scans and reimports when using Tenable Scan, which currently does not populate a unique ID and thus prevents deduplication.
A single line was added to the Tenable parser (dojo/tools/tenable/xml_format.py) to extract the pluginID attribute and pass it into the Finding() constructor as unique_id_from_tool.
Test results
Manual testing done using the following steps:
Uploaded a .nessus scan via the UI and API (import-scan)
Verified that unique_id_from_tool is set correctly for each finding
curl -X GET "https://<dojo>/api/v2/findings/?test=<test_id>" -H "Authorization: Token <TOKEN>" | jq '.results[] | {title, unique_id_from_tool, duplicate}'
All findings show the correct unique_id_from_tool values based on Tenable's pluginID.
Documentation
No additional documentation needed. The change aligns with existing parser logic and improves deduplication without changing behavior for other tools.
Suggested labels: bugfix, Import Scans.