Skip to content

Commit

Permalink
updating xml openvas parser
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoOMaia authored Dec 23, 2024
1 parent d2212e9 commit d06163c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dojo/tools/openvas/xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def get_findings(self, filename, test):
title = title + "_" + finding.text
description.append(f"**Port**: {finding.text}")
if finding.tag == "nvt":
script_id = finding.get("oid")
description.append(f"**NVT**: {script_id}")
script_id = finding.get("oid") or finding.text
text = f"{script_id}\n{finding.text}" if finding.get("oid") and finding.text else script_id
description.append(f"**NVT**: {text}")
if finding.tag == "severity":
severity = self.convert_cvss_score(finding.text)
description.append(f"**Severity**: {finding.text}")
Expand All @@ -40,7 +41,6 @@ def get_findings(self, filename, test):

finding = Finding(
title=str(title),
test=test,
description="\n".join(description),
severity=severity,
dynamic_finding=True,
Expand Down

0 comments on commit d06163c

Please sign in to comment.