Skip to content

Commit

Permalink
🐛 fix wazuh date (#9728)
Browse files Browse the repository at this point in the history
* 🐛 fix wazuh date

* 🐛 fix
  • Loading branch information
manuel-sommer authored Mar 25, 2024
1 parent c06a234 commit c81de2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dojo/tools/wazuh/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_findings(self, file, test):
publish_date = item.get("published")
agent_name = item.get("agent_name")
agent_ip = item.get("agent_ip")
detection_time = item.get("detection_time")
detection_time = item.get("detection_time").split("T")[0]

if links:
references = "\n".join(links)
Expand Down
2 changes: 2 additions & 0 deletions unittests/tools/test_wazuh_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_parse_many_finding(self):
for endpoint in finding.unsaved_endpoints:
endpoint.clean()
self.assertEqual(6, len(findings))
self.assertEqual("2023-02-08", finding.date)

def test_parse_one_finding_with_endpoint(self):
testfile = open("unittests/scans/wazuh/one_finding_with_endpoint.json")
Expand All @@ -49,3 +50,4 @@ def test_parse_one_finding_with_endpoint(self):
self.assertEqual("agent-1", endpoint.host)
self.assertEqual("asdf", finding.component_name)
self.assertEqual("1", finding.component_version)
self.assertEqual("2023-12-13", finding.date)

0 comments on commit c81de2a

Please sign in to comment.