izar / pytm

A Pythonic framework for threat modeling
Other
861 stars 161 forks source link

pytm --report gives an error #224

Open ccc17as opened 8 months ago

ccc17as commented 8 months ago

Running on a Mac. I could execute the dfd and sequence flow diagram but when trying to generate a report I get the below error,

python3 tm.py --report /docs/baseline.md Traceback (most recent call last): File "/tm.py", line 127, in tm.process() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytm/pytm.py", line 1062, in process print(self.report(result.report)) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytm/pytm.py", line 1003, in report with open(template_path) as file: ^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/docs/baseline.md'

raphaelahrens commented 8 months ago

Hi

The problem is that you run the command with the file /docs/baseline.md, which is a path to a file named baseline.md in a folder named docs in the root folder (/), this is a path to an unexciting file. This is most likely not what you want to do.

What you need to do is download a template file from https://github.com/izar/pytm/tree/master/docs . For example https://github.com/izar/pytm/blob/master/docs/basic_template.md and then use the path where you have downloaded the file to.

izar commented 8 months ago

Try docs rather than /docs ?

raphaelahrens commented 8 months ago

@ccc17as Were you able to make it work?

Enigmatyk commented 8 months ago

Or try python3 tm.py --report ./docs/baseline.md