Skip to content

Commit b35d46f

Browse files
unique_id_from_tool: clarify values and usage (#12463)
* unique_id_from_tool_remark * unique_id_from_tool_remark * unique_id_from_tool_remark * add migration for textual changes
1 parent 4e3c6f4 commit b35d46f

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
@@ -2562,7 +2562,7 @@ class Finding(models.Model):
25622562
blank=True,
25632563
max_length=500,
25642564
verbose_name=_("Unique ID from tool"),
2565-
help_text=_("Vulnerability technical id from the source tool. Allows to track unique vulnerabilities."))
2565+
help_text=_("Vulnerability technical id from the source tool. Allows to track unique vulnerabilities over time across subsequent scans."))
25662566
vuln_id_from_tool = models.CharField(null=True,
25672567
blank=True,
25682568
max_length=500,

dojo/settings/settings.dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,8 @@ def saml2_attrib_map_format(din):
14351435
# legacy one with multiple conditions (default mode)
14361436
DEDUPE_ALGO_LEGACY = "legacy"
14371437
# based on dojo_finding.unique_id_from_tool only (for checkmarx detailed, or sonarQube detailed for example)
1438+
# 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.
1439+
# If this is not the case, the values can still be useful to set on the finding model without using them for deduplication.
14381440
DEDUPE_ALGO_UNIQUE_ID_FROM_TOOL = "unique_id_from_tool"
14391441
# based on dojo_finding.hash_code only
14401442
DEDUPE_ALGO_HASH_CODE = "hash_code"

0 commit comments

Comments
 (0)