Skip to content

Commit 94a5afd

Browse files
authored
Merge pull request #1198 from jsalado/dev
Kiuwan import improvements
2 parents 4713b2a + 8b7eaa5 commit 94a5afd

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

dojo/tools/kiuwan/parser.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
class Severityfilter():
1010
def __init__(self):
11-
self.severity_mapping = {'Normal': 'Info',
11+
self.severity_mapping = {'Very Low': 'Info',
1212
'Low': 'Low',
13-
'Medium': 'Medium',
13+
'Normal': 'Medium',
1414
'High': 'High',
1515
'Very High': 'Critical'
1616
}
@@ -46,19 +46,22 @@ def __init__(self, filename, test):
4646
severityfilter.eval_column(row['Priority'])
4747
findingdict['severity'] = severityfilter.severity
4848
findingdict['title'] = row['Rule']
49-
findingdict['description'] = "**Source file** : " + row['Source file'] + "\n\n" + \
50-
"**Vulnerability type** : " + row['Vulnerability type'] + "\n\n" + \
51-
"**Status** : " + row['Status'] + "\n\n" + \
49+
findingdict['file'] = row['File']
50+
findingdict['line_number'] = row['Line number']
51+
findingdict['description'] = "**Vulnerability type** : " + row['Vulnerability type'] + "\n\n" + \
5252
"**CWE Scope** : " + row['CWE Scope'] + "\n\n" + \
53-
"**Line text** : " + row['Line text'] + "\n\n" + \
54-
"**Normative** : " + row['Normative'] + "\n\n" + \
5553
"**Line number** : " + row['Line number'] + "\n\n" + \
54+
"**Code at line number** : " + row['Line text'] + "\n\n" + \
55+
"**Normative** : " + row['Normative'] + "\n\n" + \
5656
"**Rule code** : " + row['Rule code'] + "\n\n" + \
57-
"**File** : " + row['File'] + "\n\n" + \
58-
"**Source line text** : " + row['Source line text'] + "\n\n" + \
59-
"**Source line number** : " + row['Source line number'] + "\n"
57+
"**Status** : " + row['Status'] + "\n\n" + \
58+
"**Source file** : " + row['Source file'] + "\n\n" + \
59+
"**Source line number** : " + row['Source line number'] + "\n\n" + \
60+
"**Code at sorce line number** : " + row['Source line text'] + "\n"
6061

6162
finding.title = findingdict['title']
63+
finding.file_path = findingdict['file']
64+
finding.line = findingdict['line_number']
6265
finding.description = findingdict['description']
6366
finding.references = "Not provided!"
6467
finding.mitigation = "Not provided!"

0 commit comments

Comments
 (0)