You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to add extra rules keeping the built-in threats, I am challenged as setting threatsfile resets the existing threats. E.g., threatsfile must have all threats in a single file. To work around this, I have been using -
Hence, I was looking at creating a pull request on a better approach. However, what would be the best approach?
If I convert threatsfile to varStrings, I could specify multiple files, but where would I get the built-in from? Some kind of "magic" value for that (ugly)? Or a builtInThreatFile property returning the built-in path?
If I added a new property TM.extraThreatsFiles, that would work - but that is an ugly API
A TM.addThreatsFile(file) method? However, TM's API is property based so that also feels wrong.
Or
Please advice.
The text was updated successfully, but these errors were encountered:
Make tm.threatsFile a list of files, which will be merged via dict.update, something like
with open(self.threatsFile[0], "r", encoding="utf8") as threat_file:
threats_json = json.load(threat_file)
for file in self.threatsFile[1:]:
with open(file, "r", encoding="utf8") as threat_file:
t = json.load(threat_file)
threats_json.update(t)
Use the default threat file if tm.threatsFile is not set, by setting it to [pytm.pytm.default_threats]
If you want to define your own threats you can reuse pytm.pytm.default_threats by writing
The current threatsFile property of class TM is defaulted to -
If I want to add extra rules keeping the built-in threats, I am challenged as setting threatsfile resets the existing threats. E.g., threatsfile must have all threats in a single file. To work around this, I have been using -
Not something I wanted to repeat all over ;).
Hence, I was looking at creating a pull request on a better approach. However, what would be the best approach?
Please advice.
The text was updated successfully, but these errors were encountered: