Skip to content

Commit 2780d1c

Browse files
committed
🎉 implement zora vulnerabilty parser
1 parent 50450e1 commit 2780d1c

5 files changed

Lines changed: 581 additions & 0 deletions

File tree

dojo/tools/zora/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = "manuel-sommer"

dojo/tools/zora/parser.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
import csv
3+
import logging
4+
5+
from dojo.models import Finding, Test
6+
7+
logger = logging.getLogger(__name__)
8+
9+
10+
class ZoraParser:
11+
12+
"""Parser for Zora combined CSV export."""
13+
14+
def get_scan_types(self):
15+
return ["Zora Parser"]
16+
17+
def get_label_for_scan_types(self, scan_type):
18+
return "Zora Parser"
19+
20+
def get_description_for_scan_types(self, scan_type):
21+
return "Zora Parser scan results in csv file format."
22+
23+
def get_findings(self, test: Test, reader: csv.DictReader) -> list[Finding]:
24+
findings = []
25+
26+
for row in reader:
27+
title = row.get("title")
28+
severity = row.get("severity", "Info").capitalize()
29+
30+
# Build description using correct headers
31+
description = f"**Source**: {row.get('source')}\n"
32+
description += f"**Image**: {row.get('image')}\n"
33+
description += f"**ID**: {row.get('id')}\n"
34+
description += f"**Details**: {row.get('description')}\n"
35+
if row.get("fixVersion"):
36+
description += f"**Fix Version**: {row.get('fixVersion')}\n"
37+
38+
mitigation = row.get("description", "")
39+
unique_id = f"{row.get('source')}-{row.get('image')}-{row.get('id')}"
40+
41+
# Determine status
42+
status = row.get("status", "").upper()
43+
is_mitigated = status in {"PASS", "OK", "FIXED"}
44+
45+
# Determine if fix is available
46+
fix_available = bool(row.get("fixVersion"))
47+
48+
findings.append(
49+
Finding(
50+
title=title,
51+
description=description,
52+
severity=severity,
53+
mitigation=mitigation,
54+
static_finding=False,
55+
dynamic_finding=True,
56+
unique_id_from_tool=unique_id,
57+
test=test,
58+
is_mitigated=is_mitigated,
59+
fix_available=fix_available,
60+
),
61+
)
62+
return findings
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source,checkID,title,severity,status,remediation

0 commit comments

Comments
 (0)