Skip to content

Commit

Permalink
nested adata structure
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorwalton committed Sep 3, 2024
1 parent 2b2d033 commit f589d33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/app/agents/wazuh/services/vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ async def collect_agent_vulnerabilities(agent_id: str, vulnerability_severity: s
if response["success"] is False:
raise HTTPException(status_code=500, detail=response["message"])
logger.info(f"Vulnerabilities collected for severity {severity}: {response}")
agent_vulnerabilities.extend(response["data"].get("affected_items", []))
# Navigate through the nested 'data' structure to get 'affected_items'
affected_items = response.get("data", {}).get("data", {}).get("affected_items", [])
agent_vulnerabilities.extend(affected_items)

processed_vulnerabilities = process_agent_vulnerabilities(agent_vulnerabilities)

Expand Down

0 comments on commit f589d33

Please sign in to comment.