Run lightweight threat modeling on a feature or system: sketch a data-flow diagram with trust boundaries, walk STRIDE-lite over each element, rank the threats, and produce mitigation tickets. Use when designing a new feature or service, adding an API endpoint or integration, handling a new category of sensitive data, or preparing for a security review.
./install.sh threat-modelingname: "threat_modeling" description: "Run lightweight threat modeling on a feature or system: sketch a data-flow diagram with trust boundaries, walk STRIDE-lite over each element, rank the threats, and produce mitigation tickets. Use when designing a new feature or service, adding an API endpoint or integration, handling a new category of sensitive data, or preparing for a security review."
Turn a feature design into a ranked list of concrete, product-specific threats with mitigations and owners, in about 30 minutes. Built for small teams without a security department.
Answer Shostack's four questions and write the answers down; they frame the whole session:
Keep the scope small. One data flow through one service beats a whole-system model you never finish.
Draw the feature as: external entities (users, third-party services) -> processes (endpoints, workers) -> data stores (databases, caches, queues), connected by data flows. Mark every trust boundary with a dotted line: anywhere privilege or control changes (client/server, service/database, your code/third-party, user/other-user's data).
One diagram per service or bounded context. A whiteboard photo or a Mermaid diagram in a doc beats a 40-page spec. See references/dfd-guide.md for symbols and a Mermaid starter template.
For each element and each data flow crossing a boundary, ask which STRIDE categories apply and write the concrete threat, not the letter. "Attacker sets userId to another user's id" beats "E".
| | Threat | Breaks | Ask it as | |---|---|---|---| | S | Spoofing | Authentication | Could someone impersonate a user, service, or process here? | | T | Tampering | Integrity | Could data or code be modified in transit or at rest here? | | R | Repudiation | Non-repudiation | If this was abused, could the actor deny it? How would we know? | | I | Information disclosure | Confidentiality | Does anything sensitive leave here, in responses, errors, or logs? | | D | Denial of service | Availability | What happens if this is flooded, oversized, or exhausted? | | E | Elevation of privilege | Authorization | Could a low-privilege caller reach high-privilege capability here? |
Use the per-element matrix in references/stride-reference.md to skip letters that don't apply to an element type. Don't argue about which letter a threat belongs under. Pick the property the attack actually breaks, record the row, move on.
Rate each threat on likelihood x impact, High/Medium/Low. Keep it to three levels; fake precision wastes the timebox. A fuller DREAD scoring rubric lives in references/stride-reference.md if you need it. Drop anything below Medium; a 5-10 row register is the goal.
For every kept threat, pick exactly one: mitigate (name the control, prefer platform-level over app-level), avoid (remove the capability), transfer (push to a provider or insurer), or accept (named person signs off, recorded in the register). Then close the loop:
Answer question 4: did we do a good job? Sanity checks: does the register cover the riskiest data flow? Would a second engineer reach the same rows? Re-run the model whenever a change crosses a trust boundary, adds an external integration, or touches a new category of sensitive data.
Deliver three things:
publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e
No ratings yet — be the first to rate it.