Comments (1)
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
tm.threatsFile = [pytm.pytm.default_threats, "path/to/my/threat_lib.json"]
Or not use the default and write
tm.threatsFile = ["path/to/my/threat_lib.json", "path/to/my/threat_lib_for_java.json"]
By using pytm.pytm.default_threats
you don't have to use some magic and it is quite obvious what would happen.
For backwards compatibility it should be possible to also define the threats via the old way
tm.threatsFile = "path/to/my/threat_lib.json"
from pytm.
Related Issues (20)
- SIDs prefix meaning HOT 2
- Error with make image HOT 2
- Error with data field in input JSON HOT 5
- How are threats named, e.g., INPXX or AAXX? HOT 4
- How are "target" and its relevant "condition" extracted from a particular threat? HOT 5
- Documentation for attributes HOT 5
- Suggest to support converting c4 models into pytm HOT 7
- Use RAAML for threat models HOT 3
- Is the makefile broken? HOT 3
- Question: What's the purpose of defining trust boundary? HOT 7
- Got an error "AttributeError: 'str' object has no attribute 'name'" when using the "--sqldump SQLDUMP". HOT 2
- Cannot override findings, threats remain, DFD impacted, exception thrown for overrides len > 1 HOT 16
- pytm --report gives an error HOT 4
- Replace custom template engine with Jinja2 HOT 1
- README.md, section Currently Supported Threats, needs a legend HOT 7
- Enhancement request: move pyDAL to local import HOT 4
- Alternative format for threat lib for better readability and editing HOT 5
- AC22 Credential Aging review HOT 5
- Add a way to exclude threats for specific Elements HOT 2
- Outdated plantuml download link in Dockerfile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytm.