Common weakness enumeration wrapper for Python
Project description
CWE Common weakness enumeration library for Python
https://cwe.mitre.org/index.html
Installation
pip install cwe
Usage
- Get a CWE by ID:
>>> from cwe import Database
>>> db = Database()
>>> db.get(15)
Weakness(cwe_id=15, name=External Control of System or Configuration Setting)
- Access attributes of the Weakness using dot notation
>>> weakness = db.get(15)
>>> weakness.description
'One or more system settings or configuration elements can be externally controlled by a user.'
- Or use the weakness
getmethod
>>> weakness.get("status", None)
'Incomplete'
- Get a dictionary of the weakness (Truncated for this example)
>>> weakness.to_dict()
{'cwe_id': '15', 'name': 'External Control of System or Configuration Setting', 'weakness_abstraction': 'Base'}
- Get the top 25 weaknesses
>>> from cwe import Database
>>> db = Database()
>>> db.get_top_25()
Weakness attributes
The following weakness object attributes can accessed:
cwe_idnameweakness_abstractionstatusdescriptionextended_descriptionrelated_weaknessesweakness_ordinalitiesapplicable_platformsbackground_detailsalternate_termsmodes_of_introductionexploitation_factorslikelihood_of_exploitcommon_consequencesdetection_methodspotential_mitigationsobserved_examplesfunctional_areasaffected_resourcestaxonomy_mappingsrelated_attack_patternsnotes
Tests
There's a small unittest test suite in the tests directory
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
cwe-1.6.tar.gz
(660.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
cwe-1.6-py3-none-any.whl
(527.3 kB
view details)
File details
Details for the file cwe-1.6.tar.gz.
File metadata
- Download URL: cwe-1.6.tar.gz
- Upload date:
- Size: 660.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eed7fdbe3565f975bb9ec6cef6f42cb4eb721ec6155fa954f3b1b106351d981e
|
|
| MD5 |
9b9be1c5639f21dd7624280ab52cb694
|
|
| BLAKE2b-256 |
ada482772fcb8687f9db3c194e53672e0f4b3bec8eef9fc4b0e10667f68f1a37
|
File details
Details for the file cwe-1.6-py3-none-any.whl.
File metadata
- Download URL: cwe-1.6-py3-none-any.whl
- Upload date:
- Size: 527.3 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bad040864f52ccd494763d317eb77e7c604ce323b3a17164d43a97fea4ebb9e8
|
|
| MD5 |
0a5bd70d484367484c8bf63a3c6f556b
|
|
| BLAKE2b-256 |
f7bc813a36f58a6c3857951f275f19191b20a5042733fd39d9eaca25dbb9255e
|