A small python script that enriches Vulnerability STIX Objects with other intel
Project description
Arango CVE Processor
Before you get started
Arango CVE Processor is built into Vulmatch which also handles the download of CVE objects (what you need for ACVEP to work). As such, Vulmatch is probably better suited to what you're looking for.
tl;dr
A small script that enriches CVEs to other sources with all data stored as STIX 2.1 objects.
Overview
Here at DOGESEC we work with a lot of CVE data across our products. cve2stix generates core STIX 2.1 Vulnerability objects from CVE data.
However, we have lots of other sources (EPSS, KEV, ATT&CK...) that we want to enrich this data with.
We built Arango CVE Processor to handle the generation and maintenance of these enrichments.
In short, Arango CVE Processor is a script that;
- reads the ingested CVE STIX data in ArangoDB
- creates STIX objects to represent the relationships between CVE and other datasets
Usage
Install the script
# clone the latest code
git clone https://github.com/muchdogesec/arango_cve_processor
# create a venv
cd arango_cve_processor
python3 -m venv arango_cve_processor-venv
source arango_cve_processor-venv/bin/activate
# install requirements
pip3 install -r requirements.txt
Configuration options
Arango CVE Processor has various settings that are defined in an .env file.
To create a template for the file:
cp .env.example .env
To see more information about how to set the variables, and what they do, read the .env.markdown file.
Run
python3 arango_cve_processor.py \
--database DATABASE \
--relationship RELATIONSHIP \
--ignore_embedded_relationships BOOLEAN \
--modified_min DATE \
--cve_id CVE-NNNN-NNNN CVE-NNNN-NNNN
Where;
--database(required): the arangoDB database name where the objects you want to link are found. It must contain the collectionsnvd_cve_vertex_collectionandnvd_cve_edge_collection--relationship(optional, dictionary): you can apply updates to certain relationships at run time. Default is all. Note, you should ensure yourdatabasecontains all the required seeded data. User can select from;cve-cwecve-capeccve-attackcve-epsscve-kev
--ignore_embedded_relationships(optional, boolean). Default isfalse. iftruepassed, this will stop any embedded relationships from being generated. This is a stix2arango feature where STIX SROs will also be created for_refand_refsproperties inside each object (e.g. if_refproperty =identity--1234and SRO between the object with the_refproperty andidentity--1234will be created). See stix2arango docs for more detail if required, essentially this a wrapper for the same--ignore_embedded_relationshipssetting implemented by stix2arango--ignore_embedded_relationships_sro(optional): boolean, iftruepassed, will stop any embedded relationships from being generated from SRO objects (type=relationship). Default isfalse--ignore_embedded_relationships_smo(optional): boolean, iftruepassed, will stop any embedded relationships from being generated from SMO objects (type=marking-definition,extension-definition,language-content). Default isfalse--modified_min(optional, date in formatYYYY-MM-DD). By default arango_cve_processor will consider all CVEs in the database specified with the property_is_latest==true(that is; the latest version of the object). Using this flag with a modified time value will further filter the results processed by arango_cve_processor to STIX objects with amodifiedtime >= to the value specified. This is useful when you don't want to process data for very old CVEs in the database.--created_min(optional, date in formatYYYY-MM-DD). Same asmodified_minbut considerscreateddate.--cve_id(optional, CVE ID): will only process the relationships for the CVE passed, otherwise all CVEs will be considered.
Examples
Process CVE -> CWE relationships for all CVEs modified after 2023-01-01 and only created embedded relationships from SDOs and SCOs...
python3 arango_cve_processor.py \
--database arango_cve_processor_standard_tests_database \
--relationship cve-cwe \
--modified_min 2024-02-01 \
--ignore_embedded_relationships true \
--ignore_embedded_relationships_sro true \
--ignore_embedded_relationships_smo true
Get all EPSS scores for CVEs
python3 arango_cve_processor.py \
--database arango_cve_processor_standard_tests_database \
--relationship cve-epss \
--ignore_embedded_relationships false \
--ignore_embedded_relationships_sro true \
--ignore_embedded_relationships_smo true
Backfilling data
How it works
If you would like to know how the logic of this script works in detail, please consult the /docs directory.
Useful supporting tools
- To generate STIX 2.1 extensions: stix2 Python Lib
- STIX 2.1 specifications for objects: STIX 2.1 docs
- ArangoDB docs
Support
Minimal support provided via the DOGESEC community.
License
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
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
File details
Details for the file arango_cve_processor-1.0.0.tar.gz.
File metadata
- Download URL: arango_cve_processor-1.0.0.tar.gz
- Upload date:
- Size: 447.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a00e5d549556de531f0b1b45d550bff08f8517d334f7eff86fed52af983f173
|
|
| MD5 |
355f62e8a78f9e99f711723df8d4d47f
|
|
| BLAKE2b-256 |
9ab87831a0603aae0646218e562b7f8dcad1a791ec5ea0da43c8b6c9797f5feb
|
Provenance
The following attestation bundles were made for arango_cve_processor-1.0.0.tar.gz:
Publisher:
create-release.yml on muchdogesec/arango_cve_processor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arango_cve_processor-1.0.0.tar.gz -
Subject digest:
7a00e5d549556de531f0b1b45d550bff08f8517d334f7eff86fed52af983f173 - Sigstore transparency entry: 261745571
- Sigstore integration time:
-
Permalink:
muchdogesec/arango_cve_processor@ec4ef3fa9d05f2f78b34d59b25a5889f638685bc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/muchdogesec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
create-release.yml@ec4ef3fa9d05f2f78b34d59b25a5889f638685bc -
Trigger Event:
push
-
Statement type:
File details
Details for the file arango_cve_processor-1.0.0-py3-none-any.whl.
File metadata
- Download URL: arango_cve_processor-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6909ff1ca73acc0d6ff1c12391572aab81704ac50cf71d7832768e9c219849
|
|
| MD5 |
0cb31855be240612baf2b4c0756cff5f
|
|
| BLAKE2b-256 |
3e96e0ee49887fe9b54d47e01cec5b271434a58d273acc16f1325882e4ffd5dd
|
Provenance
The following attestation bundles were made for arango_cve_processor-1.0.0-py3-none-any.whl:
Publisher:
create-release.yml on muchdogesec/arango_cve_processor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arango_cve_processor-1.0.0-py3-none-any.whl -
Subject digest:
be6909ff1ca73acc0d6ff1c12391572aab81704ac50cf71d7832768e9c219849 - Sigstore transparency entry: 261745576
- Sigstore integration time:
-
Permalink:
muchdogesec/arango_cve_processor@ec4ef3fa9d05f2f78b34d59b25a5889f638685bc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/muchdogesec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
create-release.yml@ec4ef3fa9d05f2f78b34d59b25a5889f638685bc -
Trigger Event:
push
-
Statement type: