attack-flow icon indicating copy to clipboard operation
attack-flow copied to clipboard

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

Open JitBox opened this issue 1 year ago • 5 comments

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:

  • cloned the repo: https://github.com/center-for-threat-informed-defense/attack-flow
  • ran the following commands in the folder of the cloned repo:
    • python3 -m venv .venv
    • source .venv/bin/activate
    • pip install -r requirements/requirements.txt
    • pip install -r requirements/test-requirements.txt
    • make

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?

JitBox avatar Jul 21 '22 14:07 JitBox

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.

mehaase avatar Jul 25 '22 16:07 mehaase

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 avatar Aug 01 '22 15:08 JitBox

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

JitBox avatar Aug 01 '22 15:08 JitBox

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

JitBox avatar Aug 01 '22 15:08 JitBox

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 avatar Aug 02 '22 13:08 mehaase

@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 avatar Nov 01 '22 13:11 mehaase

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

mehaase avatar Dec 06 '22 18:12 mehaase