Tools / Microsoft Threat Modeling Tool (TMT) Interview questions
How can you integrate a TMT.tm7 file into an automated security pipeline?
Since .tm7 is plain JSON, a script can load it directly and inspect the threat list without needing TMT installed on the build agent at all - enough to build lightweight gating logic even though there's no official API.
import json with open("service-a.tm7") as f: model = json.load(f) threats = model.get("summary", {}).get("threats", []) unresolved_high = [ t for t in threats if t.get("priority") == "High" and t.get("state") == "Not Started" ] if unresolved_high: raise SystemExit(f"{len(unresolved_high)} unreviewed High-priority threats")
A common pattern is failing a build if any High-priority threat is still Not Started past an agreed SLA, or diffing two committed revisions of the same file to flag when new elements or flows were added without a corresponding threat review. This is unofficial and DIY, built entirely on the file being readable JSON rather than on any first-party pipeline support from TMT.
More Related questions...