Skip to content

Commit eab351c

Browse files
fix cve for reimport
1 parent 9debfb8 commit eab351c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dojo/importers/default_reimporter.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,9 @@ def process_matched_mitigated_finding(
509509
if existing_finding.get_sla_configuration().restart_sla_on_reactivation:
510510
# restart the sla start date to the current date, finding.save() will set new sla_expiration_date
511511
existing_finding.sla_start_date = self.now
512-
513-
existing_finding.save(dedupe_option=False)
514-
# don't dedupe before endpoints are added
515-
existing_finding.save(dedupe_option=False)
512+
existing_finding = self.process_cve(existing_finding)
513+
# don't dedupe before endpoints are added, postprocessing will be done on next save (in calling method)
514+
existing_finding.save_no_options()
516515
note = Notes(entry=f"Re-activated by {self.scan_type} re-upload.", author=self.user)
517516
note.save()
518517
endpoint_statuses = existing_finding.status_finding.exclude(
@@ -560,6 +559,7 @@ def process_matched_active_finding(
560559
existing_finding.active = False
561560
if self.verified is not None:
562561
existing_finding.verified = self.verified
562+
existing_finding = self.process_cve(existing_finding)
563563
existing_finding.save_no_options()
564564

565565
elif unsaved_finding.risk_accepted or unsaved_finding.false_p or unsaved_finding.out_of_scope:
@@ -574,6 +574,7 @@ def process_matched_active_finding(
574574
existing_finding.active = False
575575
if self.verified is not None:
576576
existing_finding.verified = self.verified
577+
existing_finding = self.process_cve(existing_finding)
577578
existing_finding.save_no_options()
578579
else:
579580
# if finding is the same but list of affected was changed, finding is marked as unchanged. This is a known issue
@@ -609,8 +610,8 @@ def process_finding_that_was_not_matched(
609610
# scan_date was provided, override value from parser
610611
if self.scan_date_override:
611612
unsaved_finding.date = self.scan_date.date()
612-
# Save it. Don't dedupe before endpoints are added.
613613
unsaved_finding = self.process_cve(unsaved_finding)
614+
# Save it. Don't dedupe before endpoints are added.
614615
unsaved_finding.save_no_options()
615616
finding = unsaved_finding
616617
# Force parsers to use unsaved_tags (stored in finding_post_processing function below)
@@ -653,8 +654,8 @@ def finding_post_processing(
653654
# Process vulnerability IDs
654655
if finding_from_report.unsaved_vulnerability_ids:
655656
finding.unsaved_vulnerability_ids = finding_from_report.unsaved_vulnerability_ids
656-
657-
return self.process_vulnerability_ids(self.process_cve(finding))
657+
# legacy cve field has already been processed/set earlier
658+
return self.process_vulnerability_ids(finding)
658659

659660
def process_groups_for_all_findings(
660661
self,

0 commit comments

Comments
 (0)