• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

tools/H31-Jul-2015-250195

vulndb/H03-May-2022-3,7113,594

vulndb.egg-info/H03-May-2022-10577

.gitignoreH A D28-Mar-2015687 5747

LICENSEH A D27-Mar-20151.4 KiB2922

PKG-INFOH A D31-Jul-20153.4 KiB10577

README.rstH A D31-Jul-20152.1 KiB8659

circle.ymlH A D28-Mar-2015392 2015

setup.cfgH A D31-Jul-201559 64

setup.pyH A D03-Apr-20151.3 KiB4529

README.rst

1Python SDK to access the `vulnerability database <https://github.com/vulndb/data>`_
2
3.. image:: https://circleci.com/gh/vulndb/python-sdk/tree/master.svg?style=svg
4   :alt: Build Status
5   :align: right
6   :target: https://circleci.com/gh/vulndb/python-sdk/tree/master
7
8Installation
9============
10It's possible to install `the latest stable release from pypi <https://pypi.python.org/pypi/vulndb>`_:
11
12::
13
14    pip install vulndb
15
16
17Or if you're interested in the latest version from our repository:
18
19::
20
21    git clone https://github.com/vulndb/python-sdk.git
22    python setup.py install
23
24Usage
25=====
26
27::
28
29    >>> from vulndb import DBVuln
30    >>> dbv = DBVuln.from_id(42)
31    >>> dbv.title
32    'SQL Injection'
33    >>> dbv.description
34    'A long and actionable description for SQL injection ...'
35    >>> dbv.fix_guidance
36    'Explains the developer how to fix SQL injections, usually a couple of <p> long ...'
37    >>> dbv.severity
38    'high'
39    >>> r = dbv.references[0]
40    >>> r.url
41    'http://example.com/sqli-description.html'
42    >>> r.title
43    'SQL injection cheat-sheet'
44
45
46More attributes, methods and helpers are well documented and available in the
47`source code <https://github.com/vulndb/python-sdk/blob/master/vulndb/db_vuln.py>`_.
48
49Contributing
50============
51Send your `pull requests <https://help.github.com/articles/using-pull-requests/>`_
52with improvements and bug fixes, making sure that all tests ``PASS``:
53
54::
55
56    $ cd python-sdk
57    $ virtualenv venv
58    $ . venv/bin/activate
59    $ pip install -r vulndb/requirements-dev.txt
60    $ nosetests vulndb/
61    ..........
62    ----------------------------------------------------------------------
63    Ran 10 tests in 0.355s
64
65    OK
66
67
68Updating the database
69=====================
70This package embeds the `vulnerability database <https://github.com/vulndb/data>`_
71in the ``vulndb/db/`` directory. To update the database with new information
72follow these steps:
73
74::
75
76    # Update the database
77    tools/update-db.sh
78
79After updating the database it's a good idea to publish the latest at ``pypi`` using:
80
81::
82
83    python setup.py sdist upload
84
85
86