Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve generic parser fixme #9854

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions dojo/tools/generic/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _get_findings_csv(self, filename):
title=row["Title"],
description=row["Description"],
date=parse(row["Date"]).date(),
severity=row["Severity"],
severity=self.get_severity(row["Severity"]),
duplicate=self._convert_bool(
row.get("Duplicate", "FALSE")
), # bool False by default
Expand Down Expand Up @@ -213,9 +213,6 @@ def _get_findings_csv(self, filename):
# manage CWE
if "CweId" in row:
finding.cwe = int(row["CweId"])
# FIXME remove this severity hack
if finding.severity == "Unknown":
finding.severity = "Info"

if "CVSSV3" in row:
cvss_objects = cvss_parser.parse_cvss_from_text(row["CVSSV3"])
Expand Down Expand Up @@ -259,3 +256,9 @@ def _get_findings_csv(self, filename):

def _convert_bool(self, val):
return val.lower()[0:1] == "t" # bool False by default

def get_severity(self, input):
if input in ["Info", "Low", "Medium", "High", "Critical"]:
return input
else:
return "Info"
Loading