К основному содержанию
скилл CX Codex

security-threat-model · dotslashsimran — скилл для Claude Code: что делает и установка

Скилл security-threat-model для Claude Code строит модель угроз по коду приложения и проверяет найденные риски тестами. Запускается по запросу о безопасности, STRIDE или уязвимостях перед выпуском приложения.

MIT ★ 541 обновлён 2026-11-09

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add dotslashsimran/simcraft --skill security-threat-model -a claude-code
Открыть на GitHub

Что делает security-threat-model

Скилл изучает маршруты, авторизацию, доступ к данным и внешние вызовы, затем описывает потоки данных в Mermaid-диаграмме и разбирает угрозы по STRIDE. Риски оцениваются по вероятности и ущербу. Скрипты на Python 3 помогают найти поверхность атаки и секреты, но их результаты требуют ручной проверки.

Для серьёзных рисков скилл пишет локальный тест, проверяет, что он падает, исправляет уязвимость и оставляет тест в наборе регрессии. Итоговый файл — THREAT_MODEL.md. Проверки разрешены только на принадлежащем пользователю коде и локальной среде; отправлять их на production, общий staging или сторонние сервисы нельзя. Для проверки зависимостей npm audit или pip-audit запускается, если соответствующая утилита установлена.

Какие задачи решает

  • найти маршруты без авторизации и места с риском IDOR
  • оценить угрозы для границ доверия и потоков данных
  • подтвердить уязвимость локальным тестом и закрепить исправление регрессией
  • составить THREAT_MODEL.md с рисками и остаточными угрозами

Примеры запросов агенту

  • Составь модель угроз для этого приложения и сохрани её в THREAT_MODEL.md.
  • Проведи STRIDE-проверку кода и докажи главные риски локальными тестами.
  • Проверь авторизацию и изоляцию арендаторов перед выпуском приложения.

Как установить security-threat-model

1Через Skills CLI (Vercel)

npx skills add dotslashsimran/simcraft --skill security-threat-model -a claude-code

2Вручную: положить файлы

~/.claude/skills/security-threat-model/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/security-threat-model/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о security-threat-model

Как установить security-threat-model в Claude Code?

Выполни npx skills add dotslashsimran/simcraft --skill security-threat-model -a claude-code. Файл скилла находится по пути ~/.claude/skills/security-threat-model/SKILL.md.

Что делает security-threat-model?

Он анализирует код приложения, строит Mermaid-диаграмму потоков данных и ранжирует угрозы по STRIDE. Для значимых рисков скилл создаёт локальный тест, исправляет проблему и сохраняет тест как регрессионный.

Что нужно для работы security-threat-model?

Нужен Python 3 для скриптов анализа. Проверки проводят на локальном коде или локальном сервере разработки; npm audit и pip-audit используются, если установлены.

Исходный текст

SKILL.md · MIT
---
name: security-threat-model
description: Threat-model the user's own app from its real code. Draws the data flow (actors, trust boundaries, data stores, external services) as a Mermaid diagram, finds threats per element with STRIDE, ranks them by likelihood times impact, then proves each top risk with a local failing test, fixes it, and keeps the test as a regression test. Covers auth, IDOR and tenant isolation, injection, SSRF, secrets, CORS/CSRF, uploads, webhooks, dependencies, abuse, and LLM-app risks like prompt injection through tool output. Writes THREAT_MODEL.md. Use when the user says "threat model", "security review of my app", "is this secure", "STRIDE", "find vulnerabilities in my code", or before launching something that holds other people's data or money.
---

# Security threat model

The goal is not a long list of everything that could go wrong. It is the three to six things that would actually hurt, proven real on the user's own machine, fixed, and locked in with tests. A threat without a proof is a guess. A fix without a regression test comes back in six months.

Only for code and systems the user owns. Every proof runs against local code or a local dev server with throwaway data. Never send a proof to production, a staging server shared with others, or any third-party service, even one the app calls.

## 1. Scope (ask, one question at a time)

- What does the app do, who uses it, and what would be bad news (leaked data, lost money, someone else's account, a big bill)?
- What is in scope (which repo, which services) and how does it run locally?
- How is it deployed (behind a proxy, serverless, single box)? This decides which threats are the app's job.

Write the answers at the top of `THREAT_MODEL.md`.

## 2. Map the surface from the code

```
python3 ~/simcraft/skills/coding/security-threat-model/scripts/surface.py <repo>
python3 ~/simcraft/skills/coding/security-threat-model/scripts/secrets_scan.py <repo> --history
```
`surface.py` lists routes with flags (`NO-AUTH-SEEN`, `IDOR?`, `WEBHOOK-UNVERIFIED?`, `ABUSE-TARGET`, `LLM-COST`) and leads grouped by category, with `[input]` on lines that use request data. `secrets_scan.py` finds keys in files and history and prints them masked. Both are regex heuristics: they point at code to read, they never decide anything. Then read by hand, in this order: the auth middleware and how a request becomes a user, the data access layer and how queries are scoped, every route that takes an id, and every place the app calls out (HTTP, shell, files, LLM tools). If there is a lockfile, run `npm audit` or `pip-audit` if installed (see reference).

## 3. Draw the data flow

Write a short `dataflow.yaml` from what the code actually does (actors, processes, stores, externals, boundaries, flows), then:
```
python3 ~/simcraft/skills/coding/security-threat-model/scripts/dataflow.py dataflow.yaml --stride
```
It prints the Mermaid diagram, the flows that cross a trust boundary, and a STRIDE-per-element table to fill in. Every boundary crossing is where threats live. If the diagram has no boundaries, it is wrong.

## 4. Find and rank threats

Go element by element with STRIDE, but spend most of the time on these, because they are where real apps break: authorization (can user A touch user B's or tenant B's object?), injection into SQL, shell, templates and paths, unverified inbound trust (webhooks, JWTs, callbacks), and, for AI apps, what a hijacked model can do with its tools. The reference has what to look for in code for each area.

Rate each threat: likelihood 1 to 3 times impact 1 to 3, with a one-line reason. Anything reachable by any logged-in user or anyone on the internet in one request is likelihood 3. Anything that exposes other customers' data, money or code execution is impact 3. Drop theoretical threats with a one-line reason instead of padding the table.

## 5. Prove, fix, keep the test

For each threat scoring 6 or more (and cheap wins below that):
1. **Prove it.** Write a test that asserts the secure behaviour ("Alice gets 404 for Bob's invoice"), run it, and watch it fail. The failure output is the evidence. Use the app's test framework, or plain HTTP to the local dev server. Add a control test for the normal case so a fix cannot pass by breaking the feature.
2. **Fix it** at the layer where it cannot be forgotten (scope the query by owner, parameterise, resolve and contain the path, verify the signature before parsing). Smallest change that closes the class of bug, not just the payload.
3. **Rerun.** The proof now passes, the controls still pass, and the test stays in the suite.

If a real secret turns up, tell the user to revoke and rotate it at the provider first. Never print it back in full.

## 6. Write THREAT_MODEL.md

Sections: scope, data flow diagram, assets, trust boundaries, threats table (ID, element, STRIDE, threat, L, I, score, status), proofs and fixes (proof, before output, fix), residual risks with the next fix for each, and what to recheck when the system changes. Use the template in `reference.md`.

A complete worked example (an invoice API with an IDOR, SQL injection, path traversal, forged webhook, hardcoded fake key and error leak, plus the fixed copy and 18 tests) is in `examples/invoice-api/`.

© dotslashsimran · MIT · dotslashsimran/simcraft

Похожие скиллы

Все скиллы по теме «Безопасность» →

Сначала — security-threat-model от других авторов.

security-threat-model lyndonkl Скилл security-threat-model помогает разобрать архитектуру сервиса по методологии STRIDE, найти границы доверия и защитить чувствительные данные перед релизом или аудитом. CX Codex +1 109установок security-threat-model github.com/openai/skills Скилл security-threat-model строит модель угроз по коду репозитория: находит границы доверия, активы и реалистичные пути атаки, а результат сохраняет в Markdown-файл. CX Codex +1 ★ 7 191звёзд репо openai-security-threat-model OpenAI Плагин openai-security-threat-model разбирает репозиторий с точки зрения безопасности и формирует краткую модель угроз в Markdown. Запускайте его, когда нужно оценить конкретный код или путь. ★ 540звёзд репо mantis-threat-model официальный google Скилл mantis-threat-model собирает модель угроз проекта по базе знаний Mantis: границы доверия, точки входа, профили атакующих. Полезен, когда архитектура уже описана, а модели угроз ещё нет. CX Codex +1 1 900установок threat-model-analyst официальный github Скилл threat-model-analyst проводит STRIDE-A-анализ репозитория или системы и готовит модель угроз. При повторном запуске сравнивает изменения с прошлым отчётом. CX Codex +1 1 500установок threat-model официальный anthropics Строит модель угроз кодовой базы и записывает результат в THREAT_MODEL.md. Запускается в трёх режимах: интервью с владельцем, анализ кода по CVE и git-истории, или оба подряд. CX Codex +1 1 300установок threat-model-generator patricio0312rev Скилл threat-model-generator строит модель угроз по STRIDE: выписывает активы, находит угрозы, подбирает меры защиты и считает остаточный риск. CX Codex +1 270установок multi-agentic-threat-model OWASP Скилл multi-agentic-threat-model моделирует угрозы для мультиагентных систем по 7-уровневой архитектуре CSA MAESTRO и руководству OWASP. CX Codex +1 188установок

Из того же набора24

Весь набор →
repo-timelapse Скилл repo-timelapse для Claude Code превращает историю репозитория в видео, где карта файлов меняется вместе с кодом. Запускается по просьбе показать развитие проекта или анимировать коммиты. CX Codex +1 ★ 541звёзд репо skill-router Скилл skill-router для Claude Code выбирает навык под задачу или выстраивает цепочку из нескольких. Он включается, когда запрос расплывчатый или подходит под разные навыки. CX Codex +1 ★ 541звёзд репо bisect-anything Скилл bisect-anything для Claude Code находит коммит, версию зависимости или значение конфигурации, вызвавшие регрессию. Запускается на запросы вроде «что сломало тест» или «когда началась проблема». CX Codex +1 ★ 541звёзд репо scripted-screencast Скилл scripted-screencast для Claude Code превращает сценарий действий в браузере в запись демо продукта с курсором, масштабированием и подписями. Запускается по просьбе записать скринкаст или обновить ролик после изменений интерфейса. CX Codex +1 ★ 541звёзд репо vox-explainer Скилл vox-explainer для Claude Code собирает объясняющую графику или видео без ведущего в стиле Vox. Он включается по просьбе оформить озвучку как ролик, анимированные цитаты или статистику. CX Codex +1 ★ 541звёзд репо benchmark-honestly Скилл benchmark-honestly для Claude Code помогает проверять замеры производительности и сравнивать версии кода. Подключается на просьбы провести бенчмарк, нагрузочный тест или проверить заявление об ускорении. CX Codex +1 ★ 541звёзд репо flaky-test-killer Скилл flaky-test-killer для Claude Code ищет причину нестабильных тестов и помогает устранить её в коде. Запускает проверки под нагрузкой и сравнивает частоту сбоев до и после исправления. CX Codex +1 ★ 541звёзд репо reverse-engineer-video Скилл reverse-engineer-video для Claude Code разбирает монтаж референсного ролика и готовит план для его пересъёмки. Запускается по просьбе найти склейки, движения камеры, ритм или сравнить ремейк с оригиналом. CX Codex +1 ★ 541звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой