Skip to content

Commit 2f4b82c

Browse files
committed
remove unique_id_from_tool
1 parent 5e8bd05 commit 2f4b82c

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

dojo/tools/reversinglabs_spectraassure/parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ def _one_finding(
5151
cvssv3_score=node.score,
5252
severity=node.score_severity,
5353
vuln_id_from_tool=node.vuln_id_from_tool,
54-
unique_id_from_tool=node.unique_id_from_tool, # purl if we have one ?
5554
file_path=node.component_file_path,
5655
component_name=node.component_name,
5756
component_version=node.component_version,
5857
nb_occurences=1,
5958
hash_code=key, # sha256 on title
60-
references=None, # future urls
59+
references=None, # future: urls
6160
active=True, # this is the DefectDojo active field, nothing to do with node.active field
6261
test=test,
6362
static_finding=True,
@@ -108,7 +107,7 @@ def get_findings(
108107
self._duplicates[key] = finding
109108
continue
110109

111-
dup = self._duplicates[key] # but that may be on a different component file, name, version
110+
dup = self._duplicates[key]
112111
if dup:
113112
dup.description += finding.description
114113
dup.nb_occurences += 1

dojo/tools/reversinglabs_spectraassure/rlJsonInfo/__init__.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import copy
22
import datetime
3-
import gc
43
import json
54
import logging
6-
import os
75
import sys
86
from typing import Any
97

@@ -90,18 +88,10 @@ def __init__(
9088

9189
self.data: dict[str, Any] = json.load(file_handle)
9290
self._results = {}
93-
94-
self.RL_JSON_WITH_CG_COLLECT: bool = False
95-
if os.getenv("RL_JSON_WITH_CG_COLLECT"):
96-
self.RL_JSON_WITH_CG_COLLECT = True
97-
9891
self._get_info()
9992
self._get_meta()
10093
self._get_rest()
10194

102-
if self.RL_JSON_WITH_CG_COLLECT is True:
103-
gc.collect()
104-
10595
def _get_info(
10696
self,
10797
) -> None:
@@ -407,7 +397,10 @@ def _do_one_cve_component_dependency(
407397
if len(tail) == 0:
408398
tail = f"{dep_name}@{dep_version}"
409399

410-
cin.unique_id_from_tool = f"{cin.component_file_sha256}:{cve}:{tail}"
400+
# should be constant over multiple re-scans (repeatable)
401+
# see: https://github.com/DefectDojo/django-DefectDojo/pull/12463
402+
# cin.unique_id_from_tool = f"{cin.component_file_sha256}:{cve}:{tail}"
403+
# downvoted as not originally from the tool itself.
411404

412405
logger.debug("%s", cin)
413406
return cin
@@ -448,7 +441,8 @@ def _do_one_cve_component_without_dependencies(
448441

449442
# should be constant over multiple re-scans (repeatable)
450443
# see: https://github.com/DefectDojo/django-DefectDojo/pull/12463
451-
cin.unique_id_from_tool = f"{cin.component_file_sha256}:{cve}"
444+
# cin.unique_id_from_tool = f"{cin.component_file_sha256}:{cve}"
445+
# downvoted as not originally from the tool itself.
452446

453447
logger.debug("%s", cin)
454448

0 commit comments

Comments
 (0)