Logo di Threat Modeling

Threat Modeling

Community
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.

Panoramica

Pubblicato daarozumenko
Repositorysdlc-skills
Nome della skillthreat-modeling
Stelle
26
Fork
10
File inclusi
4
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 4

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da arozumenko su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Threat Modeling in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Threat Modeling in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Threat Modeling non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Threat Modeling non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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).

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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.

Perché usare Threat Modeling su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Threat Modeling è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Threat Modeling in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/arozumenko/sdlc-skills/tree/main/bundles/security-testing/skills/threat-modeling. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Threat Modeling?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Threat Modeling?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Threat Modeling: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Threat Modeling è gratuita?

Sì. È pubblicata su GitHub da arozumenko con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇