-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore default generated threats in report #261
Comments
Did you try the --exclude flag? It is probably going to be unwieldy but might be a temporary solution. You can also replace threats.json with your own, and we have been thinking about adding a BYO capability for user libraries. Let me look into that. |
For completenes, you can also exclude threats by adding an Lines 45 to 50 in c8c0875
But I wonder why you don't create a threat library JSON file with only your threats and then just create a report from it. What could be interesting is to have the ability to use multiple threat files, but this would require some code changes. |
Thanks for your inputs! I am only using threat library that I built now and thats working. Yes, multiple threat library support would be useful. |
I have that code almost ready, it is a small change. One question though - libraries added in the command line should override the built-in one, or be in addition to it ? |
Mhhh I would go by allowing to set multiple files. Further you could add a constant which is the path to the default one. So # is the default and this line could be removed
tm.threatFiles =pytm.DEFAULT_THREADS
# custom lib
tm.threatFiles = "./custom.json"
# default joined with custom, where custom overrides
tm.threatFiles = [pytm.DEFAULT_THREADS, "./custom.json"] |
Ok, now you confused me :) If none is given then we use the default one. |
Ahh sorry, I used the word override twice in different ways. None is the default yes. If you set
If you have two custom files you combine them
If you want to still use the default but want to add your custom threats
With this behaviour it is possible to fully replace the default threats. Have you considered how pytm should behave when two files define a threat with the same Id? |
I don't think the default should be None. It should be the built-in library. Perhaps I'll have "default" as a keyword, such that: ./tm.py --threat-libraries default foo.json bar.json would make the 3 of them be loaded, ./tm.py --threat-libraries foo.json bar.json would use just the 2, ./tm.py --report foo would use just the default ? |
Ok I should stop writing quick replies on my phone 🤣 .
Yes no argument should be the default library. ("None is the default yes.")
Exactly.
Yes if no threat library argument is given the default threat library should be used, since this change would not affect other users which assume the old behavior. What will happen to Lines 790 to 794 in c8c0875
|
Thanks guys for your comments, I'll see what I can share in terms of threat library with putting my org at risk. Usually I run into another problem also, when I add my custom threats I would like to apply those threats to specific assets in my threat model but I'd have to pick (asset, dataflow etc.) as target element. Any ideas to do this easier way? |
This comment has been minimized.
This comment has been minimized.
Can we move the coding question to a separate issue? |
Hello,
I am building threat models for embedded devices and most of the generated threats by tool are not much relevant. I have my own threats library I have added in threats.json. Is there any simple way to report not show default threats of elements. That way I can show only threats I added.
Thanks!
The text was updated successfully, but these errors were encountered: