Skip to content

Commit 9d31f71

Browse files
valentijnscholtenxansec
authored andcommitted
unique_id_from_tool: clarify values and usage (DefectDojo#12463)
* unique_id_from_tool_remark * unique_id_from_tool_remark * unique_id_from_tool_remark * add migration for textual changes
1 parent f59f721 commit 9d31f71

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

docs/content/en/open_source/contributing/how-to-write-a-parser.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ Bad example (DIY):
233233

234234
By default a new parser uses the 'legacy' deduplication algorithm documented at https://documentation.defectdojo.com/usage/features/#deduplication-algorithms
235235

236-
Please use a pre-defined deduplication algorithm where applicable.
236+
Please use a pre-defined deduplication algorithm where applicable. When using the `unique_id_from_tool` or `vuln_id_from_tool` fields in the hash code configuration, it's important that these are uqniue for the finding and constant over time across subsequent scans. If this is not the case, the values can still be useful to set on the finding model without using them for deduplication.
237+
The values must be coming from the report directly and must not be something that is calculated by the parser internally.
237238

238239
## Unit tests
239240

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.1.8 on 2025-05-19 16:14
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dojo', '0228_alter_jira_username_password'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='finding',
15+
name='unique_id_from_tool',
16+
field=models.CharField(blank=True, help_text='Vulnerability technical id from the source tool. Allows to track unique vulnerabilities over time across subsequent scans.', max_length=500, null=True, verbose_name='Unique ID from tool'),
17+
),
18+
]

dojo/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ class Finding(models.Model):
25592559
blank=True,
25602560
max_length=500,
25612561
verbose_name=_("Unique ID from tool"),
2562-
help_text=_("Vulnerability technical id from the source tool. Allows to track unique vulnerabilities."))
2562+
help_text=_("Vulnerability technical id from the source tool. Allows to track unique vulnerabilities over time across subsequent scans."))
25632563
vuln_id_from_tool = models.CharField(null=True,
25642564
blank=True,
25652565
max_length=500,

dojo/settings/settings.dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,8 @@ def saml2_attrib_map_format(din):
14381438
# legacy one with multiple conditions (default mode)
14391439
DEDUPE_ALGO_LEGACY = "legacy"
14401440
# based on dojo_finding.unique_id_from_tool only (for checkmarx detailed, or sonarQube detailed for example)
1441+
# When using the `unique_id_from_tool` or `vuln_id_from_tool` fields for dedupication, it's important that these are uqniue for the finding and constant over time across subsequent scans.
1442+
# If this is not the case, the values can still be useful to set on the finding model without using them for deduplication.
14411443
DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL = "unique_id_from_tool"
14421444
# based on dojo_finding.hash_code only
14431445
DEDUPE_ALGO_HASH_CODE = "hash_code"

0 commit comments

Comments
 (0)