Threagile / threagile

Agile Threat Modeling Toolkit
https://threagile.io
MIT License
577 stars 126 forks source link

Examples in readme do not work. #69

Open skymoore opened 2 months ago

skymoore commented 2 months ago

Why do none of the readme examples work?

docker run --rm -it --platform=linux/amd64 -v "$(pwd)":app/work threagile/threagile create-stub-model -output app/work
docker: Error response from daemon: invalid volume specification: '/host_mnt/Users/smoore/Develop/sre-services/threagile/docker:app/work': invalid mount config for type "bind": invalid mount path: 'app/work' mount path must be absolute.
See 'docker run --help'.

So I fix the path:

docker run --rm -it --platform=linux/amd64  -v "$(pwd)":/app/work threagile/threagile create-stub-model -output /app/work                                                                  1 ↵
2024/04/23 12:55:43 Unable to read/parse model yaml: open threagile.yaml: no such file or directory

So I add an example:

docker run --rm -it --platform linux/amd64 --shm-size=256m -v "$(pwd)/threagile.yaml":"/app/threagile.yaml"  threagile/threagile create-stub-model -output /app/work                     130 ↵
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories

The documentation needs to be accurate.

wbirkmaier commented 2 months ago

I am having the same problem too.

cyber-person commented 2 months ago

@skymoore My guy what are you mounting?
docker run --rm -it --platform linux/amd64 --shm-size=256m -v "$(pwd)":/app/work threagile/threagile -verbose -model /app/work/threagile.yaml -output /app/work This shoud do it for you. Make sure that the threagile.yaml file (which you already seem to have) is in you current working directory.

Still I agree, that the README is flawed.
As an introduction:

This command creates the example file
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -create-stub-model -output /app/work
rename it to threagile.yaml and run
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -verbose -model /app/work/threagile.yaml -output /app/work
You should get a .pdf.

skymoore commented 2 months ago

@166268424 😂 bro I literally just copy pasted the example, expected that to work. Thank you for the response. I will try this out later today and report back.