Skip to content

Commit 7e9e984

Browse files
authored
Recognize .nessus file names (DefectDojo#4397)
As a new DefectDojo user, I was thought I had a corrupt .nessus file, until I renamed it with .xml. This change recognizes XML exports with the `.nessus` extension, matching the documentation at line DefectDojo#245. Also clarifies the error when trying to import a Nessus file.
1 parent ebd2c7b commit 7e9e984

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dojo/tools/nessus/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def get_description_for_scan_types(self, scan_type):
246246

247247
def get_findings(self, filename, test):
248248

249-
if filename.name.lower().endswith('.xml'):
249+
if filename.name.lower().endswith('.xml') or filename.name.lower().endswith('.nessus'):
250250
return NessusXMLParser().get_findings(filename, test)
251251
elif filename.name.lower().endswith('.csv'):
252252
return NessusCSVParser().get_findings(filename, test)
253253
else:
254-
raise ValueError('Unknown File Format')
254+
raise ValueError('Filename extension not recognized. Use .xml, .nessus or .csv')

0 commit comments

Comments
 (0)