From b26e5a683f67d2aa1bfe6eab77fc4a3c313f427e Mon Sep 17 00:00:00 2001 From: ishabaral Date: Thu, 31 Oct 2024 16:12:35 +0545 Subject: [PATCH] add affected product ids in vulnerabilities --- csaf/parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csaf/parser.py b/csaf/parser.py index 8c166c4..d0ca04f 100644 --- a/csaf/parser.py +++ b/csaf/parser.py @@ -195,6 +195,12 @@ def _process_vulnerabilities(self): if "product_status" in vulnerability: for product_status in vulnerability["product_status"]: vuln_info.set_value("status", product_status) + if "known_affected" in vulnerability["product_status"]: + affected_product_ids = [] + known_affected = vulnerability["product_status"].get("known_affected", []) + for affected_product_id in known_affected: + affected_product_ids.append(affected_product_id) + vuln_info.set_value("affected_product_ids", affected_product_ids ) if "remediations" in vulnerability: remediations = [] for remediation in vulnerability["remediations"]: