JohnHammond / stix-attack-flow

Crappy code to work with MITRE Attack Flows with the stix2 Python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STIX - Attack Flow

John Hammond | Wednesday, February 7, 2024


Crappy code to work with MITRE Attack Flow with the stix2 Python library.

These "Attack Flows" are an extension of STIX 2.1, and need some setup to be easily used in code.

Note that this format will only generate a JSON file representing an Attack Flow... the Attack Flow "Builder" requires a .afb file type which will take other processing.

Visualizing

Since we do not yet generate .afb files, we can visualize an Attack Flow with the other tools suggested in their documentation.

On Windows, I have ran:

choco install GraphViz

pip install poetry
git clone https://github.com/center-for-threat-informed-defense/attack-flow/
cd .\attack-flow\
poetry install
poetry shell

af graphviz C:\Users\johnh\Desktop\test-flow.json C:\Users\johnh\Desktop\test-flow.dot
dot -Tpng .\test-flow.dot -O

This will generate a PNG image for our attack flow.

Other Resources

About

Crappy code to work with MITRE Attack Flows with the stix2 Python library


Languages

Language:Python 100.0%