Skip to main content

A script for managing cves

Project description

Build Status

cve_manager

A python script that:

a) parses NIST NVD CVEs, b) prcoesses and exports them to CSV files, c) creates a postgres database and imports all the data in it, and d) provides query capabilities for this CVEs database.

It required Python 2.7.x (soon to be migrated to Python 3)

Usage examples:

  • Download, parse and save in CSV files all CVEs from NIST NVD: ./cve_manager.py -d -p -csv

  • Create a postgresql database to host the downloaded CVEs: ./cve_manager.py -u -ps -host -db <database_name> -ow <new_owner of database> -cd

  • Create the tables and views at the database: ./cve_manager.py -u -ps -host -db <database_name> -ct

  • Import all data into the created database (requires the download, parse and sdtore as CSV files first, as explained above): ./cve_manager.py -u -ps -host -db <database_name> -idb -p

  • Query for a specific CVE: ./cve_manager.py -u -ps -host -db <database_name> -cve 2019-2434

  • Query for all CVEs related with a product (e.g. windows), with a base metric score greater than a value (e.g. 9, that is critcal), and a publication date equal or newer than a specific year (e.g. 2018): ./cve_manager.py -u -ps -host -db <database_name> -pr radar -sc 9 -dt 2018

  • Query for all CVEs with a base metric score greater than a value (e.g. 9, that is critcal), and a publication date equal or newer than a specific year (e.g. 2019): ./cve_manager.py -u -ps -host -db <database_name> -sc 9 -dt 2019

  • Truncate the contents of all tables (required if you want to repeat the import process so as to update the data): ./cve_manager.py -u -ps -host -db <database_name> -tr

  • Delete the database (remove it completely): ./cve_manager.py -u -ps -host -db <database_name> -dd

Complete list of supported arguments:

-h, --help show this help message and exit

-v, --version show program's version number and exit

-p, --parse Process downloaded CVEs.

-d, --download Download CVEs.

-y YEAR, --year YEAR The year for which CVEs shall be downloaded (e.g. 2019)

-csv, --cvs_files Create CSVs files.

-idb, --import_to_db Import CVEs into a database.

-i INPUT, --input INPUT The directory where NVD json files will been downloaded, and the one from where they will be parsed (default: nvd/)

-o RESULTS, --output RESULTS The directory where the csv files will be stored (default: results/)

-u USER, --user USER The user to connect to the database.

-ow OWNER, --owner OWNER The owner of the database (if different from the connected user).

-ps PASSWORD, --password PASSWORD The password to connect to the database.

-host HOST, --host HOST The host or IP of the database server.

-db DATABASE, --database DATABASE The name of the database.

-cd, --create_database Create the database

-dd, --drop_database Drop the database

-ct, --create_tables Create the tables of the database

-tr, --truncate_cves_tables Truncate the CVEs-related tables

-cve CVE, --cvs_number CVE Print info for a CVE (CVSS score and other)

-sc SCORE, --score SCORE Use base score as a selection criterion

-dt DATE, --date DATE Use publication date as a selection criterion

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

cvemanager-0.0.6.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

cvemanager-0.0.6-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file cvemanager-0.0.6.tar.gz.

File metadata

  • Download URL: cvemanager-0.0.6.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

File hashes

Hashes for cvemanager-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5dec5338d83da676fbda0d8db5e1f390d8c8308d264f19f65f3dbb06178beddf
MD5 3815202fa86d0e12432059a7b5ee653b
BLAKE2b-256 aa2cdd5d7e6971478e749a3bfb1b52b27e5fd27c3bd9c076529c47b06bc95a72

See more details on using hashes here.

File details

Details for the file cvemanager-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cvemanager-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

File hashes

Hashes for cvemanager-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fea6068e88bc87245005b7d2338be0ce1803684192c9fb44b65c3f287116425a
MD5 9d1e21af7c2fd85f9853367e98eafe35
BLAKE2b-256 254d14ba906ed3307fbf50624bc0896743878b55f15490495a274f7c8df55947

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