Defensive threat modeling and risk management for your own estate — map where sensitive data lives across your asset graph, run compromise scenarios (what a hac
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-threatmodel-3d158a952639 ,按照其中的说明把「ThreatModel」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Threat modeling for the estate you actually run. Three moves: classify where sensitive data lives, simulate compromise of the assets that hold it, and keep the resulting risks in a register that gets reviewed instead of forgotten.
Before executing, check for user customizations at:
~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/ThreatModel/
If this directory exists, load and apply PREFERENCES.md (data locations, sensitive-data class priorities, response runbook cross-references). If not, proceed with defaults.
This skill directory is public code. It must never contain data.
~/.claude/LIFEOS/USER/SECURITY/THREATMODEL/ (release-excluded USER tree). Override with THREATMODEL_DATA_DIR.Tools/RiskRegister.ts structurally refuses any data dir that resolves inside a skills/ path.When executing a workflow, do BOTH:
Send voice notification:
curl -s -X POST http://localhost:31337/notify \
-H "Content-Type: application/json" \
-d '{"message": "Running WORKFLOWNAME in ThreatModel"}' \
> /dev/null 2>&1 &
Output text notification:
Running **WorkflowName** in **ThreatModel**...
| Workflow | Trigger | File |
|---|---|---|
| SensitiveDataMap | "where is our sensitive data", "data classification", "which assets hold sensitive data" | Workflows/SensitiveDataMap.md |
| CompromiseScenario | "what if X got hacked", "compromise scenario", "blast radius of X" | Workflows/CompromiseScenario.md |
| ThreatModelTarget | "threat model X", "threat model the estate", "risk assessment of X" | Workflows/ThreatModelTarget.md |
| RiskRegister | "risk register", "add a risk", "risk review", "accept risk", "close risk" | Workflows/RiskRegister.md |
If the install has Atlas (~/.claude/LIFEOS/ATLAS/Atlas.ts), workflows use it as the current-state source of truth:
bun ~/.claude/LIFEOS/ATLAS/Atlas.ts blast <key> # what relies on this asset
bun ~/.claude/LIFEOS/ATLAS/Atlas.ts owns <key> # what deleting/losing it orphans
bun ~/.claude/LIFEOS/ATLAS/Atlas.ts exposed <key> # which credentials it would leak, priority-ordered
bun ~/.claude/LIFEOS/ATLAS/Atlas.ts sql "SELECT ..." # read-only census queries
exposed makes the "one hop of trust" step deterministic instead of a judgment call: it returns the credentials an asset holds, transitively through what it owns, compromise-tier first. Pair it with a DEPENDS_ON query for the data stores an asset can reach:
bun ~/.claude/LIFEOS/ATLAS/Atlas.ts sql "SELECT a.kind, a.canonical_key FROM edge e JOIN asset a ON a.id=e.dst WHERE e.kind='DEPENDS_ON' AND e.status='active' AND e.src=(SELECT id FROM asset WHERE canonical_key='<key>')"
Without Atlas, workflows fall back to what the user enumerates plus repo/config inspection — and say so in the output. Never invent an inventory.
score = likelihood (1-5) × impact (1-5) → Low 1-4 · Medium 5-9 · High 10-14 · Critical 15-25.
Impact is anchored to data classes and blast radius, not vibes: an asset whose compromise exposes credentials or customer data starts at impact 4+. Likelihood is anchored to exposure (public URL, auth boundary, patch state, credential hygiene).
RiskRegister.md — the next export overwrites it.atlas exposed (credentials) plus a DEPENDS_ON query (data stores) before scoring impact; don't eyeball it.exposed shows more than one compromise-tier class on one asset.review_by date at creation; the review command lists overdue ones. A register nobody reviews is worse than none — it manufactures false assurance.Example 1: Sensitive data sweep
User: "Which of our assets have sensitive data?"
→ SensitiveDataMap: census the asset graph, classify each data-bearing asset
→ Writes EstateDataMap.md to the private data dir
→ Returns the classified map + explicit unclassified list
Example 2: Compromise scenario
User: "What happens if our analytics worker gets popped?"
→ CompromiseScenario: blast radius via asset graph, data exposed, attacker next-steps,
detection signals, response plan
→ Scenario doc to private data dir; risks added to register with scores
Example 3: Risk review
User: "Run a risk review"
→ RiskRegister: lists overdue + open risks by score, walks disposition
(mitigate / accept / close), updates review dates