Skip to content

NIST National Vulnerability Database (NVD) 2.0 Executor

Category: Threat Intelligence Script: nist_nvd.py Integration: REST API Faraday Plugin: Raw JSON Website: https://nvd.nist.gov/developers/vulnerabilities

Description

Imports CVE records from the NIST NVD 2.0 API into Faraday. You can fetch a list of specific CVEs or every CVE modified in the last N days. Each CVE becomes a vulnerability with its CVSS severity, CWEs and NVD references.

Prerequisites

  • Network access to https://services.nvd.nist.gov (or to the mirror set in NVD_HOST)
  • Optionally, an NVD API key for a higher rate limit
  • The Python requests library installed in the agent environment

Configuration

Environment Variables (Setup)

Variable Required Description
NVD_API_KEY No NVD API key. Without it, the executor waits 6 seconds between requests to respect the public rate limit; with it, 0.7 seconds.
NVD_HOST No NVD API base URL, for a mirror or cache (default: https://services.nvd.nist.gov)

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
NVD_CVE_LIST string No Comma-separated CVE IDs to fetch (e.g., CVE-2024-1234, CVE-2023-5678). Invalid IDs are skipped. When set, NVD_LAST_MOD_DAYS is ignored.
NVD_LAST_MOD_DAYS integer No Import every CVE modified in the last N days, 1 to 120 (default: 7). Used only when NVD_CVE_LIST is empty.

YAML Configuration Example

executors:
  nist_nvd:
    repo_executor: nist_nvd.py
    max_size: 65536
    varenvs:
      NVD_API_KEY: "<nvd_api_key>"
    params:
      NVD_CVE_LIST:
        mandatory: false
        type: string
        base: string
      NVD_LAST_MOD_DAYS:
        mandatory: false
        type: integer
        base: integer

How It Works

  1. Sends the API key, when set, in the apiKey header, and waits between requests to stay under the NVD rate limit
  2. With NVD_CVE_LIST, calls /rest/json/cves/2.0?cveId=<id> once per CVE. Otherwise, calls /rest/json/cves/2.0 with a lastModStartDate/lastModEndDate window and reads all pages of 2000 results.
  3. Creates one vulnerability per CVE, named [NVD] <CVE ID>: <first sentence of the description>
  4. Maps severity from the CVSS base severity (v3.1, then v3.0, then v2), or from the base score when the label is missing
  5. Adds the CWEs, CVSS vector, publication and modification dates, the NVD permalink and all advisory URLs as references

Notes

  • All vulnerabilities go to a single host with IP 0.0.0.0 and hostname nist-nvd, because NVD records are not tied to hosts.
  • CVEs that NVD has not scored yet are imported as info.
  • Rejected CVEs are imported as info with a [REJECTED] prefix in the name.
  • Values of NVD_LAST_MOD_DAYS outside 1–120 are clamped, and invalid values fall back to 7.
  • Failed requests are written to the agent log and skipped; the run does not fail.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.