cve

Attributes

logger

Classes

CVE

Represent a CVE entry.

NVD

Provide access to the NVD API.

Module Contents

cve.logger
class cve.CVE(json_content: dict[str, Any])

Represent a CVE entry.

json_content
property cve_id: str

Return the CVE ID.

property nvd_url: str

Return the nvd.nist.gov vulnerability URL for that CVE.

class cve.NVD(cache_db_path: str | None = None, cache_backend: str | None = None, nvd_api_key: str | None = None)

Provide access to the NVD API.

cache_db_path = None
cache_backend = None
nvd_api_key = None
_session: requests.Session | None = None
search_by_cpe_name(cpe_name: str, is_vulnerable: bool = True, no_rejected: bool = True, results_per_page: int | None = None) Iterator[CVE]

Return a list of matching CVE entries.

Parameters:
  • no_rejected – remove CVE records with the REJECT or Rejected status from API response

  • results_per_page – number of results to return for each request, note that it is recommended to keep the default setting

__enter__() Any

Return an http requests Session supporting cache.

Use requests_cache CachedSession when cache is requested.

__exit__(_type: Any, _value: Any, _tb: Any) None
close() None
property session: requests.Session