Conversation
Tenable's description field carries per-scan data - timestamps and affected hosts - that differs between two scans of the very same vulnerability. Because it is part of HASHCODE_FIELDS_PER_SCANNER, the hash_code changes on every reimport and the finding never deduplicates against its own earlier occurrence. The remaining fields (title, severity, vulnerability_ids, cwe) are stable properties of the vulnerability and already match the Nexpose Scan entry. Fixes DefectDojo#11994 Signed-off-by: Elaria <3.14hell@gmail.com>
This branch has not been deployed
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.
Fixes #11994
The defect
HASHCODE_FIELDS_PER_SCANNER["Tenable Scan"]includesdescription. Tenable puts scan-run data in that field — timestamps, the hosts the plugin fired on — so two scans of the very same vulnerability produce two different descriptions, and therefore two differenthash_codevalues. Deduplication then never matches a finding against its own earlier occurrence, and every reimport creates a new finding.The other four fields in the entry (
title,severity,vulnerability_ids,cwe) are stable properties of the vulnerability itself. Droppingdescriptionleaves the entry identical to theNexpose Scanone, which is the same class of network scanner.The change
One line in
dojo/settings/settings.dist.py, plus a regression test inunittests/test_dedupe_config_checks.pythat assertsdescriptionstays out of the Tenable entry and says why.What I ran
Python 3.13,
unittests/test_dedupe_config_checks.py(aSimpleTestCase, so no database is needed):descriptionput back into the Tenable entry: 7 tests, 1 failure, the new test, withAssertionError: 'description' unexpectedly found in ['title', 'severity', 'vulnerability_ids', 'cwe', 'description']So the test fails without the fix and passes with it.
Note on existing data
This changes how the
hash_codeof new Tenable findings is computed. Findings already stored keep their old hash until they are recomputed, which is the same situation as any other change toHASHCODE_FIELDS_PER_SCANNER. Happy to add a note to the upgrade documentation if you would like one for this release.