A Python tool that scans software dependencies for known vulnerabilities using NIST's National Vulnerability Database (NVD)
Project description
CVE Vulnerability Scanner
A Python tool that scans software dependencies for known vulnerabilities using NIST's National Vulnerability Database (NVD).
Features
- 🔍 Scan software libraries for known vulnerabilities
- 📝 Generate detailed vulnerability reports in markdown format
- 🚀 Fast scanning with local caching support
- 🔑 Uses official NVD API with authentication for better rate limits
- 📊 Support CSV input format for batch processing
- 🔄 Cache results to reduce API calls
Installation
# Using pip
pip install cve-vulnerability-scanner
# From source
git clone https://github.com/changyy/py-cve-vulnerability-scanner.git
cd py-cve-vulnerability-scanner
pip install -e .
Usage
Basic Usage
# Set your NVD API key
export NVD_API_KEY='your-api-key-here'
# Run the scanner
cve-vulnerability-scanner packages.csv -o report.md
Input CSV Format
Create a CSV file (packages.csv
) with your dependencies:
library_name,version
busybox,1.31.1
libiconv,1.13.1
Command Line Options
cve-vulnerability-scanner --help
Options:
-i, --input FILE Input CSV file containing libraries [default: packages.csv]
-o, --output FILE Output report file [default: report.md]
--no-cache Disable caching
--cache-dir DIR Specify cache directory [default: ./cache]
--verbose Enable verbose output
-h, --help Show this help message
-v, --version Show program version
Sample Output
The tool will generate a markdown report like this:
# Vulnerability Scan Report
Generated at: 2024-03-08 10:00:00
## Summary
- Total libraries scanned: 2
- Libraries with vulnerabilities: 1
- Total vulnerabilities found: 30
## Details
### Busybox (1.31.1)
Found 30 vulnerabilities:
1. CVE-2022-28391 (CVSS: 5.5)
- Description: Integer overflow in Busybox wget applet...
- Published: 2022-05-20
- References: [Link]
### libiconv (1.13.1)
No known vulnerabilities found.
Authentication
Get your NVD API key from: https://nvd.nist.gov/developers/request-an-api-key
The API key can be provided in three ways (in order of precedence):
- Environment variable:
NVD_API_KEY
- Config file:
~/.config/cve-scanner/config.ini
- Command line argument:
--api-key
Development
Setup Development Environment
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
.\venv\Scripts\activate # Windows
# Install dependencies
pip install -e ".[dev]"
Running Tests
pytest tests/
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- NIST National Vulnerability Database (NVD) for providing the vulnerability data
- All contributors who help improve this tool
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cve_vulnerability_scanner-1.0.0.tar.gz
.
File metadata
- Download URL: cve_vulnerability_scanner-1.0.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41cc6178afbd796d15c118ad203f1df98ff05c5f07702145a795713a213233ab |
|
MD5 | babbe62b3c76374fd6438725f151f6aa |
|
BLAKE2b-256 | a05d2876d9bb63693380975e906ecdcf12a325f2ef36959566c321bbed45ee61 |
File details
Details for the file cve_vulnerability_scanner-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: cve_vulnerability_scanner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84020ba1ff8b9d13b1015727bf60b9520fa139a4536105cfed0ead16753c5db0 |
|
MD5 | 6c9c04c8d643f19035883c330e22dbd4 |
|
BLAKE2b-256 | acc9e7290e9f0d65d06588d3f9e64b92b942c574f42165c2a9cb1c4249b69c75 |