CLI tool to match COTS inventories against NVD CVE feeds.
Project description
parse-nvd
parse-nvd is a command-line tool that matches a COTS (Commercial Off-The-Shelf) inventory against CVE vulnerabilities published in NVD JSON exports.
Why this tool
In a risk analysis context, you typically have:
- a product/version inventory (COTS),
- large NVD data feeds,
- CVSS severity criteria.
The tool automates this matching to quickly produce an actionable report:
- filtering CVEs by CVSS score, attack vector, and impact,
- optional filtering on the presence of an exploit,
- JSON output for machine processing,
- Markdown/PDF output for human distribution.
How it works
- Validate NVD files against the local official schema.
- Extract the relevant CVSS metrics.
- Match COTS against CPE entries and compare versions.
- Apply the requested filters.
- Generate JSON reports and optionally Markdown/XHTML reports.
Installation
pip install -e .
Running from source (without installation)
From the project root, you can launch the CLI directly from the source tree:
PYTHONPATH=src python -m parse_nvd \
--nvd-db nvdcve-2.0-recent.json \
--cots-list essai-cots.json \
--output report.json
This lets you use the tool without pip install, which is convenient for quick tests or in CI environments.
COTS file format
The --cots-list file must be a JSON array of objects, each with at least a name and a version field. The name must match the CPE product identifier used by the NVD (e.g. linux_kernel, openssl, gcc).
[
{ "name": "linux_kernel", "version": "5.10" },
{ "name": "openssl", "version": "3.0.2" },
{ "name": "gcc", "version": "10.2.0" }
]
Trailing commas are tolerated.
CLI arguments
--nvd-db FILE [FILE ...](required) One or more NVD JSON files using the official schema.--cots-list FILE(required) JSON file listing COTS entries (name/version).--output FILEOutput report path. Defaults toparse-nvd-report.json.--md FILEWrite a Markdown report to the provided path.--html FILEWrite a self-contained XHTML report with embedded CSS to the provided path, without any external resource.--verboseDisplay a clear synthetic console summary using rich.--cvss-min FLOATMinimum CVSS base score for a CVE to be kept.--cvss-av VALUEMinimum attack vector filter. Accepted values (from most to least severe):NETWORK,ADJACENT,LOCAL,PHYSICAL.--cvss-impact-c VALUEMinimum confidentiality impact filter (NONE,LOW,HIGH).--cvss-impact-i VALUEMinimum integrity impact filter (NONE,LOW,HIGH).--cvss-impact-d VALUEMinimum availability impact filter (NONE,LOW,HIGH).--with-exploitKeep only CVEs for which an exploit appears to exist.--created-or-updated-after YYYY-MM-DDKeep only CVEs created or updated strictly after the provided date.--linux-order-by-systemGrouplinux_kernelCVEs by impacted Linux subsystem in Markdown and XHTML reports.
Exemples d'utilisation
JSON uniquement
parse-nvd \
--nvd-db nvdcve-2.0-recent.json \
--cots-list essai-cots.json \
--output rapport.json
Avec filtres CVSS et exploit
parse-nvd \
--nvd-db nvdcve-2.0-recent.json \
--cots-list essai-cots.json \
--created-or-updated-after 2026-01-01 \
--linux-order-by-system \
--html rapport.xhtml \
--cvss-min 7.0 \
--cvss-av NETWORK \
--cvss-impact-c LOW \
--cvss-impact-i LOW \
--cvss-impact-d LOW \
--with-exploit \
--verbose \
--md rapport.md \
--output rapport.json
Structure du rapport JSON
Le rapport généré contient:
- un bloc summary avec les filtres appliqués et les compteurs globaux,
- un bloc cots contenant, pour chaque entrée COTS, la liste des CVE associées,
- pour chaque CVE: le bloc cve, la métrique cvss normalisée, les critères CPE matchés, et l'indicateur exploit_available.
Rapport Markdown et PDF
Générer le Markdown depuis le CLI
parse-nvd \
--nvd-db nvdcve-2.0-recent.json \
--cots-list essai-cots.json \
--md report.md \
--output report.json
Générer le XHTML autonome depuis le CLI
parse-nvd \
--nvd-db nvdcve-2.0-recent.json \
--cots-list essai-cots.json \
--html report.xhtml \
--output report.json
Le rapport XHTML embarque son style CSS directement dans la page. Il ne dépend d'aucun accès réseau ni d'aucune ressource externe.
Générer le PDF depuis le Markdown
pandoc report.md -o report.html
python -m weasyprint --stylesheet docs/report-a4.css report.html report.pdf
Le style docs/report-a4.css est prévu pour une lecture correcte à l'impression A4.
Documentation développeur
Le projet peut générer un mini site de documentation dans docs/site:
- docs/site/index.html pour l'accueil,
- docs/site/cli-arguments.html pour les arguments CLI et leur signification,
- pages HTML des modules Python.
Développement
tox
tox -e pydoc
tox -e report-pdf
pytest -q
python -m build
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parse_nvd-0.4.0-py3-none-any.whl.
File metadata
- Download URL: parse_nvd-0.4.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
792f8f996e54c8917d4fe97dbc0d5099f7489e0da9acb895cd06c9749ac95b06
|
|
| MD5 |
d717fe61b400ef9eb4e722e331ea5e25
|
|
| BLAKE2b-256 |
044b12b2f17b126930a1a45edc98f1ff19a8197bfebc302373398ee9d3b75bb4
|