Logo vun Threat Modeling

Threat Modeling

Communautéit
arozumenko
threat-modeling

Use when deriving a data-flow diagram and STRIDE threats from code, with a citation per element and mitigations recorded as claims a fresh reviewer can confirm or refute; provides the threat-model.json shape cite.mjs check validates.

Iwwersiicht

Editeurarozumenko
Repositorysdlc-skills
Skill-Nummthreat-modeling
Stären
26
Forks
10
Matgeliwwert Fichieren
4
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum arozumenko op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Threat Modeling an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/arozumenko/sdlc-skills.git /tmp/sdlc-skills
mkdir -p .claude/skills
cp -r /tmp/sdlc-skills/bundles/security-testing/skills/threat-modeling .claude/skills/threat-modeling
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Threat Modeling an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Threat Modeling automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Threat Modeling net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Threat modeling

You write a code-derived DFD and STRIDE threats with citations; cite.mjs check <st>/threat-model.json re-reads every citation against the bytes at head and validates the disposition grammar — everything else is your judgement. Three rules hold everywhere:

  1. An element or a mitigation exists only because it is cited. Same citation shape as a finding's (references/dfd-elements.md), same FAILED <locus>.<i> <why> vocabulary.
  2. A mitigation is a claim, not a fact (references/mitigations-as-claims.md) — you never grade your own claim; a fresh security-reviewer's mitigation-review does, and even that never rewrites the model.
  3. You assign every element's, threat's and mitigation's own id (E-nnn/T-nnn/M-nnn) yourself; never write state, oid, snippet_redacted or check_stamp — check stamps those, and refuses a file carrying them from your hand (D10), the same rule as findings. id anywhere but element/threat/mitigation position is refused there too.

The shape

{ head?, elements: [{id, name, kind, citations}], threats: [{id, element_id, stride, title, mitigations, disposition}] }.

json
{
  "elements": [
    { "id": "E-001", "name": "HTTP handler", "kind": "process",
      "citations": [{ "path": "src/app.js", "lines": [1, 3], "snippet": "…" }] },
    { "id": "E-002", "name": "Orders table", "kind": "datastore",
      "citations": [{ "path": "src/orders.js", "lines": [40, 45], "snippet": "…" }] }
  ],
  "threats": [
    { "id": "T-001", "element_id": "E-002", "stride": "T",
      "title": "Order total tampered before it is charged",
      "mitigations": [
        { "id": "M-001", "claim": "createOrder recomputes the total from line items (lines 40-52)",
          "citations": [{ "path": "src/orders.js", "lines": [40, 52], "snippet": "…" }] }
      ],
      "disposition": "mitigated(M-001)" }
  ]
}
  • kind ∈ external | boundary | process | datastore | flow (references/dfd-elements.md — which letters apply to which kind is in references/stride.md).
  • stride ∈ S | T | R | I | D | E, one letter per threat.
  • disposition ∈ open | accepted(R-nnnn) | mitigated(M-nnn) | planned(TC-nnn) | out-of-scope(<reason>) — the full grammar, what each ref must name and the one-run sequence are in references/dispositions.md.
  • ids (E-nnn, T-nnn, M-nnn) are unique across the whole model, not just within their array.

Procedure

  1. Read engagement.md's scope_paths — what you may cite.
  2. Enumerate entry points — routers, handlers, consumers, schedulers.
  3. Elements, one citation each — external/process at entry points, boundary at trust changes, datastore/flow at sinks and moves (references/dfd-elements.md § Where to start).
  4. STRIDE per element — only the letters references/stride.md's table marks for that kind; one threat per effect.
  5. Mitigations as cited claims — a sentence a reviewer can confirm or refute from the citation alone (references/mitigations-as-claims.md).
  6. Dispositions — the one you can justify now; mitigated(M-nnn) only when the mitigation is already in the model under that threat.
  7. cite.mjs check <st>/threat-model.json.
  8. Fix TM-INVALID — the locus and the missing relationship name what to correct; edit threat-model.json and check again.
  9. Candidate passive cases — when a threat is worth an admitted test, draft it (never admit it yourself — that is the lead's cases.mjs admit) at .agents/security-testing/cases/TC-NNN_<slug>.md, id: TC-NNN, a # heading as its title. A planned(TC-nnn) disposition only validates once the lead has admitted it.

Result lines you will see

  • FAILED <locus>.<i> <why> — why ∈ bad-shape, path-not-in-scope, range-over-40, not-in-tree, snippet-not-found.
  • TM-INVALID <locus>: <why> — a structural or disposition defect, one per line, in document order (references/dispositions.md).
  • MODEL elements=<n> threats=<n> open=<n> then CHECK verified=<n> failed=<n> — printed on every run; exit 4 on any FAILED/TM-INVALID, else 0.
  • --md after those: the elements/threats/mitigations tables, then TABLES sha256=<hex>.

Your return line

cite.mjs check exits 0, no TM-INVALID lines ⇒ MODEL_WRITTEN elements=<n> threats=<n> open=<n> (the counts from the MODEL line). Anything else ⇒ the TM-INVALID lines verbatim — fix what they name and check again before you reply if you can.

Commands

node scripts/cite.mjs --help (from secure-code-review/scripts/, the only script this skill uses):

usage: cite <command> [options]

commands:
  init
  show
  check
  redact

show <path> [start end] [--at <oid>] for reading; check <threat-model.json> [--md [--no-snippets]] for validating; see secure-code-review/SKILL.md for init and redact. Every string printed or written is redacted (D9); the file is rewritten with check_stamp and, per citation, state, oid, snippet_redacted — never edit a stamped file by hand (REFUSED agent-written key <key>); fix the unstamped source and let the lead re-run check.

References

references/dfd-elements.md (the five kinds, the citation), references/stride.md (the six letters, which apply to which kind), references/mitigations-as-claims.md (the claim shape, the mitigation-review contract), references/dispositions.md (the five-value grammar, the failure format, the one-run sequence).

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Threat Modeling?

Use when deriving a data-flow diagram and STRIDE threats from code, with a citation per element and mitigations recorded as claims a fresh reviewer can confirm or refute; provides the threat-model.json shape cite.mjs check validates.

Firwat Threat Modeling op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Threat Modeling besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Threat Modeling an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Threat Modeling benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Threat Modeling benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Threat Modeling domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Threat Modeling gratis?

Jo. De Skill gëtt vum arozumenko ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇