CVSS2/3 library with interactive calculator for Python 2 and Python 3
Project description
This Python package contains CVSS v2 and v3 computation utilities and interactive calculator compatible with both Python 2 and Python 3.
The library is tested on all currently-supported Python versions available via GitHub Actions (with the exception of Python 2.7, which is EOL but still tested against), but it is simple enough to run on even older versions.
Installation
# pip install cvss
Usage
Library
from cvss import CVSS2, CVSS3
vector = 'AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M'
c = CVSS2(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print()
vector = 'CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X'
c = CVSS3(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print(c.severities())
Sample output:
AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/CDP:L/TD:H/AR:M (5.0, 4.0, 4.6) CVSS:3.0/S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X CVSS:3.0/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:N/E:H/RL:O/RC:R/CR:H/MAC:H/MC:L (6.5, 6.0, 5.3) ('Medium', 'Medium', 'Medium')
Interactive calculator
For interactive calculator run the following:
$ cvss_calculator
For help on the calculator options run:
$ cvss_calculator --help
Testing
For extensive testing, the test vectors were generated using official JavaScript generators and cvsslib.
To run all tests using all supported versions of Python 2 and Python 3 installed:
$ tox $ tox -e py311 # Run tests using a specific version of Python
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
Built Distribution
File details
Details for the file cvss-2.6.tar.gz
.
File metadata
- Download URL: cvss-2.6.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8f0c7ac1c1d7f4fb6d901950aa216358809de25ee7c41bc138615a23936c80 |
|
MD5 | 9a41109f4f96910e0f8171f874e73e35 |
|
BLAKE2b-256 | 7916d2b86a5506ad5fee720c6f281d8499d86277ae05fea4861b3788d51cf295 |
File details
Details for the file cvss-2.6-py2.py3-none-any.whl
.
File metadata
- Download URL: cvss-2.6-py2.py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7006a025e1587f94fc7ce6bd2f3fa10b27a85d2f843d72d4346122779919c63b |
|
MD5 | 5f89b6256a613e4208a68e3162437977 |
|
BLAKE2b-256 | 505410117ea426edd98ddcd85ea035fdf137aff937c94f2df0657a2c6451db03 |