A Python client for searching vulnerabilities from the OSV.dev vulnerability database.
The OSV API uses POST method to fetch JSON data for known vulnerabilities of a package of a particular version in a specified ecosystem.
To call the API Data from database
curl -s -X POST \
-H "Content-Type: application/json" \
-d "$payload" \
"https://api.osv.dev/v1/query" | jq --indent 4 .
Python uses requests module to get API response. It parses JSON data to show much readable way with counting total vunerabilities.
git clone https://github.com/niloydatta000/osv-python-cli-demo.git
cd osv-python-cli-demo
python3 -m pip install -r requirements.txt
python3 main.py -p "$payload"Alternatively package name, version and ecosystem can be delivered:
python3 main.py -n "$name" -v "$version" -s "$ecosystem"To build and run Docker Image:
docker build -t osv-python-cli .
docker run --rm osv-python-cli -p "$payload"This project is aimed to procure, arrange and display vulneranbilities in a structuured way on the terminal.