Skip to main content

National Vulnerability Database CPE/CVE API Library

Project description

Simple NIST NVD API wrapper library

License Written Documentation Status

NVDlib is a Python library that allows you to interface with the NIST National Vulnerability Database (NVD), pull vulnerabilities (CVEs), and Common Platform Enumeration (CPEs) into easily accessible objects.


Features

  • Search the NVD for CVEs using all parameters allowed by the NVD API. Including search criteria such as CVE publish and modification date, keywords, severity, score, or CPE name.
  • Search CPE names by keywords, CPE match strings, or modification dates. Then pull the CVE ID's that are relevant to those CPEs.
  • Retrieve details on individual CVEs, their relevant CPE names, and more.
  • Built in rate limiting according to NIST NVD recommendations.
    Get an API key (https://nvd.nist.gov/developers/request-an-api-key) to allow for 0.6 seconds between requests. Otherwise it is 6 seconds between requests.

Install

$ pip install nvdlib

Demo

>>> import nvdlib
>>> r = nvdlib.getCVE('CVE-2021-26855')
>>> print(r.v3severity + ' - ' + str(r.v3score))
   CRITICAL - 9.8
>>> print(r.cve.description.description_data[0].value)
   Microsoft Exchange Server Remote Code Execution Vulnerability This CVE ID is unique from CVE-2021-26412, 
   CVE-2021-26854, CVE-2021-26857, CVE-2021-26858, CVE-2021-27065, CVE-2021-27078.
>>> print(r.v3vector)
   CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 

Development

Run the tests with

$ pip install -e '.[dev]'
$ pytest

Documentation

https://nvdlib.com

More information

This is my first attempt at creating a library while utilizing all my Python experience from classes to functions.

For more information on the NIST NVD API for CPE and CVEs, see the documentation here: https://nvd.nist.gov/General/News/New-NVD-CVE-CPE-API-and-SOAP-Retirement

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nvdlib-0.5.8-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file nvdlib-0.5.8-py3-none-any.whl.

File metadata

  • Download URL: nvdlib-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for nvdlib-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 719bf31b065ec0d47bebabeda370d6b59d1ffe8ec30b9ea67ab5673c1546ffca
MD5 913c79f490e1bcd3d752d56b65dc5547
BLAKE2b-256 951df32af79b38332529c74d0562f07f95dbcd4990e17b5e6883f21972386b40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page