File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
dojo/tools/wizcli_common_parsers Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
1
from dojo .models import Finding
2
2
3
+ logger = logging .getLogger (__name__ )
4
+
5
+ # Mapping from Wiz severities to DefectDojo severities
6
+ SEVERITY_MAPPING = {
7
+ "CRITICAL" : "Critical" ,
8
+ "HIGH" : "High" ,
9
+ "MEDIUM" : "Medium" ,
10
+ "LOW" : "Low" ,
11
+ "INFORMATIONAL" : "Info" ,
12
+ "INFO" : "Info" ,
13
+ "UNKNOWN" : "Info" , # Default for unknown severities
14
+ }
15
+
3
16
4
17
class WizcliParsers :
5
18
6
19
@staticmethod
7
- def parse_libraries (libraries , test ):
8
- findings = []
9
- if libraries :
10
- for library in libraries :
11
- lib_name = library .get ("name" , "N/A" )
12
- lib_version = library .get ("version" , "N/A" )
13
- lib_path = library .get ("path" , "N/A" )
14
- vulnerabilities = library .get ("vulnerabilities" , [])
20
+ def get_severity (severity_str ):
21
+ """Maps Wiz severity strings to DefectDojo standard TitleCase."""
22
+ if severity_str :
23
+ return SEVERITY_MAPPING .get (severity_str .upper (), "Info" )
24
+ return "Info" # Default if severity is missing or None
15
25
16
26
for vulnerability in vulnerabilities :
17
27
vuln_name = vulnerability .get ("name" , "N/A" )
You can’t perform that action at this time.
0 commit comments