Skip to content

Commit 0f6830e

Browse files
committed
extract reference link if present in scan output
1 parent aeda530 commit 0f6830e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

dojo/tools/wizcli_common_parsers/parsers.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ def get_severity(severity_str):
2323
return SEVERITY_MAPPING.get(severity_str.upper(), "Info")
2424
return "Info" # Default if severity is missing or None
2525

26-
for vulnerability in vulnerabilities:
27-
vuln_name = vulnerability.get("name", "N/A")
28-
severity = vulnerability.get("severity", "low").lower().capitalize()
29-
fixed_version = vulnerability.get("fixedVersion", "N/A")
30-
source = vulnerability.get("source", "N/A")
31-
description = vulnerability.get("description", "N/A")
32-
score = vulnerability.get("score", "N/A")
33-
exploitability_score = vulnerability.get("exploitabilityScore", "N/A")
34-
has_exploit = vulnerability.get("hasExploit", False)
35-
has_cisa_kev_exploit = vulnerability.get("hasCisaKevExploit", False)
26+
@staticmethod
27+
def extract_reference_link(text):
28+
"""Extracts potential URL from remediation instructions."""
29+
if not text:
30+
return None
31+
# Basic regex to find URLs, might need refinement
32+
match = re.search(r"(https?://[^\s)]+)", text)
33+
return match.group(1) if match else None
3634

3735
finding_description = (
3836
f"**Library Name**: {lib_name}\n"

0 commit comments

Comments
 (0)