CiscoPSIRT / openVulnAPI

Documentation and Tools for Cisco's PSIRT openVuln API
https://developer.cisco.com/psirt/
MIT License
102 stars 52 forks source link

Get_By_Product - KeyError: 'firstFixed' #63

Closed waukeerules closed 5 years ago

waukeerules commented 5 years ago

I'm trying to pull all vulnerabilities for Cisco ISE. When I do the following I get a KeyError: 'firstFixed'.

advisories = query_client.get_by_product(adv_format="cvrf", product_name="Cisco Identity Services Engine")

From what I can tell the API is not returning "first_fixed" or "ios_release" for the specific query I am attempting to run. I've been able to add a temporary workaround to "advisory.py" by adding a try exception to adv_map[k] = adv_data[v].

Here's the specific error I get when I run the query:

Traceback (most recent call last): File "V:\test\Python\Vulnerability Assessment\Cisco_Vulnerability_Assessment.py", line 290, in advisories = query_client.get_by_product(adv_format="cvrf", product_name="Cisco Identity Services Engine") File "C:\Users\test\AppData\Local\Programs\Python\Python36\lib\site-packages\openVulnQuery_library\query_client.py", line 145, in get_by_product return self.advisory_list(advisories['advisories'], adv_format) File "C:\Users\test\AppData\Local\Programs\Python\Python36\lib\site-packages\openVulnQuery_library\query_client.py", line 223, in advisory_list for adv in advisories] File "C:\Users\test\AppData\Local\Programs\Python\Python36\lib\site-packages\openVulnQuery_library\query_client.py", line 223, in for adv in advisories] File "C:\Users\test\AppData\Local\Programs\Python\Python36\lib\site-packages\openVulnQuery_library\advisory.py", line 130, in advisory_factory adv_map[k] = adv_data[v] KeyError: 'firstFixed'

santosomar commented 5 years ago

Hi @waukeerules

In the output below I see that you are trying to do this for product_name="Cisco Identity Services Engine". First fixed output is only supported for IOS or IOS-XE advisories with the integration of IOS/XE Software Checker.

waukeerules commented 5 years ago

The API call does work when I add the try exemption. I don’t need the first fixed output for the ISE vulnerability checks. I’m wondering if first fixed can be made optional or ignore if invalid.