Skip to content

Commit

Permalink
ASFF Parser: Respect active status based on RecordState field (#9567
Browse files Browse the repository at this point in the history
)

* resolve asff parser doing

* add unittest to retrigger unittests
  • Loading branch information
manuel-sommer authored Feb 28, 2024
1 parent 5ee7bb4 commit 3051466
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dojo/tools/asff/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def get_findings(self, file, test):
else:
mitigation = None
references = None
if item.get("RecordState") and item.get("RecordState") == "ACTIVE":
active = True
else:
active = False

finding = Finding(
title=item.get("Title"),
Expand All @@ -42,7 +46,7 @@ def get_findings(self, file, test):
mitigation=mitigation,
references=references,
severity=self.get_severity(item.get("Severity")),
active=True, # TODO: manage attribute 'RecordState'
active=active,
unique_id_from_tool=item.get("Id"),
)

Expand Down
1 change: 1 addition & 0 deletions unittests/tools/test_asff_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ def test_asff_guardduty(self):
for index, finding in enumerate(findings):
self.common_check_finding(finding, data, index, guarddutydate=True)
self.assertEqual(finding.unsaved_endpoints[0], Endpoint(host="10.0.0.1"))
self.assertTrue(finding.active)

0 comments on commit 3051466

Please sign in to comment.