center-for-threat-informed-defense / attack-flow

Attack Flow helps executives, SOC managers, and defenders easily understand how attackers compose ATT&CK techniques into attacks by developing a representation of attack flows, modeling attack flows for a small corpus of incidents, and creating visualization tools to display attack flows.
https://ctid.io/attack-flow
Apache License 2.0
527 stars 84 forks source link

Issue with running Make (No module named 'attack_flow') #50

Closed JitBox closed 1 year ago

JitBox commented 1 year ago

Hey all, I have been attempting to get started with this project and used this step by step: https://github.com/center-for-threat-informed-defense/attack-flow

Here are the steps I have done:

Once I run make, I get an error saying "Error while finding module specification for 'attack_flow.scripts.validate_doc' (ModuleNotFoundError: No module named 'attack_flow') make: *** [precommit] Error 1"

What am I doing wrong?

Also, I see that you can load in .afd files in the index.html to design a flow, and also make your own. You can publish these as .json to be ran, but what folder must these .json flows live in to be ran? Is it ran with the make command from above?

mehaase commented 1 year ago

Hi @JitBox, it looks like the documentation is missing an important step. After running pip install -r requirements/test-requirements.txt, please try running pip install -e . and then try make again. Please let me know if this solves the problem. I've opened PR #51 to update the README.

We are releasing an updated Attack Flow in October that has completely revamped technical documentation.

JitBox commented 1 year ago

Hi @mehaase , it looks like pip install -e needs something after it. I am getting this when attempting to run: image

Do you know what argument I should add to that command?

JitBox commented 1 year ago

Disregard, I see the "." at the end. Sorry about that.

JitBox commented 1 year ago

I still seem to be getting the error after "pip install -e ." At the bottom, it states I still do not have the attack_flow module: image

mehaase commented 1 year ago

Ahh okay, let's try something different then. When you get into the virtual env, from the project root folder run this export command before make:

(.venv) $ export PYTHONPATH="$PWD/src"
(.venv) $ make
...

I gave you bad advice with the pip install -e . stuff ... sorry about that, I've been switching back and forth between Attack Flow 1 and Attack Flow 2 and the CLI is a bit different between them.

mehaase commented 1 year ago

@JitBox I believe this issue (and a lot of other developer experience issues) are resolved in the v2 release from last week. Please let me know if this resolves the issue for you.

mehaase commented 1 year ago

Closing due to inactivity. Please reopen if it's still a problem.