1- from dojo .models import Finding
1+ from django .conf import settings
2+
3+ from dojo .models import Endpoint , Finding
4+ from dojo .tools .locations import LocationData
25
36
47class WazuhV4_8 :
@@ -17,10 +20,8 @@ def parse_findings(self, test, data):
1720 continue # Skip if this finding has already been processed
1821
1922 description = vuln .get ("description" )
20- description += "\n Agent id:" + item .get ("agent" ).get ("id" )
21- description += "\n Agent name:" + item .get ("agent" ).get ("name" )
2223 severity = vuln .get ("severity" )
23- cvssv3_score = vuln .get ("score" ).get ("base" )
24+ cvssv3_score = vuln .get ("score" ).get ("base" ) if vuln . get ( "score" ) else None
2425 publish_date = vuln .get ("published_at" ).split ("T" )[0 ]
2526 detection_time = vuln .get ("detected_at" ).split ("T" )[0 ]
2627 references = vuln .get ("reference" )
@@ -56,6 +57,15 @@ def parse_findings(self, test, data):
5657 unique_id_from_tool = dupe_key ,
5758 date = detection_time ,
5859 )
60+
61+ # Create endpoint from agent name
62+ agent_name = item .get ("agent" ).get ("name" )
63+ if agent_name is not None :
64+ if settings .V3_FEATURE_LOCATIONS :
65+ find .unsaved_locations = [LocationData .url (host = agent_name )]
66+ else :
67+ find .unsaved_endpoints = [Endpoint (host = agent_name )]
68+
5969 find .unsaved_vulnerability_ids = [cve ]
6070 dupes [dupe_key ] = find
6171
0 commit comments