A simple CVE database written in Python
Project description
cvedb
A local CVE db repository
- Clone the cvelistV5 github repo
- loop through all CVEs
- CVE instance will be created based on CVE json file
- If the CVE json file contains metrics entry, create Metrics for the CVE
- Otherwise, if
--create-metrics
argument is given, fetch metrics from NVD and create Metrics for the CVE
- CVE instance will be created based on CVE json file
- store in local database (python pickle)
Installation
Use pip command to install:
pip install py-cvedb
Usage
Command Line
- Use
cvedb --clone
to clone the cvelistV5 repo and init the local data- This action will first check if cvelistV5 repo is cloned.
- If not cloned yet, clone the repo first
- Then, loop through all CVE JSON file and create CVE instance
- The local database will be dumped to a compressed pickle file located in
$HOME/.config/cvedb/cvedb.pickle
- This action will first check if cvelistV5 repo is cloned.
- Use
cvedb --update
to check if there contains update from cvelistV5 repo- If contains detected
- Firstly, get all updated file
- Re-create CVE instance and do update or insert to local database
- If contains detected
- The cvelistV5 repo take several minutes to clone, actual time taken is affected by Internet connection
Search
Use cvedb -s
or cvedb --search
to search from database
- using
-y
or--year
to get CVEs in a specific year- Adding
-p
or--pattern
to filter out CVE records. Give a string start will-
for negative match.- If given
injection -database
will get all records containsinjection
but notdatabase
.
- If given
- Adding
- using
-i
or--id
to get CVE with a specific CVE id
Use it in python project
>>> from cvedb import cvedb
>>>
>>> cvedb = cvedb.init_db()
>>> type(cvedb) # <class 'cvedb.cvedb.CVEdb'>
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
py-cvedb-0.0.2.post1.tar.gz
(9.7 kB
view hashes)
Built Distribution
Close
Hashes for py_cvedb-0.0.2.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11f72f8e5526e538e77af362bc3963c37fafbcf1cd0c20475c1c6816fd99e8f |
|
MD5 | 16026e41604b2f6b59cd40a7f53e1c93 |
|
BLAKE2b-256 | aba4e34a4943eb1a9e4cc9bb04e7355ebe3f496af6d9c10928465f13075cea71 |