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 (only version 1.0 right now). 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


This product uses data from the NVD API but is not endorsed or certified by the NVD.

Project details


Download files

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

Source Distribution

nvdlib-0.6.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvdlib-0.6.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file nvdlib-0.6.1.tar.gz.

File metadata

  • Download URL: nvdlib-0.6.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for nvdlib-0.6.1.tar.gz
Algorithm Hash digest
SHA256 6a7da52f5655854f35e6862b9b22e7f2a38673af73231af0cecf6496310f6dc1
MD5 6215a1615d851eb802d938139e45a07d
BLAKE2b-256 41bb486b1ffd31fe5837c97b0ee37d96ad5214ef9318779aff1fc9d926d30e1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nvdlib-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for nvdlib-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0cef7193517b9e65b8f4409fc2e31984f8feed0fa27716cb6b4e2daca2c93998
MD5 3d6c3bb47c801a4036da9cc2715aff6c
BLAKE2b-256 db987a17c48ed1fa6c81ab20433764f2ce65a079f317edc858ff22396892141a

See more details on using hashes here.

Supported by

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