in foundation_security_advisories/common_cve.py [0:0]
def get_owned_cve_ids():
"""
CVE-Services: Get all the CVE-IDs owned by the current CNA. Returns a tuple containing:
- A list of all the owned IDs, regardless of their state
- A dictionary of all the IDs with the state `PUBLISHED`, mapped to the time
they were last modified.
"""
published_dates: dict[str, float] = {}
owned_ids = []
print("-> Fetching already owned CVE-IDs")
for cve_advisory in cve_api.list_cves():
cve_id = cve_advisory["cve_id"]
owned_ids.append(cve_id)
if cve_advisory["state"] == "PUBLISHED" or cve_advisory["state"] == "REJECTED":
published_dates[cve_id] = parse_iso_date(cve_advisory["time"]["modified"])
elif cve_advisory["state"] == "RESERVED":
continue
else:
raise ValueError(f"Invalid CVE state '{cve_advisory['state']}'")
return owned_ids, published_dates