https://github.com/vulndb/python-sdk
Python SDK to access the vulnerability database
https://github.com/vulndb/python-sdk
database vulnerability
Last synced: 5 months ago
JSON representation
Python SDK to access the vulnerability database
- Host: GitHub
- URL: https://github.com/vulndb/python-sdk
- Owner: vulndb
- License: bsd-3-clause
- Created: 2015-03-27T12:04:44.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T12:42:57.000Z (almost 7 years ago)
- Last Synced: 2025-08-20T17:56:56.898Z (10 months ago)
- Topics: database, vulnerability
- Language: Python
- Size: 180 KB
- Stars: 22
- Watchers: 4
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Python SDK to access the `vulnerability database `_
.. image:: https://circleci.com/gh/vulndb/python-sdk/tree/master.svg?style=svg
:alt: Build Status
:align: right
:target: https://circleci.com/gh/vulndb/python-sdk/tree/master
Installation
============
It's possible to install `the latest stable release from pypi `_:
::
pip install vulndb
Or if you're interested in the latest version from our repository:
::
git clone https://github.com/vulndb/python-sdk.git
python setup.py install
Usage
=====
::
>>> from vulndb import DBVuln
>>> dbv = DBVuln.from_id(42)
>>> dbv.title
'SQL Injection'
>>> dbv.description
'A long and actionable description for SQL injection ...'
>>> dbv.fix_guidance
'Explains the developer how to fix SQL injections, usually a couple of
long ...'
>>> dbv.severity
'high'
>>> r = dbv.references[0]
>>> r.url
'http://example.com/sqli-description.html'
>>> r.title
'SQL injection cheat-sheet'
More attributes, methods and helpers are well documented and available in the
`source code `_.
Contributing
============
Send your `pull requests `_
with improvements and bug fixes, making sure that all tests ``PASS``:
::
$ cd python-sdk
$ virtualenv venv
$ . venv/bin/activate
$ pip install -r vulndb/requirements-dev.txt
$ nosetests vulndb/
..........
----------------------------------------------------------------------
Ran 10 tests in 0.355s
OK
Updating the database
=====================
This package embeds the `vulnerability database `_
in the ``vulndb/db/`` directory. To update the database with new information
follow these steps:
::
# Update the database
tools/update-db.sh
After updating the database it's a good idea to publish the latest at ``pypi`` using:
::
rm -rf dist/
python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*