@radicaltools/mcp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{chunk-Z7THA3L5.js → chunk-2SZDTOYJ.js} +65 -33
  2. package/dist/{elkLayout-TAUBPPVN.js → elkLayout-VYJDCCIT.js} +1 -1
  3. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  4. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  5. package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
  6. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  7. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  8. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  9. package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
  10. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  11. package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
  12. package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
  13. package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
  14. package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
  15. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
  16. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  17. package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
  18. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  19. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  20. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  21. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  22. package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
  23. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  24. package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
  25. package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
  26. package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
  27. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  28. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  29. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  30. package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
  31. package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
  32. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  33. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  34. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
  35. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  36. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
  37. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
  38. package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
  39. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
  40. package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
  41. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  42. package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
  43. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  44. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
  45. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  46. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  47. package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
  48. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  49. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  50. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  51. package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
  52. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  53. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  54. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
  55. package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
  56. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  57. package/dist/index.js +1001 -230
  58. package/package.json +1 -1
@@ -0,0 +1,1143 @@
1
+ {
2
+ "hub": {
3
+ "id": "concern-threat-modelling",
4
+ "category": "concern",
5
+ "name": "Threat modelling",
6
+ "description": "How the threats to an element reached across a trust boundary are found and ended: when the threat model is made and redone, with which method, where it lives, and how each threat ends (mitigated, accepted by a named owner until a date, or transferred). The snippets are Node and Python scripts and shell steps for GitHub Actions.",
7
+ "tags": [
8
+ "security",
9
+ "threat modelling",
10
+ "stride",
11
+ "linddun",
12
+ "pasta",
13
+ "threat dragon",
14
+ "pytm"
15
+ ],
16
+ "requiredMetamodel": "c4-ddd-governance-builtin",
17
+ "concern": {
18
+ "id": "threat-modelling",
19
+ "trigger": "LIST RELATIONS WHERE (source.type = \"person\" OR source.external = true) AND target.external != true AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")",
20
+ "applyTo": "target",
21
+ "why": "people or external systems reach these elements across a trust boundary, so how their threats are found and ended has to be decided.",
22
+ "group": "security"
23
+ },
24
+ "sources": [
25
+ {
26
+ "title": "Threat Modeling Manifesto",
27
+ "url": "https://www.threatmodelingmanifesto.org/"
28
+ },
29
+ {
30
+ "title": "OWASP Threat Modeling Cheat Sheet",
31
+ "url": "https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html"
32
+ },
33
+ {
34
+ "title": "Adam Shostack: Threat Modeling: Designing for Security (Wiley, 2014)",
35
+ "url": "https://www.wiley.com/en-us/Threat+Modeling%3A+Designing+for+Security-p-9781118809990"
36
+ },
37
+ {
38
+ "title": "Microsoft Threat Modeling Tool: threats (the STRIDE model)",
39
+ "url": "https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats"
40
+ },
41
+ {
42
+ "title": "LINDDUN privacy threat modeling framework: threat types",
43
+ "url": "https://linddun.org/threat-types/"
44
+ },
45
+ {
46
+ "title": "Tony UcedaVélez, Marco M. Morana: Risk Centric Threat Modeling: Process for Attack Simulation and Threat Analysis (Wiley, 2015)",
47
+ "url": "https://www.wiley.com/en-us/Risk+Centric+Threat+Modeling%3A+Process+for+Attack+Simulation+and+Threat+Analysis-p-9780470500965"
48
+ },
49
+ {
50
+ "title": "NIST SP 800-218, Secure Software Development Framework (SSDF) 1.1",
51
+ "url": "https://csrc.nist.gov/pubs/sp/800/218/final"
52
+ },
53
+ {
54
+ "title": "OWASP Threat Dragon documentation",
55
+ "url": "https://www.threatdragon.com/docs/"
56
+ },
57
+ {
58
+ "title": "OWASP pytm",
59
+ "url": "https://github.com/OWASP/pytm"
60
+ }
61
+ ],
62
+ "templateParams": [
63
+ {
64
+ "key": "WHEN",
65
+ "title": "When",
66
+ "label": "When is the threat model made and redone?",
67
+ "hint": "A threat model describes the system as it was when it was made. How often it is redone decides how long a new caller, data store or third party can run with nobody having asked what could go wrong there. Every answer makes the first threat model before the first release.",
68
+ "defaultValue": "change",
69
+ "options": [
70
+ {
71
+ "value": "change",
72
+ "label": "on every change to a trust boundary",
73
+ "description": "Every pull request that adds or moves a trust boundary (a new external caller, a new data store, a new third party) changes the threat model too, and gets a security review. Pick it when boundaries change during the release cycle and the files that define them can be named (infrastructure code, route tables, the API description)."
74
+ },
75
+ {
76
+ "value": "release",
77
+ "label": "once per release",
78
+ "description": "Before each release is tagged, the team reviews the changes since the previous release against the threat model and commits the review. Pick it when releases come every few weeks and boundaries are defined in places no path list can catch."
79
+ },
80
+ {
81
+ "value": "yearly",
82
+ "label": "once a year per system",
83
+ "description": "Each system's threat model is reviewed at least once every 12 months, in a session on the calendar. Pick it only for stable systems whose boundaries rarely change, or where a yearly review is all a standard asks; boundaries added between reviews wait for the next one."
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "key": "METHOD",
89
+ "title": "Method",
90
+ "label": "With which method are threats found?",
91
+ "hint": "The method decides which threats the team looks for and how each is recorded. STRIDE is the common starting point; LINDDUN adds the privacy harms STRIDE does not name; PASTA starts from the business and ranks threats by risk.",
92
+ "defaultValue": "stride",
93
+ "options": [
94
+ {
95
+ "value": "stride",
96
+ "label": "STRIDE per element and data flow",
97
+ "description": "A data-flow diagram with its trust boundaries, then each element and flow examined for spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege. Pick it for most systems: it is quick to learn and every tool supports it."
98
+ },
99
+ {
100
+ "value": "stride-linddun",
101
+ "label": "STRIDE per element and data flow, with LINDDUN for privacy threats",
102
+ "description": "STRIDE for security threats, and the seven LINDDUN categories (linking, identifying, non-repudiation, detecting, data disclosure, unawareness and unintervenability, non-compliance) on the same diagram for privacy threats. Pick it when the system handles personal data, so harms to the people in the data are looked for, not only attacks on the system."
103
+ },
104
+ {
105
+ "value": "pasta",
106
+ "label": "PASTA, risk-centric",
107
+ "description": "The seven stages of the Process for Attack Simulation and Threat Analysis: business objectives first, attack scenarios against them, and every threat scored by likelihood and impact. Pick it when the business wants threats ranked by risk to its objectives (finance, regulated services) and the team can afford the longer process."
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "key": "WHERE",
113
+ "title": "Where",
114
+ "label": "Where does the threat model live?",
115
+ "hint": "Every answer keeps the threat model in the repository, so it is reviewed with the code and read by the checks; the answer picks its form. A commercial platform keeps it outside the repository, which these checks cannot read; that is listed among the alternatives.",
116
+ "defaultValue": "dragon",
117
+ "options": [
118
+ {
119
+ "value": "dragon",
120
+ "label": "OWASP Threat Dragon models in the repository",
121
+ "description": "One Threat Dragon model per system as JSON in threat-model/, drawn in the Threat Dragon desktop or web app, with threats, their category, severity, status and mitigation on the diagram's elements; acceptances and transfers in a small YAML file beside them. Pick it when the people who model prefer drawing to code."
122
+ },
123
+ {
124
+ "value": "pytm",
125
+ "label": "OWASP pytm models with a triaged threat register",
126
+ "description": "Each system described in Python with pytm (elements, trust boundaries, data flows); pytm generates candidate threats from its library and draws the diagram, and every finding is triaged in a YAML register beside it. Pick it when the team prefers code and wants threats suggested from the model, and accepts triaging pytm's findings."
127
+ },
128
+ {
129
+ "value": "register",
130
+ "label": "a YAML threat register beside a data-flow diagram",
131
+ "description": "Per system a folder with a Mermaid data-flow diagram in README.md and the threats in threats.yaml, written by hand. Pick it for few, small systems, or when no tool is wanted beyond the repository."
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "key": "UNMITIGATED",
137
+ "title": "Unmitigated",
138
+ "label": "What stops a threat that is not mitigated?",
139
+ "hint": "A threat ends mitigated, transferred to a party under contract, or accepted by a named owner until a date. This decides whether an acceptance is enough for every threat, or whether a high or critical one must be mitigated or transferred before a release.",
140
+ "defaultValue": "expiry",
141
+ "options": [
142
+ {
143
+ "value": "expiry",
144
+ "label": "the expiry of its acceptance",
145
+ "description": "Any threat may be accepted by a named owner with a reason, until an expiry date; past that date the build fails until it is mitigated, transferred or accepted again. Pick it when the owner of the risk should be free to weigh it, and the expiry is enough to bring it back."
146
+ },
147
+ {
148
+ "value": "release-block",
149
+ "label": "the expiry of its acceptance, and a blocked release for a high or critical threat",
150
+ "description": "The same expiry, and no release while a high or critical threat is open or accepted: those must be mitigated or transferred first. Pick it for systems where a high threat in production would be a reportable incident (personal, financial or health data)."
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "key": "BOUNDARY_PATHS",
156
+ "label": "Which paths define a trust boundary (git pathspecs, separated by spaces)? (on every change to a trust boundary only)",
157
+ "defaultValue": "infra/ src/routes/ openapi.yaml"
158
+ },
159
+ {
160
+ "key": "ACCEPT_DAYS",
161
+ "label": "For at most how many days may a threat be accepted before it must be decided again?",
162
+ "defaultValue": "180",
163
+ "type": "number"
164
+ }
165
+ ]
166
+ },
167
+ "nodes": [
168
+ {
169
+ "id": "need",
170
+ "type": "need",
171
+ "label": "Threats are found and ended before attackers find them",
172
+ "x": 0,
173
+ "y": 0,
174
+ "kind": "brief",
175
+ "source": "Hub concern pack: Threat modelling",
176
+ "description": "People and other systems reach this element across a trust boundary. Before a new caller, data store or third party goes live, someone has to have asked what can go wrong there, and each answer has to end somewhere: a control that mitigates it, a party that carries it under contract, or a named person who accepts it until a date. The threat model has to stay as current as the boundaries it describes. The snippets assume the threat models under threat-model/ (threat-model/<system>.json for Threat Dragon, threat-model/<system>/ for pytm and the register), the architecture model as a Markdown folder under architecture/ (nodes/**/*.md and relations.json), scripts under scripts/ run by Node 20 with js-yaml or Python 3 with PyYAML, reports/threats.json as the one list of threats the reader of the chosen form writes, and GitHub as the code host."
177
+ },
178
+ {
179
+ "id": "req-redo-change",
180
+ "type": "requirement",
181
+ "label": "Boundary changes update the threat model",
182
+ "x": 260,
183
+ "y": 0,
184
+ "ears_type": "event-driven",
185
+ "trigger": "a pull request changes a file that defines a trust boundary ({{BOUNDARY_PATHS}}): a new external caller, a new data store, a new third party, or a moved boundary",
186
+ "action": "change the system's threat model under threat-model/ in the same pull request, and give that pull request the security-review label, so that it merges only after the security review the Secure development process pack sets up",
187
+ "rationale": "Threat modelling is most useful early and often, following design changes in manageable steps (Threat Modeling Manifesto, principles); the model must be kept up to date as the system changes (OWASP Threat Modeling Cheat Sheet; NIST SP 800-218 PW.1.1).",
188
+ "hubWhen": {
189
+ "WHEN": [
190
+ "change"
191
+ ]
192
+ }
193
+ },
194
+ {
195
+ "id": "req-redo-release",
196
+ "type": "requirement",
197
+ "label": "Each release reviews the threat model",
198
+ "x": 260,
199
+ "y": 130,
200
+ "ears_type": "event-driven",
201
+ "trigger": "a release is tagged",
202
+ "action": "publish it only when threat-model/ has a commit after the previous release tag, the record of that release's threat-model review",
203
+ "rationale": "The threat model is kept current as the system changes (OWASP Threat Modeling Cheat Sheet; NIST SP 800-218 PW.1.1); a review per release is the step the Manifesto asks for, sized to the release.",
204
+ "hubWhen": {
205
+ "WHEN": [
206
+ "release"
207
+ ]
208
+ }
209
+ },
210
+ {
211
+ "id": "req-redo-yearly",
212
+ "type": "requirement",
213
+ "label": "Threat models reviewed every year",
214
+ "x": 260,
215
+ "y": 260,
216
+ "ears_type": "ubiquitous",
217
+ "action": "review the threat model of each system at least once every 12 months, recording the review as a commit to that system's model",
218
+ "rationale": "A yearly review is the least that keeps a model from describing a system that no longer exists; the Manifesto prefers continuous refinement to a single delivery, which this answer accepts as a cost (Threat Modeling Manifesto, values; NIST SP 800-218 PW.1.1).",
219
+ "hubWhen": {
220
+ "WHEN": [
221
+ "yearly"
222
+ ]
223
+ }
224
+ },
225
+ {
226
+ "id": "req-in-repo",
227
+ "type": "requirement",
228
+ "label": "Threat model kept in the repository",
229
+ "x": 260,
230
+ "y": 390,
231
+ "ears_type": "ubiquitous",
232
+ "action": "keep each system's threat model in the repository under threat-model/ as {{WHERE}}, in a form the pipeline reads into one list of threats (reports/threats.json) on every pull request, and change it only through pull requests",
233
+ "rationale": "Documents record the shared understanding and make it measurable (Threat Modeling Manifesto, principles); kept with the code, the model is reviewed and versioned with what it describes, and available to those who need it (OWASP Threat Modeling Cheat Sheet)."
234
+ },
235
+ {
236
+ "id": "req-pytm-triaged",
237
+ "type": "requirement",
238
+ "label": "Every pytm finding triaged",
239
+ "x": 260,
240
+ "y": 520,
241
+ "ears_type": "unwanted-behaviour",
242
+ "unwanted_condition": "pytm generates a finding from a system's tm.py that the system's threats.yaml does not list by its threat id and element",
243
+ "action": "fail the build, naming the finding, until it is triaged in threats.yaml with a category, a severity and a status",
244
+ "rationale": "pytm suggests threats from its library; a suggestion nobody looked at is neither a threat found nor one ruled out (OWASP pytm; OWASP Threat Modeling Cheat Sheet: what are we going to do about it).",
245
+ "hubWhen": {
246
+ "WHERE": [
247
+ "pytm"
248
+ ]
249
+ }
250
+ },
251
+ {
252
+ "id": "req-external-callers",
253
+ "type": "requirement",
254
+ "label": "Every outside caller in the threat model",
255
+ "x": 260,
256
+ "y": 650,
257
+ "ears_type": "ubiquitous",
258
+ "action": "name in the threat model every person and every external system that the architecture model shows calling one of the system's elements",
259
+ "rationale": "Each outside caller is an entry point across a trust boundary; one missing from the threat model is a boundary nobody examined (Shostack, Threat Modeling, ch. 2: what are you building; OWASP Threat Modeling Cheat Sheet: system modeling)."
260
+ },
261
+ {
262
+ "id": "req-statuses",
263
+ "type": "requirement",
264
+ "label": "Every threat has a status that ends it",
265
+ "x": 260,
266
+ "y": 780,
267
+ "ears_type": "ubiquitous",
268
+ "action": "give every threat an id, the element or data flow it threatens, a severity of low, medium, high or critical, and one status: mitigated, naming the test, ADR or ticket that carries the control; transferred, naming the party that carries the risk and the contract or policy that says so; accepted; not applicable, with the reason; or open, naming the ticket that will close it",
269
+ "rationale": "Each threat gets a response (mitigate, eliminate, transfer or accept) and the response is recorded; a transfer does not lower the risk, so who carries it must be written down (OWASP Threat Modeling Cheat Sheet, response and mitigations)."
270
+ },
271
+ {
272
+ "id": "req-acceptance",
273
+ "type": "requirement",
274
+ "label": "Acceptances have an owner and an expiry",
275
+ "x": 260,
276
+ "y": 910,
277
+ "ears_type": "event-driven",
278
+ "trigger": "a threat is accepted",
279
+ "action": "record its risk owner by name (a person, not a team), the reason, the date of the acceptance and an expiry date at most {{ACCEPT_DAYS}} days later",
280
+ "rationale": "Accepting a risk is a decision someone takes for the business; with a name and a date it is visible and comes back for a new decision (OWASP Threat Modeling Cheat Sheet: accept; Threat Modeling Manifesto: a culture of finding and fixing over checkbox compliance)."
281
+ },
282
+ {
283
+ "id": "req-expired",
284
+ "type": "requirement",
285
+ "label": "Expired acceptances fail the build",
286
+ "x": 260,
287
+ "y": 1040,
288
+ "ears_type": "unwanted-behaviour",
289
+ "unwanted_condition": "an accepted threat passes its expiry date",
290
+ "action": "fail the main branch's build and every pull request's, naming the threat and its owner, until the threat is mitigated, transferred or accepted again by its owner with a new expiry",
291
+ "rationale": "An acceptance that never expires is a threat nobody will look at again; failing the build makes the renewal a decision instead of a habit (OWASP Threat Modeling Cheat Sheet: residual risk)."
292
+ },
293
+ {
294
+ "id": "req-high-blocks",
295
+ "type": "requirement",
296
+ "label": "No release with a high threat open or accepted",
297
+ "x": 260,
298
+ "y": 1170,
299
+ "ears_type": "unwanted-behaviour",
300
+ "unwanted_condition": "a threat of high or critical severity is open or accepted when a release is built",
301
+ "action": "stop the release, naming the threat, until it is mitigated or transferred",
302
+ "rationale": "For the threats that would be an incident, an accepted risk is not enough: the release waits for a control or a party who carries it (OWASP Threat Modeling Cheat Sheet: mitigate, transfer).",
303
+ "hubWhen": {
304
+ "UNMITIGATED": [
305
+ "release-block"
306
+ ]
307
+ }
308
+ },
309
+ {
310
+ "id": "req-stride",
311
+ "type": "requirement",
312
+ "label": "Threats classified by STRIDE",
313
+ "x": 260,
314
+ "y": 1300,
315
+ "ears_type": "ubiquitous",
316
+ "action": "find threats per element and data flow of the diagram, and record each security threat under exactly one of the six STRIDE categories: spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege",
317
+ "rationale": "STRIDE gives every team the same list of what can go wrong, and applied per element it walks every part of the diagram (Microsoft Threat Modeling Tool, the STRIDE model; Shostack, Threat Modeling, ch. 3).",
318
+ "hubWhen": {
319
+ "METHOD": [
320
+ "stride",
321
+ "stride-linddun"
322
+ ]
323
+ }
324
+ },
325
+ {
326
+ "id": "req-linddun",
327
+ "type": "requirement",
328
+ "label": "Privacy threats under LINDDUN",
329
+ "x": 260,
330
+ "y": 1430,
331
+ "ears_type": "ubiquitous",
332
+ "action": "examine every data flow and store that carries personal data under the seven LINDDUN categories (linking, identifying, non-repudiation, detecting, data disclosure, unawareness and unintervenability, non-compliance), so that each category appears in every system's threat model as a threat or as a not-applicable entry with its reason",
333
+ "rationale": "LINDDUN names the privacy harms that STRIDE does not, such as linking records to a person or detecting that a person is in the data (LINDDUN threat types; OWASP Threat Modeling Cheat Sheet).",
334
+ "hubWhen": {
335
+ "METHOD": [
336
+ "stride-linddun"
337
+ ]
338
+ }
339
+ },
340
+ {
341
+ "id": "req-pasta",
342
+ "type": "requirement",
343
+ "label": "Threats scored against business objectives",
344
+ "x": 260,
345
+ "y": 1560,
346
+ "ears_type": "ubiquitous",
347
+ "action": "list the business objectives and the attack scenarios against them in threat-model/objectives/<system>.md, and give every threat a risk score of likelihood times impact (each 1 to 5) with its severity following the score: low 1 to 5, medium 6 to 11, high 12 to 19, critical 20 to 25",
348
+ "rationale": "PASTA starts from the business objectives (stage 1), simulates attacks against them (stage 6) and ranks the threats by risk and impact (stage 7), so what is fixed first is what would hurt the business most (UcedaVélez and Morana, Risk Centric Threat Modeling).",
349
+ "hubWhen": {
350
+ "METHOD": [
351
+ "pasta"
352
+ ]
353
+ }
354
+ },
355
+ {
356
+ "id": "sc-redo-change",
357
+ "type": "scenario",
358
+ "label": "New partner route modelled",
359
+ "x": 520,
360
+ "y": 0,
361
+ "given": "a pull request that adds a route for a new partner under one of {{BOUNDARY_PATHS}}",
362
+ "when": "its checks run",
363
+ "then": "they fail until the same pull request changes threat-model/ and carries the security-review label",
364
+ "hubWhen": {
365
+ "WHEN": [
366
+ "change"
367
+ ]
368
+ }
369
+ },
370
+ {
371
+ "id": "sc-redo-release",
372
+ "type": "scenario",
373
+ "label": "Release without review stopped",
374
+ "x": 520,
375
+ "y": 130,
376
+ "given": "a release tag with no commit to threat-model/ since the previous tag",
377
+ "when": "the release job runs",
378
+ "then": "it fails, and it passes once the review is committed and the release is tagged again",
379
+ "hubWhen": {
380
+ "WHEN": [
381
+ "release"
382
+ ]
383
+ }
384
+ },
385
+ {
386
+ "id": "sc-redo-yearly",
387
+ "type": "scenario",
388
+ "label": "Stale model reported",
389
+ "x": 520,
390
+ "y": 260,
391
+ "given": "a system whose threat model was last committed 13 months ago",
392
+ "when": "the monthly job runs",
393
+ "then": "it fails naming the system and the date of the last review",
394
+ "hubWhen": {
395
+ "WHEN": [
396
+ "yearly"
397
+ ]
398
+ }
399
+ },
400
+ {
401
+ "id": "sc-in-repo",
402
+ "type": "scenario",
403
+ "label": "Model read on every change",
404
+ "x": 520,
405
+ "y": 390,
406
+ "given": "a pull request",
407
+ "when": "the pipeline runs",
408
+ "then": "the reader of the threat model writes reports/threats.json with every threat of every system, and fails on a model it cannot read"
409
+ },
410
+ {
411
+ "id": "sc-pytm-triaged",
412
+ "type": "scenario",
413
+ "label": "New finding waits for triage",
414
+ "x": 520,
415
+ "y": 520,
416
+ "given": "a change to tm.py that adds a data store",
417
+ "when": "pytm generates findings for it",
418
+ "then": "the build fails naming each new finding until threats.yaml lists it with a category, a severity and a status",
419
+ "hubWhen": {
420
+ "WHERE": [
421
+ "pytm"
422
+ ]
423
+ }
424
+ },
425
+ {
426
+ "id": "sc-external-callers",
427
+ "type": "scenario",
428
+ "label": "New caller missing",
429
+ "x": 520,
430
+ "y": 650,
431
+ "given": "an architecture model with a new external system that calls the system",
432
+ "when": "the check runs over the architecture model and threat-model/",
433
+ "then": "it fails naming that system until the threat model names it"
434
+ },
435
+ {
436
+ "id": "sc-statuses",
437
+ "type": "scenario",
438
+ "label": "Unended threat refused",
439
+ "x": 520,
440
+ "y": 780,
441
+ "given": "a threat marked mitigated with no reference, and one marked transferred with no party",
442
+ "when": "the check runs",
443
+ "then": "it fails naming both threats"
444
+ },
445
+ {
446
+ "id": "sc-acceptance",
447
+ "type": "scenario",
448
+ "label": "Acceptance without owner refused",
449
+ "x": 520,
450
+ "y": 910,
451
+ "given": "a threat accepted by a team handle, and one accepted for {{ACCEPT_DAYS}} days and one more",
452
+ "when": "the check runs",
453
+ "then": "it fails naming both acceptances"
454
+ },
455
+ {
456
+ "id": "sc-expired",
457
+ "type": "scenario",
458
+ "label": "Expired acceptance stops the build",
459
+ "x": 520,
460
+ "y": 1040,
461
+ "given": "a threat accepted until yesterday",
462
+ "when": "the nightly build of the main branch runs",
463
+ "then": "it fails naming the threat and its owner"
464
+ },
465
+ {
466
+ "id": "sc-high-blocks",
467
+ "type": "scenario",
468
+ "label": "High threat stops release",
469
+ "x": 520,
470
+ "y": 1170,
471
+ "given": "a high threat accepted until next month",
472
+ "when": "the release job runs",
473
+ "then": "it fails naming the threat, and passes once the threat is mitigated",
474
+ "hubWhen": {
475
+ "UNMITIGATED": [
476
+ "release-block"
477
+ ]
478
+ }
479
+ },
480
+ {
481
+ "id": "sc-stride",
482
+ "type": "scenario",
483
+ "label": "Uncategorised threat refused",
484
+ "x": 520,
485
+ "y": 1300,
486
+ "given": "a threat with no category, and one with the category \"injection\"",
487
+ "when": "the check runs",
488
+ "then": "it fails naming both threats",
489
+ "hubWhen": {
490
+ "METHOD": [
491
+ "stride",
492
+ "stride-linddun"
493
+ ]
494
+ }
495
+ },
496
+ {
497
+ "id": "sc-linddun",
498
+ "type": "scenario",
499
+ "label": "Privacy category skipped",
500
+ "x": 520,
501
+ "y": 1430,
502
+ "given": "a system whose threat model has no threat and no not-applicable entry under detecting",
503
+ "when": "the check runs",
504
+ "then": "it fails naming the system and the category",
505
+ "hubWhen": {
506
+ "METHOD": [
507
+ "stride-linddun"
508
+ ]
509
+ }
510
+ },
511
+ {
512
+ "id": "sc-pasta",
513
+ "type": "scenario",
514
+ "label": "Unscored threat refused",
515
+ "x": 520,
516
+ "y": 1560,
517
+ "given": "a threat with no score, and one scored 16 but rated medium",
518
+ "when": "the check runs",
519
+ "then": "it fails naming both threats",
520
+ "hubWhen": {
521
+ "METHOD": [
522
+ "pasta"
523
+ ]
524
+ }
525
+ },
526
+ {
527
+ "id": "adr-on-change",
528
+ "type": "adr",
529
+ "label": "Threat model redone on every change to a trust boundary",
530
+ "x": 780,
531
+ "y": 0,
532
+ "concern": "threat-modelling",
533
+ "status": "accepted",
534
+ "date": "",
535
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
536
+ "decision": "Each system that people or external systems reach has one threat model, made before its first release and redone in the pull request that adds or moves a trust boundary: a new external caller, a new data store, a new third party, a changed path between zones. The files that define a trust boundary are {{BOUNDARY_PATHS}}; a pull request check fails while the last change to one of them is newer than the last change to threat-model/, and a pull request that changes threat-model/ carries the security-review label, whose reviewers the Secure development process pack names. Method: {{METHOD}}. Form: {{WHERE}}. Each threat ends mitigated, transferred, or accepted by a named owner until a date at most {{ACCEPT_DAYS}} days away; what stops a threat that is not mitigated: {{UNMITIGATED}}. Findings from scanners and tests follow the Secure coding pack, not this register.",
537
+ "consequences": "• The threat model stays as current as the boundaries in the code; a new partner or data store is examined before it merges.\n• The pull requests that touch a boundary take longer: an hour for a new route, a session for a new third party.\n• The list of paths must stay true: a boundary defined elsewhere (a cloud console, another repository) escapes the check, so the review still asks.\n• Git dates prove the model was changed, not that it was thought through; the security review carries that.",
538
+ "alternatives": "1. Once per release: fewer sessions, but a boundary added early in a release runs unexamined until the release.\n2. Once a year: cheapest, and a snapshot of a system that keeps changing (Threat Modeling Manifesto: continuous refinement over a single delivery).\n3. A threat model per feature: finer grained, but threats that cross features (a shared store, a partner calling two features) are nowhere in full.",
539
+ "hubWhen": {
540
+ "WHEN": [
541
+ "change"
542
+ ]
543
+ }
544
+ },
545
+ {
546
+ "id": "adr-per-release",
547
+ "type": "adr",
548
+ "label": "Threat model reviewed once per release",
549
+ "x": 780,
550
+ "y": 130,
551
+ "concern": "threat-modelling",
552
+ "status": "accepted",
553
+ "date": "",
554
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
555
+ "decision": "Each system that people or external systems reach has one threat model, made before its first release and reviewed before each later release is tagged: the team walks through the changes since the previous tag, updates the model and commits the review to threat-model/ (at least the reviewer and date in the model). The release job fails when threat-model/ has no commit since the previous tag. Method: {{METHOD}}. Form: {{WHERE}}. Each threat ends mitigated, transferred, or accepted by a named owner until a date at most {{ACCEPT_DAYS}} days away; what stops a threat that is not mitigated: {{UNMITIGATED}}. Findings from scanners and tests follow the Secure coding pack, not this register.",
556
+ "consequences": "• One planned session per release, which the release job enforces.\n• A boundary added early in a release runs unexamined until the release is tagged.\n• A release with no boundary change still needs a commit, a small ritual that keeps the check honest.\n• With continuous deployment there is no release to hang the review on; the change-driven answer fits better there.",
557
+ "alternatives": "1. On every change to a trust boundary: current all the time, but every boundary change waits for the model.\n2. Once a year: cheaper, and up to a year behind the code.",
558
+ "hubWhen": {
559
+ "WHEN": [
560
+ "release"
561
+ ]
562
+ }
563
+ },
564
+ {
565
+ "id": "adr-yearly",
566
+ "type": "adr",
567
+ "label": "Threat model reviewed once a year",
568
+ "x": 780,
569
+ "y": 260,
570
+ "concern": "threat-modelling",
571
+ "status": "accepted",
572
+ "date": "",
573
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
574
+ "decision": "Each system that people or external systems reach has one threat model, made before its first release and reviewed at least once every 12 months in a session on the team's calendar; the review is committed to the system's model, and a monthly job fails when a system's model has no commit for 365 days. Boundaries added between reviews wait for the next one: this decision accepts that. Method: {{METHOD}}. Form: {{WHERE}}. Each threat ends mitigated, transferred, or accepted by a named owner until a date at most {{ACCEPT_DAYS}} days away; what stops a threat that is not mitigated: {{UNMITIGATED}}. Findings from scanners and tests follow the Secure coding pack, not this register.",
575
+ "consequences": "• The cheapest rhythm: one session per system per year.\n• A new third party or data store can run for up to a year before anyone asks what can go wrong there.\n• It fits stable systems and standards that ask for a yearly review; it is the snapshot the Manifesto warns about.\n• The first change to a boundary that worries someone should bring the review forward, by hand.",
576
+ "alternatives": "1. Once per release: tied to what actually changes.\n2. On every change to a trust boundary: current all the time, at a cost in the changes that touch boundaries.",
577
+ "hubWhen": {
578
+ "WHEN": [
579
+ "yearly"
580
+ ]
581
+ }
582
+ },
583
+ {
584
+ "id": "adr-stride",
585
+ "type": "adr",
586
+ "label": "Threats found with STRIDE per element",
587
+ "x": 780,
588
+ "y": 390,
589
+ "concern": "threat-modelling",
590
+ "status": "accepted",
591
+ "date": "",
592
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
593
+ "decision": "Threats are found with STRIDE per element and data flow: first the data-flow diagram with its trust boundaries (what are we working on), then each element and flow examined under the STRIDE categories that apply to its type, and every security threat recorded under one of the six categories: spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege. Privacy harms that are not attacks (linking records to a person, a person unaware of the processing) are out of this method; a system that starts handling personal data supersedes this decision with STRIDE and LINDDUN.",
594
+ "consequences": "• Quick to learn: the Elevation of Privilege card game and every tool teach it.\n• Every threat has a category, so a category nobody looked at shows up in review.\n• STRIDE finds threats, it does not rank them: the severity is the team's judgement.\n• Privacy harms to the people in the data are not looked for.",
595
+ "alternatives": "1. STRIDE with LINDDUN: the same, plus privacy threats; more time per data flow with personal data.\n2. PASTA: ranks threats by risk to the business, at the cost of a longer process.\n3. Attack trees alone: deep on one goal, but no list that walks the whole diagram.",
596
+ "hubWhen": {
597
+ "METHOD": [
598
+ "stride"
599
+ ]
600
+ }
601
+ },
602
+ {
603
+ "id": "adr-stride-linddun",
604
+ "type": "adr",
605
+ "label": "Threats found with STRIDE, privacy threats with LINDDUN",
606
+ "x": 780,
607
+ "y": 520,
608
+ "concern": "threat-modelling",
609
+ "status": "accepted",
610
+ "date": "",
611
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
612
+ "decision": "Security threats are found with STRIDE per element and data flow and recorded under its six categories; privacy threats are found with LINDDUN on the same diagram, on every data flow and store that carries personal data, and recorded under its seven categories, written as: linking, identifying, non-repudiation, detecting, data disclosure, unawareness & unintervenability, non-compliance (Threat Dragon's older names linkability, identifiability, detectability, disclosure of information and unawareness are read as these). Each system's threat model considers every LINDDUN category at least once, as a threat or as a not-applicable entry with its reason. Which data is personal is recorded as the Data classification pack decides.",
613
+ "consequences": "• Harms to the people in the data are looked for, not only attacks on the system.\n• Each flow with personal data takes longer: thirteen categories instead of six.\n• Non-repudiation means opposite things in the two methods (a STRIDE control, a LINDDUN threat to the person): the category names keep them apart.\n• Not-applicable entries with reasons show that a category was considered, which a privacy review can read.",
614
+ "alternatives": "1. STRIDE alone: quicker, and blind to privacy harms that are not attacks.\n2. A separate data protection impact assessment only: required by law in some cases, but done once and away from the design.\n3. PASTA: risk-ranked, with no privacy categories of its own.",
615
+ "hubWhen": {
616
+ "METHOD": [
617
+ "stride-linddun"
618
+ ]
619
+ }
620
+ },
621
+ {
622
+ "id": "adr-pasta",
623
+ "type": "adr",
624
+ "label": "Threats found and ranked with PASTA",
625
+ "x": 780,
626
+ "y": 650,
627
+ "concern": "threat-modelling",
628
+ "status": "accepted",
629
+ "date": "",
630
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
631
+ "decision": "Threats are found with PASTA, the seven-stage Process for Attack Simulation and Threat Analysis: (1) business objectives, (2) technical scope, (3) decomposition into the data-flow diagram, (4) threat analysis, (5) weaknesses, (6) attack scenarios, (7) risk and impact. Stages 1 and 6 are written in threat-model/objectives/<system>.md under the headings Business objectives and Attack scenarios; every threat carries a risk score of likelihood times impact, each from 1 to 5, and its severity follows the score: low 1 to 5, medium 6 to 11, high 12 to 19, critical 20 to 25. A threat may also name its STRIDE category, which nothing checks.",
632
+ "consequences": "• Threats are ranked by what they would cost the business, so the order of work is argued from the objectives.\n• The process is longer: the objectives and the attack scenarios need people from the business, not only engineers.\n• Likelihood and impact are estimates; the scale keeps them comparable, not exact.\n• Without fixed categories, completeness rests on the attack scenarios and the review.",
633
+ "alternatives": "1. STRIDE per element: quicker and complete over the diagram, but unranked.\n2. STRIDE with a separate risk rating (DREAD or CVSS): ranking without the business objectives.",
634
+ "hubWhen": {
635
+ "METHOD": [
636
+ "pasta"
637
+ ]
638
+ }
639
+ },
640
+ {
641
+ "id": "adr-dragon",
642
+ "type": "adr",
643
+ "label": "Threat models kept as OWASP Threat Dragon files",
644
+ "x": 780,
645
+ "y": 780,
646
+ "concern": "threat-modelling",
647
+ "status": "accepted",
648
+ "date": "",
649
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
650
+ "decision": "Each system's threat model is an OWASP Threat Dragon 2 model, threat-model/<system>.json, drawn with the Threat Dragon desktop app or the web app and committed through pull requests. Threats sit on the diagram's elements and flows with their category (type), severity, status (Open, Mitigated, N/A) and mitigation, which for a mitigated threat names the test, ADR or ticket and for an open one the ticket. Acceptances and transfers, which Threat Dragon 2.6 cannot hold with an owner and an expiry, are kept in threat-model/risk-decisions.yaml by the threat's id. scripts/threats-dragon.mjs reads both into reports/threats.json for the checks.",
651
+ "consequences": "• People draw the model; no code to learn.\n• The JSON carries positions and styles, so diffs are long; review the diagram, not the diff.\n• Two files to keep in step for accepted and transferred threats; the reader joins them by id.\n• The development branch of Threat Dragon adds Accepted and Transferred statuses; the reader maps them already, and the register still holds the owner and the expiry.",
652
+ "alternatives": "1. OWASP pytm: the model as code with suggested threats, but code to write and findings to triage.\n2. A YAML register beside a Mermaid diagram: no tool at all, and no threats suggested.\n3. Threagile (YAML): its last release, 0.9.1, dates from July 2024.\n4. A commercial platform (ThreatModeler, which acquired IriusRisk in January 2026): libraries and workflows, but the model lives outside the repository and the checks would need an export.",
653
+ "hubWhen": {
654
+ "WHERE": [
655
+ "dragon"
656
+ ]
657
+ }
658
+ },
659
+ {
660
+ "id": "adr-pytm",
661
+ "type": "adr",
662
+ "label": "Threat models kept as OWASP pytm code",
663
+ "x": 780,
664
+ "y": 910,
665
+ "concern": "threat-modelling",
666
+ "status": "accepted",
667
+ "date": "",
668
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
669
+ "decision": "Each system's threat model is code: threat-model/<system>/tm.py describes its elements, trust boundaries (Boundary) and data flows (Dataflow) with OWASP pytm (1.4), and pytm generates candidate threats from its threat library; python3 tm.py --dfd | dot -Tpng draws the diagram. Every finding is triaged in threat-model/<system>/threats.yaml by its threat id (finding) and element (pytm's target), with a category of the chosen method, severity, status and the fields the status needs; the triage lives in the register rather than in pytm's overrides, which replace the threat's text. scripts/threats_register.py runs each tm.py with --json, fails on an untriaged finding and writes reports/threats.json.",
670
+ "consequences": "• Threats are suggested from the model, so a new data store brings its threats with it.\n• Diffs are readable and the diagram is drawn from the code.\n• pytm's library is not classified by STRIDE or LINDDUN: the category is set in triage, and a library update can bring new findings to triage.\n• Needs Python and Graphviz in the pipeline, and someone who reads Python in every modelling session.",
671
+ "alternatives": "1. OWASP Threat Dragon: drawn, not coded, and nothing suggested.\n2. A YAML register beside a Mermaid diagram: no tool at all.\n3. Threagile: suggests threats from YAML, but its last release, 0.9.1, dates from July 2024.",
672
+ "hubWhen": {
673
+ "WHERE": [
674
+ "pytm"
675
+ ]
676
+ }
677
+ },
678
+ {
679
+ "id": "adr-register",
680
+ "type": "adr",
681
+ "label": "Threat models kept as a YAML register",
682
+ "x": 780,
683
+ "y": 1040,
684
+ "concern": "threat-modelling",
685
+ "status": "accepted",
686
+ "date": "",
687
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
688
+ "decision": "Each system's threat model is a folder threat-model/<system>/: README.md holds the data-flow diagram as a Mermaid flowchart with the trust boundaries as subgraphs, and threats.yaml lists the threats, each with id, element, category, threat, severity, status, mitigation (the test, ADR or ticket, the ticket of an open threat, or the reason it does not apply), and for an accepted threat owner, reason, accepted and expires, for a transferred one to and reference. scripts/threats_register.py reads every register into reports/threats.json and fails when a system has no diagram.",
689
+ "consequences": "• Nothing to install; GitHub renders the diagram and the register reads like a table.\n• Nothing suggests threats: completeness rests on the method and the session.\n• The diagram and the register can drift apart; the review of each change looks at both.",
690
+ "alternatives": "1. OWASP Threat Dragon: a drawing tool with threats on the diagram.\n2. OWASP pytm: threats suggested from the model in code.\n3. A document in a wiki: easy to write, outside the review of the code and unreadable by the checks.",
691
+ "hubWhen": {
692
+ "WHERE": [
693
+ "register"
694
+ ]
695
+ }
696
+ },
697
+ {
698
+ "id": "adr-release-block",
699
+ "type": "adr",
700
+ "label": "No release with a high threat open or accepted",
701
+ "x": 780,
702
+ "y": 1170,
703
+ "concern": "threat-modelling",
704
+ "status": "accepted",
705
+ "date": "",
706
+ "context": "People and other systems reach this element across a trust boundary, and every boundary is a place where data can be read, changed, faked or denied. The forces: a design flaw found in a threat model costs a conversation, the same flaw found in production costs an incident; a threat model made once and filed away describes a system that no longer exists, while one redone on every change costs time in the changes that matter most; a method gives the team a shared list of what can go wrong, but each method sees some threats and misses others (STRIDE sees attackers, not privacy harms; LINDDUN sees privacy, not tampering; PASTA weighs risk to the business but takes longer); a threat model kept where the code is gets reviewed with it, one kept in a tool nobody opens does not; and a threat nobody mitigated must still end somewhere: accepted by a named person until a date, or carried by a party under contract, never left open by default. The mitigations themselves are decided in the Authentication, Authorization, Encryption, Rate limiting and Software supply chain packs; who facilitates the sessions in the Secure development process pack.",
707
+ "decision": "A threat of high or critical severity cannot ride into production on an acceptance: the release job reads reports/threats.json and fails while any high or critical threat is open or accepted, until it is mitigated or transferred. Low and medium threats may still be accepted by a named owner until their expiry, at most {{ACCEPT_DAYS}} days.",
708
+ "consequences": "• No high threat reaches production on a signature alone.\n• A release can wait on a mitigation; the severity becomes something people argue about, so the method's rating rules matter.\n• An urgent fix that is blocked by an unrelated high threat needs that threat transferred or mitigated first, or this decision superseded for the occasion, in writing.",
709
+ "alternatives": "1. Acceptance with expiry for every threat: faster releases, and a high threat can go live on one person's word.\n2. Blocking every open threat of any severity: thorough, and soon worked around by rating everything low.",
710
+ "hubWhen": {
711
+ "UNMITIGATED": [
712
+ "release-block"
713
+ ]
714
+ }
715
+ },
716
+ {
717
+ "id": "ff-fresh-change",
718
+ "type": "fitness-fn",
719
+ "label": "Threat model newer than the last boundary change",
720
+ "x": 1040,
721
+ "y": 0,
722
+ "characteristic": "security",
723
+ "scope": "atomic",
724
+ "cadence": "triggered",
725
+ "trigger": "pull-request",
726
+ "invocation": "automated",
727
+ "description": "A pull-request check compares git dates: the last commit that touched a file defining a trust boundary against the last commit that touched threat-model/. A boundary change without a model change fails; so does a change to the model without the security-review label, which the Secure development process pack's check then turns into a required security approval. Run it on opened, synchronize, labeled and unlabeled, with the full history checked out.\n\nThreshold: The last commit to threat-model/ is no older than the last commit to {{BOUNDARY_PATHS}}; a pull request that changes threat-model/ carries the security-review label\n\nTool: git and jq in a GitHub Actions step (bash)\n\n```bash\n# pull-request check (on: pull_request, types opened, synchronize, labeled, unlabeled; actions/checkout with fetch-depth: 0)\nset -euo pipefail\nboundary=$(git log -1 --format=%ct HEAD -- {{BOUNDARY_PATHS}})\nmodel=$(git log -1 --format=%ct HEAD -- threat-model/)\nif [ -n \"$boundary\" ] && [ \"${model:-0}\" -lt \"$boundary\" ]; then\n echo \"A trust boundary changed after the threat model did:\"\n git log -1 --format=' %h %cs %s' HEAD -- {{BOUNDARY_PATHS}}\n echo \"Change threat-model/ in this pull request.\"\n exit 1\nfi\nif [ -n \"$(git diff --name-only \"origin/$GITHUB_BASE_REF...HEAD\" -- threat-model/)\" ] &&\n ! jq -e '.pull_request.labels | any(.name == \"security-review\")' \"$GITHUB_EVENT_PATH\" > /dev/null; then\n echo \"threat-model/ changed: add the security-review label, so the change gets its security review before the merge\"\n exit 1\nfi\necho \"the threat model is newer than every change to a trust boundary\"\n```",
728
+ "hubWhen": {
729
+ "WHEN": [
730
+ "change"
731
+ ]
732
+ }
733
+ },
734
+ {
735
+ "id": "ff-fresh-release",
736
+ "type": "fitness-fn",
737
+ "label": "Threat model reviewed since the previous release",
738
+ "x": 1040,
739
+ "y": 130,
740
+ "characteristic": "security",
741
+ "scope": "atomic",
742
+ "cadence": "triggered",
743
+ "trigger": "release",
744
+ "invocation": "manual",
745
+ "description": "The release job, running on the new tag before anything is published, finds the previous tag and fails when threat-model/ has no commit after it. The first release passes: the model made before it is checked by the other functions.\n\nThreshold: threat-model/ has at least 1 commit after the previous release tag\n\nTool: git in a GitHub Actions release job (bash)\n\n```bash\n# release job, run on the new tag (actions/checkout with fetch-depth: 0): the threat model was reviewed since the previous release\nset -euo pipefail\nprevious=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null) || { echo \"first release: nothing to compare\"; exit 0; }\nsince=$(git log -1 --format=%ct \"$previous\")\nmodel=$(git log -1 --format=%ct HEAD -- threat-model/)\nif [ \"${model:-0}\" -le \"$since\" ]; then\n echo \"threat-model/ has no commit since $previous: review the threat model and commit the review before this release\"\n exit 1\nfi\necho \"threat model reviewed on $(git log -1 --format=%cs HEAD -- threat-model/), after $previous\"\n```",
746
+ "hubWhen": {
747
+ "WHEN": [
748
+ "release"
749
+ ]
750
+ }
751
+ },
752
+ {
753
+ "id": "ff-fresh-yearly",
754
+ "type": "fitness-fn",
755
+ "label": "Every threat model reviewed within a year",
756
+ "x": 1040,
757
+ "y": 260,
758
+ "characteristic": "security",
759
+ "scope": "atomic",
760
+ "cadence": "temporal",
761
+ "every": "365d",
762
+ "invocation": "manual",
763
+ "description": "A scheduled job runs monthly over each system's model (a folder threat-model/<system>/ or a file threat-model/<system>.json) and fails naming every one whose last commit is more than 365 days old, with the date of that commit.\n\nThreshold: 0 systems under threat-model/ whose last commit is more than 365 days old\n\nTool: git in a scheduled GitHub Actions job (bash)\n\n```bash\n# scheduled job, monthly (actions/checkout with fetch-depth: 0): every system's threat model reviewed within a year\nset -euo pipefail\nlimit=$(( $(date +%s) - 365 * 86400 ))\nstatus=0\nfor model in threat-model/*/ threat-model/*.json; do\n [ -e \"$model\" ] || continue\n last=$(git log -1 --format=%ct HEAD -- \"$model\")\n if [ \"${last:-0}\" -lt \"$limit\" ]; then\n echo \"$model: last reviewed $(git log -1 --format=%cs HEAD -- \"$model\" | grep . || echo never), over a year ago\"\n status=1\n fi\ndone\nexit $status\n```",
764
+ "hubWhen": {
765
+ "WHEN": [
766
+ "yearly"
767
+ ]
768
+ }
769
+ },
770
+ {
771
+ "id": "ff-dragon",
772
+ "type": "fitness-fn",
773
+ "label": "Threat Dragon models read into one list",
774
+ "x": 1040,
775
+ "y": 390,
776
+ "characteristic": "security",
777
+ "scope": "atomic",
778
+ "cadence": "triggered",
779
+ "trigger": "pull-request",
780
+ "invocation": "automated",
781
+ "description": "A Node script reads each Threat Dragon model (version 2.x), takes every threat from the cells of every diagram with its element (a flow as source -> target: name), category, severity, status and mitigation, joins the acceptances and transfers from risk-decisions.yaml by threat id, and writes reports/threats.json for the other checks. It runs on every pull request; a file that is not a Threat Dragon 2 model fails it.\n\nThreshold: Every threat-model/*.json is a Threat Dragon 2 model and every threat on it is written to reports/threats.json, joined with its entry in threat-model/risk-decisions.yaml\n\nTool: Node 20 with js-yaml, reading the Threat Dragon 2 JSON format\n\n```js\n// scripts/threats-dragon.mjs: the Threat Dragon models and threat-model/risk-decisions.yaml into reports/threats.json\nimport { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport yaml from 'js-yaml'\n\nconst decisionsFile = 'threat-model/risk-decisions.yaml' // [{ threat, decision: accepted | transferred, owner, reason, accepted, expires, to, reference }]\nconst decisions = existsSync(decisionsFile) ? yaml.load(readFileSync(decisionsFile, 'utf8')) ?? [] : []\nconst STATUS = { Mitigated: 'mitigated', Avoided: 'mitigated', Eliminated: 'mitigated', NotApplicable: 'not-applicable', Accepted: 'accepted', Transferred: 'transferred' }\nconst threats = []\nfor (const file of readdirSync('threat-model').filter((f) => f.endsWith('.json'))) {\n const model = JSON.parse(readFileSync(`threat-model/${file}`, 'utf8'))\n if (!/^2\\./.test(model.version ?? '')) throw new Error(`${file}: not a Threat Dragon 2 model (version ${model.version})`)\n for (const diagram of model.detail.diagrams) {\n const name = Object.fromEntries(diagram.cells.map((c) => [c.id, String(c.data?.name ?? '').replace(/\\s+/g, ' ')]))\n for (const cell of diagram.cells) for (const t of cell.data?.threats ?? []) {\n const element = cell.shape === 'flow' ? `${name[cell.source?.cell] ?? 'outside'} -> ${name[cell.target?.cell] ?? 'outside'}: ${name[cell.id]}` : name[cell.id]\n const decision = decisions.find((d) => d.threat === t.id) ?? {}\n threats.push({ system: file.replace(/\\.json$/, ''), id: t.id, element, category: t.type, severity: String(t.severity ?? '').toLowerCase(),\n mitigation: t.mitigation ?? '', score: t.score, ...decision, status: decision.decision ?? STATUS[t.status] ?? 'open' })\n }\n }\n}\nmkdirSync('reports', { recursive: true })\nwriteFileSync('reports/threats.json', JSON.stringify(threats, null, 2))\nconsole.log(`${threats.length} threats from ${new Set(threats.map((t) => t.system)).size} Threat Dragon models`)\n```",
782
+ "hubWhen": {
783
+ "WHERE": [
784
+ "dragon"
785
+ ]
786
+ }
787
+ },
788
+ {
789
+ "id": "ff-register",
790
+ "type": "fitness-fn",
791
+ "label": "Threat registers read into one list, pytm findings triaged",
792
+ "x": 1040,
793
+ "y": 520,
794
+ "characteristic": "security",
795
+ "scope": "atomic",
796
+ "cadence": "triggered",
797
+ "trigger": "pull-request",
798
+ "invocation": "automated",
799
+ "description": "A Python script reads every register into reports/threats.json. Where a system has a tm.py, it runs pytm with --json and fails on every finding (threat id and element) the register does not list; where it has none, it fails when README.md holds no Mermaid flowchart. It runs on every pull request.\n\nThreshold: Every threat-model/<system>/threats.yaml is written to reports/threats.json; 0 pytm findings missing from their register; 0 hand-written registers without a Mermaid flowchart in README.md\n\nTool: Python 3 with PyYAML, and OWASP pytm 1.4 (python3 tm.py --json) where a system has a tm.py\n\n```python\n# scripts/threats_register.py: each threat-model/<system>/threats.yaml into reports/threats.json; with pytm, every finding of tm.py triaged there\nimport json, pathlib, subprocess, sys\nimport yaml\n\nthreats, problems = [], []\npathlib.Path(\"reports\").mkdir(exist_ok=True)\nfor register in sorted(pathlib.Path(\"threat-model\").glob(\"*/threats.yaml\")):\n system = register.parent\n entries = yaml.safe_load(register.read_text()) or []\n threats += [{**t, \"system\": system.name, \"severity\": str(t.get(\"severity\", \"\")).lower()} for t in entries]\n if (system / \"tm.py\").exists(): # pytm: the findings it generates, each triaged by finding id and element\n found = pathlib.Path(f\"reports/pytm-{system.name}.json\").resolve()\n subprocess.run([sys.executable, \"tm.py\", \"--json\", str(found)], cwd=system, check=True)\n triaged = {(t.get(\"finding\"), t.get(\"element\")) for t in entries}\n problems += [f\"{system.name}: pytm finding {f['threat_id']} on {f['target']} is not triaged in threats.yaml\"\n for f in json.loads(found.read_text())[\"findings\"] if (f[\"threat_id\"], f[\"target\"]) not in triaged]\n elif \"flowchart\" not in ((system / \"README.md\").read_text() if (system / \"README.md\").exists() else \"\"):\n problems.append(f\"{system.name}: no README.md with the data-flow diagram as a Mermaid flowchart\")\npathlib.Path(\"reports/threats.json\").write_text(json.dumps(threats, indent=2, default=str))\nprint(f\"{len(threats)} threats from {len(set(t['system'] for t in threats))} registers\")\nif problems:\n sys.exit(\"\\n\".join(problems))\n```",
800
+ "hubWhen": {
801
+ "WHERE": [
802
+ "pytm",
803
+ "register"
804
+ ]
805
+ }
806
+ },
807
+ {
808
+ "id": "ff-threat-status",
809
+ "type": "fitness-fn",
810
+ "label": "Every threat ends somewhere",
811
+ "x": 1040,
812
+ "y": 650,
813
+ "characteristic": "security",
814
+ "scope": "atomic",
815
+ "cadence": "triggered",
816
+ "trigger": "pull-request",
817
+ "invocation": "automated",
818
+ "description": "A Node script over reports/threats.json, run on every pull request and nightly on the main branch, so an acceptance that expires fails the build on the day after. A reference is a ticket key (SHOP-123), an issue number (#123), an ADR id (adr-…) or a test file (….test.ts).\n\nThreshold: 100% of threats in reports/threats.json have a rated severity and a status with what it needs: a reference for mitigated and open, a reason for not applicable, a party and a contract for transferred, a named owner, a reason and an unexpired acceptance of at most {{ACCEPT_DAYS}} days for accepted\n\nTool: Node 20 (no dependencies)\n\n```js\n// scripts/check-threats.mjs: every threat in reports/threats.json ends mitigated, transferred, accepted until a date, not applicable, or open with a ticket\nimport { readFileSync } from 'node:fs'\n\nconst MAX_DAYS = {{ACCEPT_DAYS}}\nconst REF = /\\b[A-Z][A-Z0-9]+-\\d+\\b|#\\d+\\b|\\badr-[\\w-]+|[\\w./-]+\\.(test|spec)\\.\\w+/ // a ticket, an ADR or a test file\nconst DAY = 86_400_000\nconst problems = []\nfor (const t of JSON.parse(readFileSync('reports/threats.json', 'utf8'))) {\n const at = `${t.system} ${t.id} (${t.element})`\n if (!['low', 'medium', 'high', 'critical'].includes(t.severity)) problems.push(`${at}: severity \"${t.severity}\" is not rated`)\n if (t.status === 'mitigated' && !REF.test(t.mitigation ?? '')) problems.push(`${at}: mitigated, but names no test, ADR or ticket`)\n else if (t.status === 'open' && !REF.test(t.mitigation ?? '')) problems.push(`${at}: open without the ticket that will close it`)\n else if (t.status === 'not-applicable' && !String(t.mitigation ?? '').trim()) problems.push(`${at}: not applicable without a reason`)\n else if (t.status === 'transferred' && !(t.to && t.reference)) problems.push(`${at}: transferred without the party and the contract or policy`)\n else if (t.status === 'accepted') {\n const accepted = Date.parse(t.accepted), expires = Date.parse(t.expires)\n if (!t.owner || String(t.owner).startsWith('@') || !t.reason) problems.push(`${at}: accepted without a named owner and a reason`)\n else if (!(expires > Date.now())) problems.push(`${at}: the acceptance by ${t.owner} expired on ${t.expires}`)\n else if (!(expires - accepted <= MAX_DAYS * DAY)) problems.push(`${at}: the acceptance runs past ${MAX_DAYS} days`)\n } else if (!['mitigated', 'open', 'not-applicable', 'transferred'].includes(t.status)) problems.push(`${at}: status \"${t.status}\" is not one of the five`)\n}\nif (problems.length) { console.error(problems.join('\\n')); process.exit(1) }\nconsole.log('every threat has a status that ends it')\n```"
819
+ },
820
+ {
821
+ "id": "ff-release-gate",
822
+ "type": "fitness-fn",
823
+ "label": "Release waits for high threats",
824
+ "x": 1040,
825
+ "y": 780,
826
+ "characteristic": "security",
827
+ "scope": "atomic",
828
+ "cadence": "triggered",
829
+ "trigger": "release",
830
+ "invocation": "automated",
831
+ "description": "A step in the release job, after the reader of the threat model has written reports/threats.json, selects the high and critical threats that are open or accepted and fails the release naming them.\n\nThreshold: 0 threats of high or critical severity with the status open or accepted when a release is built\n\nTool: jq in a GitHub Actions release job (bash)\n\n```bash\n# release job, after the reader of the threat model wrote reports/threats.json\nset -euo pipefail\nblocking=$(jq -r '.[]\n | select((.severity == \"high\" or .severity == \"critical\") and (.status == \"open\" or .status == \"accepted\"))\n | \"\\(.system) \\(.id) \\(.severity) \\(.status): \\(.element)\"' reports/threats.json)\nif [ -n \"$blocking\" ]; then\n echo \"High or critical threats neither mitigated nor transferred; the release stops:\"\n echo \"$blocking\"\n exit 1\nfi\necho \"no open or accepted high or critical threat\"\n```",
832
+ "hubWhen": {
833
+ "UNMITIGATED": [
834
+ "release-block"
835
+ ]
836
+ }
837
+ },
838
+ {
839
+ "id": "ff-external-callers",
840
+ "type": "fitness-fn",
841
+ "label": "Threat model names every outside caller",
842
+ "x": 1040,
843
+ "y": 910,
844
+ "characteristic": "security",
845
+ "scope": "atomic",
846
+ "cadence": "triggered",
847
+ "trigger": "pull-request",
848
+ "invocation": "automated",
849
+ "description": "A Node script reads the architecture model folder: the front matter of every node under architecture/nodes and the interacts relations in relations.json. It collects the label of every person or external element that calls an element that is not external, and fails for each label that appears nowhere under threat-model/ (case and spacing ignored). It runs on every pull request, so a caller added to the architecture model waits for the threat model.\n\nThreshold: 0 persons or external systems that the architecture model shows calling an element of the system and that no file under threat-model/ names\n\nTool: Node 20 with js-yaml, over the architecture model's Markdown folder\n\n```js\n// scripts/check-callers.mjs: the threat model names every person and external system the architecture model shows calling the system\nimport { readdirSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport yaml from 'js-yaml'\n\nconst walk = (dir) => readdirSync(dir, { withFileTypes: true }).flatMap((e) => (e.isDirectory() ? walk(join(dir, e.name)) : [join(dir, e.name)]))\nconst nodes = {}\nfor (const file of walk('architecture/nodes').filter((f) => f.endsWith('.md'))) {\n const front = yaml.load(readFileSync(file, 'utf8').split(/^---\\s*$/m)[1] ?? '') ?? {}\n if (front.id) nodes[front.id] = front\n}\nconst outside = (n) => n.type === 'person' || n.external === true\nconst callers = new Set(JSON.parse(readFileSync('architecture/relations.json', 'utf8'))\n .filter((r) => r.relationType === 'interacts' && nodes[r.sourceId] && nodes[r.targetId] && outside(nodes[r.sourceId]) && !outside(nodes[r.targetId]))\n .map((r) => nodes[r.sourceId].label))\nconst model = walk('threat-model').map((f) => readFileSync(f, 'utf8')).join('\\n').toLowerCase().replace(/\\s+/g, ' ')\nconst missing = [...callers].filter((label) => !model.includes(label.toLowerCase().replace(/\\s+/g, ' ')))\nconsole.log(`${callers.size} outside callers in the architecture model, ${missing.length} not named in threat-model/`)\nif (missing.length) { console.error(missing.map((m) => ` ${m}`).join('\\n')); process.exit(1) }\n```"
850
+ },
851
+ {
852
+ "id": "ff-categories",
853
+ "type": "fitness-fn",
854
+ "label": "Threats under the method's categories",
855
+ "x": 1040,
856
+ "y": 1040,
857
+ "characteristic": "security",
858
+ "scope": "atomic",
859
+ "cadence": "triggered",
860
+ "trigger": "pull-request",
861
+ "invocation": "automated",
862
+ "description": "A Node script over reports/threats.json checks each threat's category against the method's list, reading Threat Dragon's older LINDDUN names as the current ones, and with LINDDUN fails for each system where a category appears nowhere, as a threat or as a not-applicable entry.\n\nThreshold: 100% of threats carry a STRIDE category (or, with LINDDUN, a STRIDE or LINDDUN category); with LINDDUN, all 7 LINDDUN categories appear in each system's threat model\n\nTool: Node 20 (no dependencies)\n\n```js\n// scripts/check-categories.mjs: every threat in reports/threats.json under a category of the method: {{METHOD}}\nimport { readFileSync } from 'node:fs'\n\nconst STRIDE = ['spoofing', 'tampering', 'repudiation', 'information disclosure', 'denial of service', 'elevation of privilege']\nconst LINDDUN = ['linking', 'identifying', 'non-repudiation', 'detecting', 'data disclosure', 'unawareness & unintervenability', 'non-compliance']\nconst OLDER = { linkability: 'linking', identifiability: 'identifying', detectability: 'detecting', 'disclosure of information': 'data disclosure', unawareness: 'unawareness & unintervenability' } // Threat Dragon's names\nconst withLinddun = '{{METHOD}}'.includes('LINDDUN')\nconst allowed = withLinddun ? [...STRIDE, ...LINDDUN] : STRIDE\nconst category = (t) => { const c = String(t.category ?? '').trim().toLowerCase(); return OLDER[c] ?? c }\nconst threats = JSON.parse(readFileSync('reports/threats.json', 'utf8'))\nconst problems = threats.filter((t) => !allowed.includes(category(t)))\n .map((t) => `${t.system} ${t.id}: category \"${t.category ?? ''}\" is none of ${withLinddun ? 'STRIDE and LINDDUN' : 'STRIDE'}`)\nif (withLinddun) for (const system of new Set(threats.map((t) => t.system))) {\n const seen = new Set(threats.filter((t) => t.system === system).map(category))\n for (const c of LINDDUN.filter((c) => !seen.has(c))) problems.push(`${system}: LINDDUN \"${c}\" considered nowhere (a threat, or a not-applicable entry with its reason)`)\n}\nif (problems.length) { console.error(problems.join('\\n')); process.exit(1) }\nconsole.log(`${threats.length} threats, each under a category of the method`)\n```",
863
+ "hubWhen": {
864
+ "METHOD": [
865
+ "stride",
866
+ "stride-linddun"
867
+ ]
868
+ }
869
+ },
870
+ {
871
+ "id": "ff-pasta",
872
+ "type": "fitness-fn",
873
+ "label": "Threats scored, objectives written",
874
+ "x": 1040,
875
+ "y": 1170,
876
+ "characteristic": "security",
877
+ "scope": "atomic",
878
+ "cadence": "triggered",
879
+ "trigger": "pull-request",
880
+ "invocation": "automated",
881
+ "description": "A Node script over reports/threats.json checks each threat's score (the score field of a Threat Dragon threat or of a register entry) and the severity it gives, and that each system has its objectives file with the two sections of PASTA stages 1 and 6.\n\nThreshold: 100% of threats carry a whole risk score from 1 to 25 and the severity that score gives; every system has threat-model/objectives/<system>.md with the sections Business objectives and Attack scenarios\n\nTool: Node 20 (no dependencies)\n\n```js\n// scripts/check-pasta.mjs: every threat scored and rated by its score; every system with its objectives and attack scenarios\nimport { existsSync, readFileSync } from 'node:fs'\n\nconst rating = (score) => (score >= 20 ? 'critical' : score >= 12 ? 'high' : score >= 6 ? 'medium' : 'low')\nconst threats = JSON.parse(readFileSync('reports/threats.json', 'utf8'))\nconst problems = []\nfor (const t of threats) {\n const score = Number(t.score) // likelihood (1-5) x impact (1-5)\n if (!Number.isInteger(score) || score < 1 || score > 25) problems.push(`${t.system} ${t.id}: risk score \"${t.score ?? ''}\" is not likelihood x impact (1 to 25)`)\n else if (t.severity !== rating(score)) problems.push(`${t.system} ${t.id}: severity ${t.severity}, but a score of ${score} is ${rating(score)}`)\n}\nfor (const system of new Set(threats.map((t) => t.system))) {\n const file = `threat-model/objectives/${system}.md`\n const text = existsSync(file) ? readFileSync(file, 'utf8') : ''\n for (const heading of ['## Business objectives', '## Attack scenarios'])\n if (!text.includes(heading)) problems.push(`${file}: no \"${heading}\" section (PASTA stages 1 and 6)`)\n}\nif (problems.length) { console.error(problems.join('\\n')); process.exit(1) }\nconsole.log(`${threats.length} threats scored, objectives and attack scenarios for every system`)\n```",
882
+ "hubWhen": {
883
+ "METHOD": [
884
+ "pasta"
885
+ ]
886
+ }
887
+ }
888
+ ],
889
+ "relations": [
890
+ {
891
+ "id": "req-redo-change--derives--need",
892
+ "sourceId": "req-redo-change",
893
+ "targetId": "need",
894
+ "relationType": "derives"
895
+ },
896
+ {
897
+ "id": "req-redo-release--derives--need",
898
+ "sourceId": "req-redo-release",
899
+ "targetId": "need",
900
+ "relationType": "derives"
901
+ },
902
+ {
903
+ "id": "req-redo-yearly--derives--need",
904
+ "sourceId": "req-redo-yearly",
905
+ "targetId": "need",
906
+ "relationType": "derives"
907
+ },
908
+ {
909
+ "id": "req-in-repo--derives--need",
910
+ "sourceId": "req-in-repo",
911
+ "targetId": "need",
912
+ "relationType": "derives"
913
+ },
914
+ {
915
+ "id": "req-pytm-triaged--derives--need",
916
+ "sourceId": "req-pytm-triaged",
917
+ "targetId": "need",
918
+ "relationType": "derives"
919
+ },
920
+ {
921
+ "id": "req-external-callers--derives--need",
922
+ "sourceId": "req-external-callers",
923
+ "targetId": "need",
924
+ "relationType": "derives"
925
+ },
926
+ {
927
+ "id": "req-statuses--derives--need",
928
+ "sourceId": "req-statuses",
929
+ "targetId": "need",
930
+ "relationType": "derives"
931
+ },
932
+ {
933
+ "id": "req-acceptance--derives--need",
934
+ "sourceId": "req-acceptance",
935
+ "targetId": "need",
936
+ "relationType": "derives"
937
+ },
938
+ {
939
+ "id": "req-expired--derives--need",
940
+ "sourceId": "req-expired",
941
+ "targetId": "need",
942
+ "relationType": "derives"
943
+ },
944
+ {
945
+ "id": "req-high-blocks--derives--need",
946
+ "sourceId": "req-high-blocks",
947
+ "targetId": "need",
948
+ "relationType": "derives"
949
+ },
950
+ {
951
+ "id": "req-stride--derives--need",
952
+ "sourceId": "req-stride",
953
+ "targetId": "need",
954
+ "relationType": "derives"
955
+ },
956
+ {
957
+ "id": "req-linddun--derives--need",
958
+ "sourceId": "req-linddun",
959
+ "targetId": "need",
960
+ "relationType": "derives"
961
+ },
962
+ {
963
+ "id": "req-pasta--derives--need",
964
+ "sourceId": "req-pasta",
965
+ "targetId": "need",
966
+ "relationType": "derives"
967
+ },
968
+ {
969
+ "id": "sc-redo-change--verifies--req-redo-change",
970
+ "sourceId": "sc-redo-change",
971
+ "targetId": "req-redo-change",
972
+ "relationType": "verifies"
973
+ },
974
+ {
975
+ "id": "sc-redo-release--verifies--req-redo-release",
976
+ "sourceId": "sc-redo-release",
977
+ "targetId": "req-redo-release",
978
+ "relationType": "verifies"
979
+ },
980
+ {
981
+ "id": "sc-redo-yearly--verifies--req-redo-yearly",
982
+ "sourceId": "sc-redo-yearly",
983
+ "targetId": "req-redo-yearly",
984
+ "relationType": "verifies"
985
+ },
986
+ {
987
+ "id": "sc-in-repo--verifies--req-in-repo",
988
+ "sourceId": "sc-in-repo",
989
+ "targetId": "req-in-repo",
990
+ "relationType": "verifies"
991
+ },
992
+ {
993
+ "id": "sc-pytm-triaged--verifies--req-pytm-triaged",
994
+ "sourceId": "sc-pytm-triaged",
995
+ "targetId": "req-pytm-triaged",
996
+ "relationType": "verifies"
997
+ },
998
+ {
999
+ "id": "sc-external-callers--verifies--req-external-callers",
1000
+ "sourceId": "sc-external-callers",
1001
+ "targetId": "req-external-callers",
1002
+ "relationType": "verifies"
1003
+ },
1004
+ {
1005
+ "id": "sc-statuses--verifies--req-statuses",
1006
+ "sourceId": "sc-statuses",
1007
+ "targetId": "req-statuses",
1008
+ "relationType": "verifies"
1009
+ },
1010
+ {
1011
+ "id": "sc-acceptance--verifies--req-acceptance",
1012
+ "sourceId": "sc-acceptance",
1013
+ "targetId": "req-acceptance",
1014
+ "relationType": "verifies"
1015
+ },
1016
+ {
1017
+ "id": "sc-expired--verifies--req-expired",
1018
+ "sourceId": "sc-expired",
1019
+ "targetId": "req-expired",
1020
+ "relationType": "verifies"
1021
+ },
1022
+ {
1023
+ "id": "sc-high-blocks--verifies--req-high-blocks",
1024
+ "sourceId": "sc-high-blocks",
1025
+ "targetId": "req-high-blocks",
1026
+ "relationType": "verifies"
1027
+ },
1028
+ {
1029
+ "id": "sc-stride--verifies--req-stride",
1030
+ "sourceId": "sc-stride",
1031
+ "targetId": "req-stride",
1032
+ "relationType": "verifies"
1033
+ },
1034
+ {
1035
+ "id": "sc-linddun--verifies--req-linddun",
1036
+ "sourceId": "sc-linddun",
1037
+ "targetId": "req-linddun",
1038
+ "relationType": "verifies"
1039
+ },
1040
+ {
1041
+ "id": "sc-pasta--verifies--req-pasta",
1042
+ "sourceId": "sc-pasta",
1043
+ "targetId": "req-pasta",
1044
+ "relationType": "verifies"
1045
+ },
1046
+ {
1047
+ "id": "ff-fresh-change--implements--adr-on-change",
1048
+ "sourceId": "ff-fresh-change",
1049
+ "targetId": "adr-on-change",
1050
+ "relationType": "implements"
1051
+ },
1052
+ {
1053
+ "id": "ff-fresh-release--implements--adr-per-release",
1054
+ "sourceId": "ff-fresh-release",
1055
+ "targetId": "adr-per-release",
1056
+ "relationType": "implements"
1057
+ },
1058
+ {
1059
+ "id": "ff-fresh-yearly--implements--adr-yearly",
1060
+ "sourceId": "ff-fresh-yearly",
1061
+ "targetId": "adr-yearly",
1062
+ "relationType": "implements"
1063
+ },
1064
+ {
1065
+ "id": "ff-dragon--implements--adr-dragon",
1066
+ "sourceId": "ff-dragon",
1067
+ "targetId": "adr-dragon",
1068
+ "relationType": "implements"
1069
+ },
1070
+ {
1071
+ "id": "ff-register--implements--adr-pytm",
1072
+ "sourceId": "ff-register",
1073
+ "targetId": "adr-pytm",
1074
+ "relationType": "implements"
1075
+ },
1076
+ {
1077
+ "id": "ff-register--implements--adr-register",
1078
+ "sourceId": "ff-register",
1079
+ "targetId": "adr-register",
1080
+ "relationType": "implements"
1081
+ },
1082
+ {
1083
+ "id": "ff-threat-status--implements--adr-on-change",
1084
+ "sourceId": "ff-threat-status",
1085
+ "targetId": "adr-on-change",
1086
+ "relationType": "implements"
1087
+ },
1088
+ {
1089
+ "id": "ff-threat-status--implements--adr-per-release",
1090
+ "sourceId": "ff-threat-status",
1091
+ "targetId": "adr-per-release",
1092
+ "relationType": "implements"
1093
+ },
1094
+ {
1095
+ "id": "ff-threat-status--implements--adr-yearly",
1096
+ "sourceId": "ff-threat-status",
1097
+ "targetId": "adr-yearly",
1098
+ "relationType": "implements"
1099
+ },
1100
+ {
1101
+ "id": "ff-release-gate--implements--adr-release-block",
1102
+ "sourceId": "ff-release-gate",
1103
+ "targetId": "adr-release-block",
1104
+ "relationType": "implements"
1105
+ },
1106
+ {
1107
+ "id": "ff-external-callers--implements--adr-on-change",
1108
+ "sourceId": "ff-external-callers",
1109
+ "targetId": "adr-on-change",
1110
+ "relationType": "implements"
1111
+ },
1112
+ {
1113
+ "id": "ff-external-callers--implements--adr-per-release",
1114
+ "sourceId": "ff-external-callers",
1115
+ "targetId": "adr-per-release",
1116
+ "relationType": "implements"
1117
+ },
1118
+ {
1119
+ "id": "ff-external-callers--implements--adr-yearly",
1120
+ "sourceId": "ff-external-callers",
1121
+ "targetId": "adr-yearly",
1122
+ "relationType": "implements"
1123
+ },
1124
+ {
1125
+ "id": "ff-categories--implements--adr-stride",
1126
+ "sourceId": "ff-categories",
1127
+ "targetId": "adr-stride",
1128
+ "relationType": "implements"
1129
+ },
1130
+ {
1131
+ "id": "ff-categories--implements--adr-stride-linddun",
1132
+ "sourceId": "ff-categories",
1133
+ "targetId": "adr-stride-linddun",
1134
+ "relationType": "implements"
1135
+ },
1136
+ {
1137
+ "id": "ff-pasta--implements--adr-pasta",
1138
+ "sourceId": "ff-pasta",
1139
+ "targetId": "adr-pasta",
1140
+ "relationType": "implements"
1141
+ }
1142
+ ]
1143
+ }