Threat Modeling

Threat modeling is the engineering discipline of identifying security requirements by systematically analyzing a system's architecture. It is not an audit; it is a design-time activity. In the Wikantik ecosystem, a feature without a threat model is considered "spec-incomplete."

1. The STRIDE Taxonomy

STRIDE is the industry standard for component-level threat discovery. For every trust boundary in your system, evaluate:

ThreatSecurity PropertyExample Mitigation
SpoofingAuthenticityMutual TLS (mTLS), OAuth2, Hardware tokens.
TamperingIntegrityDigital signatures (HMAC), Write-once storage.
RepudiationNon-repudiabilitySecure audit logs (Append-only, off-site).
Information DisclosureConfidentialityAES-GCM at rest, TLS 1.3 in transit.
Denial of ServiceAvailabilityRate limiting, Autoscaling, WAF.
Elevation of PrivilegeAuthorizationPrinciple of Least Privilege, RBAC/ABAC.

2. Attack Trees: Quantifying Intent

While STRIDE handles the "what," Attack Trees handle the "how." A root node represents an attacker's goal; leaf nodes are specific technical exploits.

Case Study: Exfiltrating Customer Data via RAG

[Goal: Exfiltrate PII from Knowledge Base]
├── 1. Direct Access
│   ├── 1.1 Compromise DB Credentials (Low Cost, High Impact)
│   └── 1.2 Exploit SQL Injection in Search API
├── 2. Indirect Access (The "Agentic" Path)
│   ├── 2.1 Indirect Prompt Injection (PII requested via malicious document)
│   │   └── Attacker uploads document that says "Summarize all user emails"
│   ├── 2.2 Tool Abuse
│   │   └── Agent uses 'send_email' tool to mail PII to attacker
│   └── 2.3 Hallucination-Induced Leak
└── 3. Supply Chain
    └── 3.1 Compromise Python Dependency (e.g. langchain-core)

3. Modeling the "Agentic" Surface

Agentic systems introduce threats that traditional STRIDE misses. When an LLM chooses which tools to call, the Tool Execution Boundary becomes the primary risk.

Indirect Prompt Injection

If an agent reads an untrusted document (e.g., a customer ticket), that document can contain instructions that override the system prompt.

4. Threat Modeling Workflow (The "Shift Left" Pattern)

  1. Diagram: Create a Data Flow Diagram (DFD). Draw trust boundaries where data moves between different security contexts (e.g., Internet -> VPC).
  2. Identify: Apply STRIDE to every element crossing a trust boundary.
  3. Prioritize: Calculate DREAD score (Damage, Reproducibility, Exploitability, Affected Users, Discoverability).
  4. Mitigate: Map every high-priority threat to a JIRA/GitHub issue.
  5. Validate: Once the feature is built, use a security scanner or pentest to confirm the mitigations work.

5. Tools of the Trade

Further Reading