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 advisories by NXOS version #78

Closed VinuraD closed 3 years ago

VinuraD commented 4 years ago

Hi, I came across that there is no method currently available to get advisories by nxos version, in the query_client.py module. Is this a feature that will be added in the future?

*My current alternative solutions are to (1) make the API calls using requests lib, separately. (without using the Openvulnquery library) (2) Altering the source codes (have implemented and working, but not tested thoroughly; can make a pull request if its okay)

msdaniluk commented 4 years ago

I suppose you installed the openVulnAPI client through pip. I got into the same problem. Actually the get_by_nxos method is already present here on git repository, but not updated in pypi:

    def get_by_nxos(self, adv_format, nxos_version, a_filter=None):
        """Return advisories by Cisco NX-OS (standalone mode) advisories version"""
        req_path = "nxos"
        try:
            advisories = self.get_request(
                req_path,
                params={'version': nxos_version})
            return self.advisory_list(advisories['advisories'], None)
        except requests.exceptions.HTTPError as e:
            raise requests.exceptions.HTTPError(
                e.response.status_code, e.response.text)

reference

Stjubit commented 4 years ago

I experienced the same issue. The pypi package is not up to date. I overwrote the query_client.py and advisory.py files from the package with the Github source code as a workaround:

/home//.local/lib/python3.7/site-packages/openVulnQuery/_library/

...would be very cool to update the pypi package though...

Stjubit commented 4 years ago

Another workaround:

pip3 install -e "git+https://github.com/CiscoPSIRT/openVulnAPI.git#egg=openVulnQuery&subdirectory=openVulnQuery"

santosomar commented 3 years ago

The new version of the openVulnQuery Python client has been uploaded to PyPi. You can now use pip install OpenVulnQuery==1.31 to install the openVulnQuery client.

Note: I have also moved the openVulnQuery client code to it's own repository: https://github.com/CiscoPSIRT/openVulnQuery