Skip to content

Commit c9f4c07

Browse files
committed
implement a fixed version
1 parent 0611bd9 commit c9f4c07

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.1.11 on 2025-08-28 09:16
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dojo', '0241_remove_system_settings_time_zone'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='finding',
15+
name='fix_version',
16+
field=models.CharField(blank=True, help_text='Version of the affected component where the flaw will be fixed.', max_length=100, null=True, verbose_name='Fix version'),
17+
),
18+
]

dojo/importers/default_reimporter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ def process_matched_mitigated_finding(
433433
"""
434434
if existing_finding.fix_available != unsaved_finding.fix_available:
435435
existing_finding.fix_available = unsaved_finding.fix_available
436+
if existing_finding.fix_version != unsaved_finding.fix_version:
437+
existing_finding.fix_version = unsaved_finding.fix_version
436438

437439
# if the reimported item has a mitigation time, we can compare
438440
if unsaved_finding.is_mitigated:
@@ -542,6 +544,8 @@ def process_matched_active_finding(
542544
logger.debug("Reimported item matches a finding that is currently open.")
543545
if existing_finding.fix_available != unsaved_finding.fix_available:
544546
existing_finding.fix_available = unsaved_finding.fix_available
547+
if existing_finding.fix_version != unsaved_finding.fix_version:
548+
existing_finding.fix_version = unsaved_finding.fix_version
545549
if unsaved_finding.is_mitigated:
546550
logger.debug("Reimported mitigated item matches a finding that is currently open, closing.")
547551
# TODO: Implement a date comparison for opened defectdojo findings before closing them by reimporting,

dojo/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,11 @@ class Finding(models.Model):
24162416
default=None,
24172417
verbose_name=_("Fix Available"),
24182418
help_text=_("Denotes if there is a fix available for this flaw."))
2419+
fix_version = models.CharField(null=True,
2420+
blank=True,
2421+
max_length=100,
2422+
verbose_name=_("Fix version"),
2423+
help_text=_("Version of the affected component where the flaw will be fixed."))
24192424
impact = models.TextField(verbose_name=_("Impact"),
24202425
null=True,
24212426
blank=True,

dojo/templates/dojo/view_finding.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ <h3 class="pull-left finding-title">
556556
{% if finding.component_version %}
557557
<th>Component Version</th>
558558
{% endif %}
559+
{% if finding.fix_version %}
560+
<th>Fixed Version</th>
561+
{% endif %}
559562
{% if finding.has_jira_configured or finding.jira_issue %}
560563
<th>JIRA</th>
561564
<th>JIRA Change</th>
@@ -615,6 +618,13 @@ <h3 class="pull-left finding-title">
615618
</span>
616619
</td>
617620
{% endif %}
621+
{% if finding.fix_version %}
622+
<td>
623+
<span>
624+
{{ finding.fix_version }}
625+
</span>
626+
</td>
627+
{% endif %}
618628
{% if finding.has_jira_configured or finding.has_jira_issue or finding.has_jira_group_issue %}
619629
<td id="jira">
620630
{% if finding.has_jira_group_issue %}

dojo/tools/harbor_vulnerability/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def get_findings(self, filename, test):
8282
component_name=package_name,
8383
component_version=package_version,
8484
cwe=cwe,
85+
fix_version=fix_version,
8586
)
8687
if vulnerability_id:
8788
find.unsaved_vulnerability_ids = [vulnerability_id]

0 commit comments

Comments
 (0)