@radicaltools/mcp 0.3.0 → 0.3.2

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 (59) hide show
  1. package/README.md +7 -5
  2. package/dist/{chunk-Z7THA3L5.js → chunk-KEIZXREX.js} +68 -35
  3. package/dist/{elkLayout-TAUBPPVN.js → elkLayout-MFJXDTJG.js} +1 -1
  4. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  5. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  6. package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
  7. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  8. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  9. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  10. package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
  11. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  12. package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
  13. package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
  14. package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
  15. package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
  16. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
  17. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  18. package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
  19. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  20. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  21. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  22. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  23. package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
  24. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  25. package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
  26. package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
  27. package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
  28. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  29. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  30. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  31. package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
  32. package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
  33. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  34. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  35. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
  36. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  37. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
  38. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
  39. package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
  40. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
  41. package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
  42. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  43. package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
  44. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  45. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
  46. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  47. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  48. package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
  49. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  50. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  51. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  52. package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
  53. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  54. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  55. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
  56. package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
  57. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  58. package/dist/index.js +1893 -468
  59. package/package.json +1 -1
@@ -17,7 +17,7 @@
17
17
  "id": "personal-data",
18
18
  "trigger": "LIST NODES WHERE type = \"database\" AND external != true",
19
19
  "why": "these stores keep data, and whether any of it is about people decides on what basis it is kept, for how long, where it may go and how it is erased.",
20
- "group": "data"
20
+ "group": "compliance"
21
21
  },
22
22
  "sources": [
23
23
  {
@@ -28,9 +28,21 @@
28
28
  "title": "EDPB guidelines, recommendations and best practices (consent, data subject rights, transfers)",
29
29
  "url": "https://www.edpb.europa.eu/our-work-tools/general-guidance/guidelines-recommendations-best-practices_en"
30
30
  },
31
+ {
32
+ "title": "EDPB Guidelines 9/2022 on personal data breach notification under GDPR",
33
+ "url": "https://www.edpb.europa.eu/system/files/2023-04/edpb_guidelines_202209_personal_data_breach_notification_v2.0_en.pdf"
34
+ },
31
35
  {
32
36
  "title": "ICO, UK GDPR guidance and resources",
33
37
  "url": "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
38
+ },
39
+ {
40
+ "title": "Article 29 Working Party, Opinion 05/2014 on Anonymisation Techniques",
41
+ "url": "https://ec.europa.eu/justice/article-29/documentation/opinion-recommendation/files/2014/wp216_en.pdf"
42
+ },
43
+ {
44
+ "title": "CJEU C-311/18 (Schrems II)",
45
+ "url": "https://curia.europa.eu/juris/liste.jsf?num=C-311/18"
34
46
  }
35
47
  ],
36
48
  "templateParams": [
@@ -38,17 +50,17 @@
38
50
  "key": "PERSONAL",
39
51
  "title": "Personal data",
40
52
  "label": "Does it keep data about people?",
41
- "hint": "Names, e-mail and IP addresses, device and customer ids, and anything else that can be tied to a person count (GDPR Art. 4(1)); so do log lines that carry them.",
53
+ "hint": "Names, e-mail and IP addresses, device and customer ids, and anything else that can be tied to a person count (GDPR Art. 4(1)); so do log lines that carry them. With no, the other questions and details are moot.",
42
54
  "defaultValue": "yes",
43
55
  "options": [
44
56
  {
45
57
  "value": "yes",
46
- "label": "yes, data about people",
58
+ "label": "data about people",
47
59
  "description": "Any field, log line or event that identifies a person directly or with other data the organisation holds. Pick it when the store keeps accounts, customers, employees, addresses, IPs or user ids; retention, rights, location and security become requirements."
48
60
  },
49
61
  {
50
62
  "value": "no",
51
- "label": "no, nothing that identifies a person",
63
+ "label": "nothing that identifies a person",
52
64
  "description": "Only data about things: products, prices, telemetry without user or device ids. Pick it only when no column, log line or event can be tied to a person; the decision records it and a scan keeps it true."
53
65
  }
54
66
  ]
@@ -57,13 +69,13 @@
57
69
  "key": "SPECIAL",
58
70
  "title": "Special categories",
59
71
  "label": "Does it keep health, biometric or other special-category data?",
60
- "hint": "GDPR Art. 9 forbids processing health, genetic, biometric, ethnic, religious, political, trade-union and sex-life data unless one of its exceptions applies, and a large-scale use needs a data protection impact assessment (Art. 35).",
72
+ "hint": "GDPR Art. 9 forbids processing health, genetic, biometric, ethnic, religious, political, trade-union and sex-life data unless one of its exceptions applies, and a large-scale use needs a data protection impact assessment (Art. 35). Only when it keeps data about people.",
61
73
  "defaultValue": "no",
62
74
  "options": [
63
75
  {
64
76
  "value": "no",
65
77
  "label": "no special categories",
66
- "description": "None of the Art. 9 categories and no criminal records (Art. 10). Pick it for ordinary customer, order and account data."
78
+ "description": "None of the Art. 9 categories and no criminal records (Art. 10). Pick it for ordinary customer, order and account data; the decision records it so a health or biometric field is not added on the quiet."
67
79
  },
68
80
  {
69
81
  "value": "yes",
@@ -76,23 +88,23 @@
76
88
  "key": "REGION",
77
89
  "title": "Location",
78
90
  "label": "Where may the personal data be kept and processed?",
79
- "hint": "Chapter V of the GDPR allows a transfer outside the EU/EEA only to a country with an adequacy decision or under safeguards such as standard contractual clauses; backups, logs, support tools and every processor count.",
91
+ "hint": "Chapter V of the GDPR allows a transfer outside the EU/EEA only to a country with an adequacy decision or under safeguards such as standard contractual clauses; backups, logs, support tools and every processor count. Only when it keeps data about people.",
80
92
  "defaultValue": "eu",
81
93
  "options": [
82
94
  {
83
95
  "value": "eu",
84
- "label": "in the EU/EEA only",
96
+ "label": "the EU/EEA only",
85
97
  "description": "Stores, backups, logs and every processor stay in EU/EEA regions. Pick it when customers or contracts demand it, for public-sector or health data, or simply to need no transfer mechanism at all."
86
98
  },
87
99
  {
88
100
  "value": "adequate",
89
- "label": "in the EU/EEA or a country with an adequacy decision",
101
+ "label": "the EU/EEA and countries with an adequacy decision",
90
102
  "description": "Also the UK, Switzerland, Japan, Canada, the US (certified under the Data Privacy Framework) and the other countries the Commission has found adequate (Art. 45). Pick it when a processor you need runs there and nowhere else."
91
103
  },
92
104
  {
93
105
  "value": "any",
94
- "label": "anywhere, under standard contractual clauses",
95
- "description": "Transfers to any country with the Commission's standard contractual clauses and a transfer impact assessment per processor (Art. 46, EDPB Recommendations 01/2020). Pick it when global processors or follow-the-sun support are needed and someone owns the assessments."
106
+ "label": "any country under standard contractual clauses",
107
+ "description": "Transfers to any country with the Commission's standard contractual clauses and a transfer impact assessment per processor (Art. 46, EDPB Recommendations 01/2020); adequate countries need neither. Pick it when global processors or follow-the-sun support are needed and someone owns the assessments."
96
108
  }
97
109
  ]
98
110
  },
@@ -100,7 +112,7 @@
100
112
  "key": "ERASURE",
101
113
  "title": "Erasure",
102
114
  "label": "How is a person's data erased?",
103
- "hint": "Erasure (Art. 17) and retention (Art. 5(1)(e)) have to reach every copy: replicas, caches, logs, exports and backups that cannot be edited.",
115
+ "hint": "Erasure (Art. 17) and retention (Art. 5(1)(e)) have to reach every copy: replicas, caches, logs, exports and backups that cannot be edited. Only when it keeps data about people.",
104
116
  "defaultValue": "delete",
105
117
  "options": [
106
118
  {
@@ -124,7 +136,7 @@
124
136
  "key": "BASIS",
125
137
  "title": "Lawful basis",
126
138
  "label": "On what lawful basis is most of it processed?",
127
- "hint": "Every purpose needs one of the six bases of Art. 6(1), and the basis decides which rights apply and what has to be recorded: consent must be provable and as easy to withdraw as to give; legitimate interests can be objected to.",
139
+ "hint": "Every purpose needs one of the six bases of Art. 6(1), and the basis decides which rights apply and what has to be recorded: consent must be provable and as easy to withdraw as to give; legitimate interests can be objected to. Only when it keeps data about people.",
128
140
  "defaultValue": "contract",
129
141
  "options": [
130
142
  {
@@ -134,7 +146,7 @@
134
146
  },
135
147
  {
136
148
  "value": "consent",
137
- "label": "consent, recorded per purpose",
149
+ "label": "consent recorded per purpose",
138
150
  "description": "The person opted in to a purpose such as marketing or personalisation (Art. 6(1)(a), Art. 7). Pick it when the processing is optional for the service; each consent is recorded and its withdrawal stops the processing."
139
151
  },
140
152
  {
@@ -146,21 +158,27 @@
146
158
  },
147
159
  {
148
160
  "key": "RETENTION_MONTHS",
149
- "label": "After how many months unused is personal data erased?",
161
+ "label": "After how many months unused is personal data erased? (data about people only)",
150
162
  "defaultValue": "24",
151
163
  "type": "number"
152
164
  },
153
165
  {
154
- "key": "ERASE_DAYS",
155
- "label": "Within how many days is an erasure request done (at most 30)?",
166
+ "key": "REQUEST_DAYS",
167
+ "label": "Within how many days is an access or erasure request answered (at most 30)? (data about people only)",
156
168
  "defaultValue": "30",
157
169
  "type": "number"
158
170
  },
159
171
  {
160
172
  "key": "BACKUP_DAYS",
161
- "label": "For how many days are backups kept?",
173
+ "label": "For how many days are backups kept? (data about people only)",
162
174
  "defaultValue": "35",
163
175
  "type": "number"
176
+ },
177
+ {
178
+ "key": "PROCESSOR_NOTICE_HOURS",
179
+ "label": "Within how many hours must a processor tell you of a breach? (data about people only)",
180
+ "defaultValue": "24",
181
+ "type": "number"
164
182
  }
165
183
  ]
166
184
  },
@@ -173,7 +191,7 @@
173
191
  "y": 0,
174
192
  "kind": "brief",
175
193
  "source": "Hub concern pack: Personal data",
176
- "description": "The system keeps data about people. Data protection law and the people themselves expect it to be processed only for a stated purpose on a lawful basis, kept no longer than needed, kept where the law allows, protected against leaks, handed over when a person asks and erased when they ask, every copy included. The organisation also has to be able to show, at any time, what it keeps, why, where and for how long."
194
+ "description": "The system keeps data about people. Data protection law and the people themselves expect it to be processed only for a stated purpose on a lawful basis, kept no longer than needed, kept where the law allows, protected against leaks, handed over when a person asks and erased when they ask, every copy included. The organisation also has to be able to show, at any time, what it keeps, why, where and for how long. The snippets assume the application under src/ (src/privacy the erasure, consents and exclusions, src/crypto the envelope layer), the tests under tests/ with their fixtures in tests/privacy, and the records under docs/ (record-of-processing.json, dpia/, and breaches/ with runbook.md and register.json) and processors.yaml."
177
195
  },
178
196
  {
179
197
  "id": "req-record",
@@ -214,7 +232,7 @@
214
232
  "y": 260,
215
233
  "ears_type": "event-driven",
216
234
  "trigger": "a person whose identity has been verified asks for the data kept about them",
217
- "action": "deliver all of it from every store, as JSON, within 30 days, together with the purposes, recipients, retention periods and source of each part",
235
+ "action": "deliver all of it from every store, as JSON, within {{REQUEST_DAYS}} days, together with the purposes, recipients, retention periods and source of each part",
218
236
  "rationale": "The right of access (GDPR Art. 15) and the right to data portability in a structured, commonly used, machine-readable format (Art. 20), both within one month (Art. 12(3)).",
219
237
  "hubWhen": {
220
238
  "PERSONAL": [
@@ -230,7 +248,7 @@
230
248
  "y": 390,
231
249
  "ears_type": "event-driven",
232
250
  "trigger": "a verified person's erasure request is accepted",
233
- "action": "erase their data by {{ERASURE}} in every store, replica, cache, log and export within {{ERASE_DAYS}} days, keep only what a legal obligation requires, tell every recipient it was disclosed to, and confirm to the person",
251
+ "action": "erase their data by {{ERASURE}} in every store, replica, cache, log and export within {{REQUEST_DAYS}} days, keep only what a legal obligation requires, tell every recipient it was disclosed to, and confirm to the person",
234
252
  "rationale": "The right to erasure (GDPR Art. 17) within one month (Art. 12(3)), passed on to the recipients (Art. 19); records the law requires (invoices) are an exception of Art. 17(3)(b).",
235
253
  "hubWhen": {
236
254
  "PERSONAL": [
@@ -298,11 +316,11 @@
298
316
  {
299
317
  "id": "req-protect",
300
318
  "type": "requirement",
301
- "label": "Protected at rest and in transit",
319
+ "label": "Protected in transit and by role",
302
320
  "x": 260,
303
321
  "y": 910,
304
322
  "ears_type": "ubiquitous",
305
- "action": "encrypt personal data in transit with TLS 1.2 or later and at rest with AES-256, give staff access to it only through roles that need it, and review those roles every 6 months",
323
+ "action": "accept connections carrying personal data only with TLS 1.2 or later, encrypt it at rest with the keys decided in the Encryption pack, give staff access to it only through roles that need it, and review those roles every 6 months",
306
324
  "rationale": "Security of processing (GDPR Art. 32(1)(a), (b)) and integrity and confidentiality (Art. 5(1)(f)); encryption also decides whether a breach must be told to the people affected (Art. 34(3)(a)).",
307
325
  "hubWhen": {
308
326
  "PERSONAL": [
@@ -313,13 +331,59 @@
313
331
  {
314
332
  "id": "req-breach",
315
333
  "type": "requirement",
316
- "label": "Breaches reported in time",
334
+ "label": "Breaches notified in time",
317
335
  "x": 260,
318
336
  "y": 1040,
319
337
  "ears_type": "event-driven",
320
- "trigger": "a breach of personal data is detected",
321
- "action": "notify the supervisory authority within 72 hours of becoming aware of it, unless it is unlikely to result in a risk to people, tell the people affected without undue delay when the risk is high, and record every breach in the breach register",
322
- "rationale": "GDPR Art. 33(1) sets 72 hours for the notification, Art. 34 the duty to tell the people affected, Art. 33(5) the register of all breaches.",
338
+ "trigger": "the organisation becomes aware of a breach of personal data",
339
+ "action": "assess whether it is unlikely to result in a risk to people and, unless it is, notify the supervisory authority named in the breach runbook without undue delay and within 72 hours of becoming aware of it, or with the reasons for the delay when that is not feasible, describing the nature of the breach with the categories and approximate numbers of people and records, the data protection officer's contact, the likely consequences and the measures taken or proposed, and sending what is not yet known in later phases",
340
+ "rationale": "GDPR Art. 33(1) sets the deadline, its exception for a breach unlikely to result in a risk, and the reasons a later notification must carry; Art. 33(3) the content; Art. 33(4) allows the content in phases without undue further delay.",
341
+ "hubWhen": {
342
+ "PERSONAL": [
343
+ "yes"
344
+ ]
345
+ }
346
+ },
347
+ {
348
+ "id": "req-breach-register",
349
+ "type": "requirement",
350
+ "label": "Every breach documented",
351
+ "x": 260,
352
+ "y": 1170,
353
+ "ears_type": "ubiquitous",
354
+ "action": "document every breach of personal data in the breach register, notified or not, with the time of becoming aware of it, the facts, the effects, the remedial action, the risk assessment and the decision on notifying with its reason, and reconcile the register with the security incidents at least every 3 months",
355
+ "rationale": "GDPR Art. 33(5): the controller documents any breach, with its facts, effects and remedial action, so that the supervisory authority can verify compliance with Art. 33; a breach that was not notified is the one whose reasoning it will ask for.",
356
+ "hubWhen": {
357
+ "PERSONAL": [
358
+ "yes"
359
+ ]
360
+ }
361
+ },
362
+ {
363
+ "id": "req-breach-people",
364
+ "type": "requirement",
365
+ "label": "People told of a high-risk breach",
366
+ "x": 260,
367
+ "y": 1300,
368
+ "ears_type": "event-driven",
369
+ "trigger": "a breach of personal data is assessed as likely to result in a high risk to people",
370
+ "action": "tell the people affected without undue delay, in clear and plain language, the nature of the breach, the data protection officer's contact, the likely consequences and the measures taken or proposed, and record the time in the breach register, unless the register records the exception of GDPR Art. 34(3) that applies: the data was unintelligible to anyone not authorised, later measures make the high risk no longer likely, or telling each person would take disproportionate effort and a public notice is made instead",
371
+ "rationale": "GDPR Art. 34(1) and (2) require telling the people affected by a high-risk breach, with the content of Art. 33(3)(b) to (d); Art. 34(3) lists the three exceptions, and Art. 34(4) lets the authority require it later, so the exception relied on is written down.",
372
+ "hubWhen": {
373
+ "PERSONAL": [
374
+ "yes"
375
+ ]
376
+ }
377
+ },
378
+ {
379
+ "id": "req-breach-processor",
380
+ "type": "requirement",
381
+ "label": "Processors report breaches",
382
+ "x": 260,
383
+ "y": 1430,
384
+ "ears_type": "ubiquitous",
385
+ "action": "bind every processor in the processor register by contract to tell the controller of a breach of personal data within {{PROCESSOR_NOTICE_HOURS}} hours of becoming aware of it, with what it knows of the content of GDPR Art. 33(3), and record that time in the register",
386
+ "rationale": "A processor must notify the controller without undue delay after becoming aware of a breach (GDPR Art. 33(2)) and assist it with its own notifications (Art. 28(3)(f)); EDPB Guidelines 9/2022 hold the controller aware once its processor has told it, so a fixed time in the contract keeps most of the 72 hours for the controller.",
323
387
  "hubWhen": {
324
388
  "PERSONAL": [
325
389
  "yes"
@@ -331,7 +395,7 @@
331
395
  "type": "requirement",
332
396
  "label": "Kept in the EU/EEA",
333
397
  "x": 260,
334
- "y": 1170,
398
+ "y": 1560,
335
399
  "ears_type": "ubiquitous",
336
400
  "action": "store and process personal data only in EU/EEA regions, with backups, logs, support tools and every processor included",
337
401
  "rationale": "No transfer outside the EU/EEA, so none of the conditions of GDPR Chapter V (Art. 44-49) has to be met or proven.",
@@ -349,7 +413,7 @@
349
413
  "type": "requirement",
350
414
  "label": "Only to adequate countries",
351
415
  "x": 260,
352
- "y": 1300,
416
+ "y": 1690,
353
417
  "ears_type": "ubiquitous",
354
418
  "action": "transfer personal data outside the EU/EEA only to countries covered by an adequacy decision of the European Commission, and list every processor with its country in the processor register",
355
419
  "rationale": "A transfer on the basis of an adequacy decision needs no further authorisation (GDPR Art. 45(1)); the register is part of the record of processing (Art. 30(1)(e)).",
@@ -367,7 +431,7 @@
367
431
  "type": "requirement",
368
432
  "label": "Transfers under safeguards",
369
433
  "x": 260,
370
- "y": 1430,
434
+ "y": 1820,
371
435
  "ears_type": "event-driven",
372
436
  "trigger": "personal data is to be sent to a processor in a country outside the EU/EEA without an adequacy decision",
373
437
  "action": "sign the Commission's standard contractual clauses and complete a transfer impact assessment before the first transfer, record both in the processor register, and review the assessment every 12 months",
@@ -386,7 +450,7 @@
386
450
  "type": "requirement",
387
451
  "label": "Special categories guarded",
388
452
  "x": 260,
389
- "y": 1560,
453
+ "y": 1950,
390
454
  "ears_type": "ubiquitous",
391
455
  "action": "process special-category data only under an Art. 9(2) condition recorded per person, encrypt those fields at field level with keys only the services that need them can use, and log every read with the reader, the time and the purpose, keeping the log 12 months",
392
456
  "rationale": "Special categories may be processed only under an exception of GDPR Art. 9(2), most often explicit consent; field-level encryption and read logs are the appropriate measures of Art. 32 for data whose leak harms most.",
@@ -404,7 +468,7 @@
404
468
  "type": "requirement",
405
469
  "label": "Impact assessed first",
406
470
  "x": 260,
407
- "y": 1690,
471
+ "y": 2080,
408
472
  "ears_type": "event-driven",
409
473
  "trigger": "a change adds a new purpose, store or recipient for special-category data",
410
474
  "action": "complete and approve a data protection impact assessment, with the data protection officer's advice, before the change is deployed",
@@ -423,7 +487,7 @@
423
487
  "type": "requirement",
424
488
  "label": "Used only for its purpose",
425
489
  "x": 260,
426
- "y": 1820,
490
+ "y": 2210,
427
491
  "ears_type": "unwanted-behaviour",
428
492
  "unwanted_condition": "a service the record of processing does not list for a field's purpose tries to read it",
429
493
  "action": "refuse the read through the database role or API it uses, and log the attempt",
@@ -442,7 +506,7 @@
442
506
  "type": "requirement",
443
507
  "label": "Consent provable and revocable",
444
508
  "x": 260,
445
- "y": 1950,
509
+ "y": 2340,
446
510
  "ears_type": "event-driven",
447
511
  "trigger": "a person gives or withdraws consent for a purpose",
448
512
  "action": "record it with the purpose, the version of the wording shown, the time and the channel, and on withdrawal stop processing for that purpose within 24 hours, with withdrawing taking no more steps than giving",
@@ -461,7 +525,7 @@
461
525
  "type": "requirement",
462
526
  "label": "Objections honoured",
463
527
  "x": 260,
464
- "y": 2080,
528
+ "y": 2470,
465
529
  "ears_type": "event-driven",
466
530
  "trigger": "a person objects to processing based on legitimate interests",
467
531
  "action": "stop that processing for them within 7 days unless a documented compelling ground overrides it, and stop direct marketing at once without exception",
@@ -480,7 +544,7 @@
480
544
  "type": "requirement",
481
545
  "label": "No personal data kept",
482
546
  "x": 260,
483
- "y": 2210,
547
+ "y": 2600,
484
548
  "ears_type": "ubiquitous",
485
549
  "action": "keep no data that identifies a person, directly or with other data the organisation holds, in its stores, events or logs",
486
550
  "rationale": "Recorded as a requirement and scanned for, the absence of personal data is checked rather than assumed (GDPR Art. 4(1), Recital 26).",
@@ -528,7 +592,7 @@
528
592
  "y": 260,
529
593
  "given": "a verified person with an account, orders and support tickets",
530
594
  "when": "they ask for their data",
531
- "then": "within 30 days they receive one JSON file holding all of it, with purposes, recipients and retention periods",
595
+ "then": "within {{REQUEST_DAYS}} days they receive one JSON file holding all of it, with purposes, recipients and retention periods",
532
596
  "hubWhen": {
533
597
  "PERSONAL": [
534
598
  "yes"
@@ -543,7 +607,7 @@
543
607
  "y": 390,
544
608
  "given": "a person with an account, orders, log entries and a copy at a processor",
545
609
  "when": "their erasure request is accepted",
546
- "then": "within {{ERASE_DAYS}} days nothing identifies them in any store, log or export, the processor is told, invoices remain, and the person is told",
610
+ "then": "within {{REQUEST_DAYS}} days nothing identifies them in any store, log or export, the processor is told, invoices remain, and the person is told",
547
611
  "hubWhen": {
548
612
  "PERSONAL": [
549
613
  "yes"
@@ -608,12 +672,12 @@
608
672
  {
609
673
  "id": "sc-protect",
610
674
  "type": "scenario",
611
- "label": "Encrypted everywhere",
675
+ "label": "Guarded everywhere",
612
676
  "x": 520,
613
677
  "y": 910,
614
- "given": "the store, its replicas and backups",
615
- "when": "their encryption settings and the roles with read access are listed",
616
- "then": "all are encrypted with AES-256, connections refuse TLS below 1.2, and every role with access was reviewed in the last 6 months",
678
+ "given": "the store and the roles with read access to personal tables",
679
+ "when": "its connection settings and the role reviews are listed",
680
+ "then": "connections below TLS 1.2 are refused, and every role with access was reviewed in the last 6 months",
617
681
  "hubWhen": {
618
682
  "PERSONAL": [
619
683
  "yes"
@@ -623,12 +687,57 @@
623
687
  {
624
688
  "id": "sc-breach",
625
689
  "type": "scenario",
626
- "label": "Breach reported",
690
+ "label": "Breach notified in time",
627
691
  "x": 520,
628
692
  "y": 1040,
629
- "given": "a log export with e-mail addresses found on a public bucket",
630
- "when": "it is reported to the on-call team",
631
- "then": "the authority is notified within 72 hours and the breach is in the register with its facts, effects and remedy",
693
+ "given": "a log export with the e-mail addresses of 4,000 customers found on a public bucket at 09:00 on Monday and assessed as a risk to people",
694
+ "when": "the breach lead follows the runbook",
695
+ "then": "the authority is notified by 09:00 on Thursday with the nature, the numbers, the data protection officer's contact, the consequences and the measures, a missing fact follows in a later phase, and the register holds the times",
696
+ "hubWhen": {
697
+ "PERSONAL": [
698
+ "yes"
699
+ ]
700
+ }
701
+ },
702
+ {
703
+ "id": "sc-breach-register",
704
+ "type": "scenario",
705
+ "label": "Unnotified breach documented",
706
+ "x": 520,
707
+ "y": 1170,
708
+ "given": "an e-mail with one customer's order sent to the wrong customer and assessed as unlikely to result in a risk",
709
+ "when": "the register is checked",
710
+ "then": "it holds the breach with its facts, effects, remedy, the assessment and the reason it was not notified, and its last reconciliation is less than 3 months old",
711
+ "hubWhen": {
712
+ "PERSONAL": [
713
+ "yes"
714
+ ]
715
+ }
716
+ },
717
+ {
718
+ "id": "sc-breach-people",
719
+ "type": "scenario",
720
+ "label": "Customers told",
721
+ "x": 520,
722
+ "y": 1300,
723
+ "given": "a breach exposing customers' passwords hashed with a broken algorithm, assessed as high risk",
724
+ "when": "the assessment is made",
725
+ "then": "the affected customers are told by e-mail in plain language what happened, whom to contact, what may follow and what to do, and the register holds the time they were told",
726
+ "hubWhen": {
727
+ "PERSONAL": [
728
+ "yes"
729
+ ]
730
+ }
731
+ },
732
+ {
733
+ "id": "sc-breach-processor",
734
+ "type": "scenario",
735
+ "label": "Slow processor found",
736
+ "x": 520,
737
+ "y": 1430,
738
+ "given": "the processor register with a mail provider whose contract allows 72 hours to report a breach",
739
+ "when": "the breach readiness check runs",
740
+ "then": "it fails and names the mail provider, since its notice exceeds {{PROCESSOR_NOTICE_HOURS}} hours",
632
741
  "hubWhen": {
633
742
  "PERSONAL": [
634
743
  "yes"
@@ -640,7 +749,7 @@
640
749
  "type": "scenario",
641
750
  "label": "Nothing leaves the EU",
642
751
  "x": 520,
643
- "y": 1170,
752
+ "y": 1560,
644
753
  "given": "the deployment, its backups and every processor in the register",
645
754
  "when": "their regions and countries are listed",
646
755
  "then": "all are in the EU/EEA",
@@ -658,7 +767,7 @@
658
767
  "type": "scenario",
659
768
  "label": "Only adequate countries",
660
769
  "x": 520,
661
- "y": 1300,
770
+ "y": 1690,
662
771
  "given": "the processor register",
663
772
  "when": "it is checked against the Commission's adequacy list",
664
773
  "then": "every processor outside the EU/EEA is in a country on that list",
@@ -676,7 +785,7 @@
676
785
  "type": "scenario",
677
786
  "label": "Transfer safeguarded",
678
787
  "x": 520,
679
- "y": 1430,
788
+ "y": 1820,
680
789
  "given": "a new support tool hosted outside the EU/EEA and adequate countries",
681
790
  "when": "it is to receive customer data",
682
791
  "then": "no data is sent before its clauses and impact assessment are in the processor register",
@@ -694,7 +803,7 @@
694
803
  "type": "scenario",
695
804
  "label": "Health field guarded",
696
805
  "x": 520,
697
- "y": 1560,
806
+ "y": 1950,
698
807
  "given": "a record with a diagnosis",
699
808
  "when": "a service without the key and then a clinician's service read it",
700
809
  "then": "the first gets only ciphertext; the second reads it and the read is logged with reader, time and purpose",
@@ -712,7 +821,7 @@
712
821
  "type": "scenario",
713
822
  "label": "No DPIA, no deploy",
714
823
  "x": 520,
715
- "y": 1690,
824
+ "y": 2080,
716
825
  "given": "a change that sends health data to a new analytics store",
717
826
  "when": "it is to be deployed",
718
827
  "then": "the deployment waits until its DPIA is approved",
@@ -730,7 +839,7 @@
730
839
  "type": "scenario",
731
840
  "label": "Other purpose refused",
732
841
  "x": 520,
733
- "y": 1820,
842
+ "y": 2210,
734
843
  "given": "the marketing service, which the record does not list for order addresses",
735
844
  "when": "it queries the order addresses",
736
845
  "then": "the query is refused and logged",
@@ -748,7 +857,7 @@
748
857
  "type": "scenario",
749
858
  "label": "Consent withdrawn",
750
859
  "x": 520,
751
- "y": 1950,
860
+ "y": 2340,
752
861
  "given": "a person who consented to personalised offers with wording version 3",
753
862
  "when": "they withdraw it in one click",
754
863
  "then": "the record shows both events with version and channel, and no offer is personalised for them after 24 hours",
@@ -766,7 +875,7 @@
766
875
  "type": "scenario",
767
876
  "label": "Objection honoured",
768
877
  "x": 520,
769
- "y": 2080,
878
+ "y": 2470,
770
879
  "given": "a person included in usage analytics and marketing e-mails",
771
880
  "when": "they object",
772
881
  "then": "marketing stops at once and analytics excludes them within 7 days",
@@ -784,7 +893,7 @@
784
893
  "type": "scenario",
785
894
  "label": "Nothing personal stored",
786
895
  "x": 520,
787
- "y": 2210,
896
+ "y": 2600,
788
897
  "given": "the store's schema, a sample of its rows and a day of logs",
789
898
  "when": "they are scanned for personal data",
790
899
  "then": "nothing is found",
@@ -803,8 +912,8 @@
803
912
  "concern": "personal-data",
804
913
  "status": "accepted",
805
914
  "date": "",
806
- "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
807
- "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema (a column comment or a data-catalogue tag in OpenMetadata or DataHub). Lawful basis: {{BASIS}}. Location: {{REGION}}. Erasure is deletion: one erasure routine knows every store; it publishes a PersonErased event that each owning service handles by deleting the person's rows (ON DELETE CASCADE where the schema allows), replacing them with a tombstone where invoices must stay. Logs carry user ids rather than names or addresses and are kept no longer than {{ERASE_DAYS}} days in the log store (Loki or OpenSearch retention). Backups expire after {{BACKUP_DAYS}} days and a restore replays the erasure ledger before serving. Unused data is erased after {{RETENTION_MONTHS}} months by a daily job. Choose deletion over crypto-shredding when the copies are few and known and backups are short-lived.",
915
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
916
+ "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema (a column comment or a data-catalogue tag in OpenMetadata or DataHub). Lawful basis: {{BASIS}}. Location: {{REGION}}. Special categories: {{SPECIAL}}. Erasure is deletion: one erasure routine knows every store; it publishes a PersonErased event that each owning service handles by deleting the person's rows (ON DELETE CASCADE where the schema allows), replacing them with a tombstone where invoices must stay. Logs carry user ids rather than names or addresses and are kept no longer than {{REQUEST_DAYS}} days in the log store (Loki or OpenSearch retention), so that logs expire before any erasure deadline and need no editing. Backups expire after {{BACKUP_DAYS}} days and a restore replays the erasure ledger before serving. Unused data is erased after {{RETENTION_MONTHS}} months by a daily job. Choose deletion over crypto-shredding when the copies are few and known and backups are short-lived. A breach of personal data is assessed and notified as this decision says, whatever incident it arrives through: the breach lead named in docs/breaches/runbook.md decides, on the data protection officer's advice, whether it is unlikely to result in a risk to people; unless it is, the supervisory authority named in the runbook is notified without undue delay and within 72 hours of becoming aware of it, with the content of GDPR Art. 33(3), in phases when facts are still missing; the people affected are told without undue delay when the risk is high, unless an exception of Art. 34(3) applies; and every breach, notified or not, is documented in docs/breaches/register.json with its facts, effects, remedy and the reason for each decision. Every processor is bound by contract to tell the controller of a breach within {{PROCESSOR_NOTICE_HOURS}} hours, as processors.yaml records.",
808
917
  "consequences": "• Erasure is simple to understand and to prove: the rows are gone.\n• Every new store, cache or export must join the erasure routine, or it leaks the people erased.\n• Erased people live on in backups for up to {{BACKUP_DAYS}} days; the erasure ledger is what keeps them from coming back on a restore.\n• Records the business needs later (revenue per month) must be aggregated before the deletion.",
809
918
  "alternatives": "1. Anonymisation in place: keeps the history for statistics, but anonymisation must hold against re-identification.\n2. Crypto-shredding: reaches backups and streams at once, at the cost of a key per person and a key service on every read.\n3. Handling requests by hand: slow, error-prone and hard to prove.",
810
919
  "hubWhen": {
@@ -825,8 +934,8 @@
825
934
  "concern": "personal-data",
826
935
  "status": "accepted",
827
936
  "date": "",
828
- "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
829
- "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema (a column comment or a data-catalogue tag in OpenMetadata or DataHub). Lawful basis: {{BASIS}}. Location: {{REGION}}. Erasure is anonymisation in place: direct identifiers (name, e-mail, phone, address, IP, external ids) are overwritten with random values and no mapping is kept; quasi-identifiers are generalised (birth date to year, postcode to its first two characters) until every combination occurs at least 5 times, which a dbt test checks; free-text fields are cleared. Logs carry user ids only and are kept no longer than {{ERASE_DAYS}} days. Backups expire after {{BACKUP_DAYS}} days and a restore replays the erasure ledger before serving. Unused data is anonymised after {{RETENTION_MONTHS}} months by a daily job. Use ARX or sdcMicro to measure re-identification risk when the quasi-identifiers change. Choose anonymisation when orders, revenue or usage history must outlive the person.",
937
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
938
+ "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema (a column comment or a data-catalogue tag in OpenMetadata or DataHub). Lawful basis: {{BASIS}}. Location: {{REGION}}. Special categories: {{SPECIAL}}. Erasure is anonymisation in place: direct identifiers (name, e-mail, phone, address, IP, external ids) are overwritten with random values and no mapping is kept, the row keeps its internal id and an anonymised_at timestamp; quasi-identifiers are generalised (birth date to year, postcode to its first two characters) until every combination occurs at least 5 times, which a dbt test checks; free-text fields are cleared. Logs carry user ids only and are kept no longer than {{REQUEST_DAYS}} days, so that they expire before any erasure deadline and need no editing. Backups expire after {{BACKUP_DAYS}} days and a restore replays the erasure ledger before serving. Unused data is anonymised after {{RETENTION_MONTHS}} months by a daily job. Use ARX or sdcMicro to measure re-identification risk when the quasi-identifiers change. Choose anonymisation when orders, revenue or usage history must outlive the person. A breach of personal data is assessed and notified as this decision says, whatever incident it arrives through: the breach lead named in docs/breaches/runbook.md decides, on the data protection officer's advice, whether it is unlikely to result in a risk to people; unless it is, the supervisory authority named in the runbook is notified without undue delay and within 72 hours of becoming aware of it, with the content of GDPR Art. 33(3), in phases when facts are still missing; the people affected are told without undue delay when the risk is high, unless an exception of Art. 34(3) applies; and every breach, notified or not, is documented in docs/breaches/register.json with its facts, effects, remedy and the reason for each decision. Every processor is bound by contract to tell the controller of a breach within {{PROCESSOR_NOTICE_HOURS}} hours, as processors.yaml records.",
830
939
  "consequences": "• History stays usable for reporting and accounting without anyone in it.\n• Anonymisation that can be undone is pseudonymisation and still personal data: the k-anonymity check and the removal of free text are not optional.\n• Each new column must be classified as identifier, quasi-identifier or neither, or anonymisation misses it.\n• Backups still hold the original records until they expire after {{BACKUP_DAYS}} days.",
831
940
  "alternatives": "1. Deletion in every store: simplest to prove, loses the history.\n2. Crypto-shredding: reaches backups at once, but the records become unreadable rather than anonymous.\n3. Pseudonymisation with a kept key: reversible, so it erases nothing (GDPR Art. 4(5)).",
832
941
  "hubWhen": {
@@ -847,9 +956,9 @@
847
956
  "concern": "personal-data",
848
957
  "status": "accepted",
849
958
  "date": "",
850
- "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
851
- "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema. Lawful basis: {{BASIS}}. Location: {{REGION}}. Every personal field is encrypted in the application with a data key of its own per person (envelope encryption, AES-256-GCM), the data keys wrapped by a key in a key management service: AWS KMS, Google Cloud KMS or Azure Key Vault on that cloud, HashiCorp Vault (Transit) on premises or across clouds; libraries such as AWS Encryption SDK or Google Tink do the envelope work. Erasure destroys the person's data key within 24 hours, which makes their fields in every store, event, log and backup unreadable; key backups expire after {{BACKUP_DAYS}} days. Unused data is shredded the same way after {{RETENTION_MONTHS}} months. Searchable fields (e-mail for sign-in) are kept as keyed hashes (HMAC) next to the ciphertext.",
852
- "consequences": "• One key deletion erases a person everywhere, immutable backups and event streams included.\n• Every read of a personal field decrypts: a key cache and the key service's availability are on the hot path.\n• Searching, sorting and joining on encrypted fields is not possible; keyed hashes cover exact matches only.\n• A lost key store loses everyone's data: the key service needs its own backup and recovery, shorter-lived than {{BACKUP_DAYS}} days for destroyed keys.",
959
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
960
+ "decision": "Personal data is kept only in the stores and fields the record of processing names, each field classified in the schema. Lawful basis: {{BASIS}}. Location: {{REGION}}. Special categories: {{SPECIAL}}. Every personal field is encrypted in the application with a data key of its own per person (envelope encryption, AES-256-GCM), the data keys kept wrapped in a key table and wrapped by one key in a key management service: AWS KMS, Google Cloud KMS or Azure Key Vault on that cloud, HashiCorp Vault (Transit) on premises or across clouds; libraries such as AWS Encryption SDK or Google Tink do the envelope work. Erasure deletes the person's wrapped data key from the key table within 24 hours, which makes their fields in every store, event, log and backup unreadable; backups of the key table expire after {{BACKUP_DAYS}} days. Unused data is shredded the same way after {{RETENTION_MONTHS}} months. Searchable fields (e-mail for sign-in) are kept as keyed hashes (HMAC) next to the ciphertext. A breach of personal data is assessed and notified as this decision says, whatever incident it arrives through: the breach lead named in docs/breaches/runbook.md decides, on the data protection officer's advice, whether it is unlikely to result in a risk to people; unless it is, the supervisory authority named in the runbook is notified without undue delay and within 72 hours of becoming aware of it, with the content of GDPR Art. 33(3), in phases when facts are still missing; the people affected are told without undue delay when the risk is high, unless an exception of Art. 34(3) applies; and every breach, notified or not, is documented in docs/breaches/register.json with its facts, effects, remedy and the reason for each decision. Every processor is bound by contract to tell the controller of a breach within {{PROCESSOR_NOTICE_HOURS}} hours, as processors.yaml records.",
961
+ "consequences": "• One key deletion erases a person everywhere, immutable backups and event streams included.\n• Every read of a personal field decrypts: a key cache and the key service's availability are on the hot path.\n• Searching, sorting and joining on encrypted fields is not possible; keyed hashes cover exact matches only.\n• A lost key table loses everyone's data: it needs its own backup and recovery, and its backups must expire within {{BACKUP_DAYS}} days for the erasure to hold.",
853
962
  "alternatives": "1. Deletion in every store: no key service, but backups and streams keep the person until they expire.\n2. Anonymisation in place: keeps readable history, but must hold against re-identification.\n3. One key per store (transparent disk encryption): protects against stolen disks, erases no one.",
854
963
  "hubWhen": {
855
964
  "PERSONAL": [
@@ -860,17 +969,149 @@
860
969
  ]
861
970
  }
862
971
  },
972
+ {
973
+ "id": "adr-basis-contract",
974
+ "type": "adr",
975
+ "label": "Processed for the contract",
976
+ "x": 780,
977
+ "y": 390,
978
+ "concern": "personal-data",
979
+ "status": "accepted",
980
+ "date": "",
981
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
982
+ "decision": "Most personal data is processed because the person's contract or a legal obligation needs it (GDPR Art. 6(1)(b), (c)): accounts, orders, invoices, support. Purpose limitation is enforced by access: each field's purposes are in the record of processing, and only the services and roles listed for a purpose can read the field, by database role or API scope; an attempt from elsewhere is refused and logged. Marketing or analytics beyond the contract needs its own basis and its own entry in the record.",
983
+ "consequences": "• No consent to collect or prove, and no objection right for the core processing.\n• Every secondary use (marketing, profiling, analytics beyond the service) needs a separate basis and a review.\n• The record of processing becomes the access list: a new consumer of a field is a change to the record first.",
984
+ "alternatives": "1. Consent recorded per purpose: needed for the optional uses, too heavy for the core service.\n2. Legitimate interests: fits analytics and fraud prevention, with a balancing test to keep.",
985
+ "hubWhen": {
986
+ "PERSONAL": [
987
+ "yes"
988
+ ],
989
+ "BASIS": [
990
+ "contract"
991
+ ]
992
+ }
993
+ },
994
+ {
995
+ "id": "adr-basis-consent",
996
+ "type": "adr",
997
+ "label": "Processed on recorded consent",
998
+ "x": 780,
999
+ "y": 520,
1000
+ "concern": "personal-data",
1001
+ "status": "accepted",
1002
+ "date": "",
1003
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1004
+ "decision": "Most personal data is processed on consent (GDPR Art. 6(1)(a), Art. 7): a consent record per person and purpose holds the version of the wording shown, the time, the channel and the withdrawal, if any. Every processing job for a consented purpose reads the record first and skips people without a current consent; a withdrawal takes effect within 24 hours and is one step, offered wherever the consent was given. Wording versions are kept with the code so that any record can be shown with the text the person saw.",
1005
+ "consequences": "• The person decides, and the proof is in the record, which an auditor can read.\n• Data processing stops when consent is withdrawn: features that depend on it degrade, and the product has to cope.\n• Consent banners and records are work to build and keep current; a change of wording is a new version to record.\n• Consent given under pressure or bundled with the service is invalid: the processing then has no basis at all.",
1006
+ "alternatives": "1. Contract or legal obligation: no consent to collect, but only for what the service itself needs.\n2. Legitimate interests: no consent either, but a balancing test and the right to object.",
1007
+ "hubWhen": {
1008
+ "PERSONAL": [
1009
+ "yes"
1010
+ ],
1011
+ "BASIS": [
1012
+ "consent"
1013
+ ]
1014
+ }
1015
+ },
1016
+ {
1017
+ "id": "adr-basis-legitimate",
1018
+ "type": "adr",
1019
+ "label": "Processed on legitimate interests",
1020
+ "x": 780,
1021
+ "y": 650,
1022
+ "concern": "personal-data",
1023
+ "status": "accepted",
1024
+ "date": "",
1025
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1026
+ "decision": "Most personal data is processed on legitimate interests (GDPR Art. 6(1)(f)): fraud prevention, security, analytics of how the service is used. For each such purpose a balancing test (the interest, its necessity, the person's reasonable expectations and the safeguards) is written down in the record of processing and reviewed every 12 months. An objection stops the processing for that person within 7 days unless a documented compelling ground overrides it; direct marketing stops at once. An exclusion list is consulted by every job for these purposes.",
1027
+ "consequences": "• No consent to collect for processing people would expect anyway.\n• Each purpose carries a written balancing test to maintain, which a supervisory authority may ask for.\n• The right to object has to work: an exclusion list every job honours, and a way to object as easy as unsubscribing.\n• Marketing by e-mail still needs consent under ePrivacy rules in most countries: this basis does not cover it.",
1028
+ "alternatives": "1. Consent recorded per purpose: stronger for the person, weaker uptake and more to build.\n2. Contract or legal obligation: only for what the service itself needs.",
1029
+ "hubWhen": {
1030
+ "PERSONAL": [
1031
+ "yes"
1032
+ ],
1033
+ "BASIS": [
1034
+ "legitimate"
1035
+ ]
1036
+ }
1037
+ },
1038
+ {
1039
+ "id": "adr-region-eu",
1040
+ "type": "adr",
1041
+ "label": "Kept in the EU/EEA only",
1042
+ "x": 780,
1043
+ "y": 780,
1044
+ "concern": "personal-data",
1045
+ "status": "accepted",
1046
+ "date": "",
1047
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1048
+ "decision": "Personal data is stored and processed in EU/EEA regions only: the cloud provider's EU regions for stores, backups and logs, and processors (support, mail, analytics, monitoring) that process in the EU/EEA under contract. The processor register lists each with its country; the infrastructure code pins the regions, and a policy check refuses a provider or backup copy outside the allowed list.",
1049
+ "consequences": "• No transfer mechanism to maintain: Chapter V does not apply.\n• Some processors are ruled out, and follow-the-sun support from outside the EU has to work without personal data.\n• A new region or processor is a change to the register and the policy, not a quiet configuration edit.",
1050
+ "alternatives": "1. The EU/EEA and adequate countries: a wider choice of processors, with the adequacy list to follow.\n2. Any country under standard contractual clauses: the widest choice, with a transfer impact assessment per processor to own.",
1051
+ "hubWhen": {
1052
+ "PERSONAL": [
1053
+ "yes"
1054
+ ],
1055
+ "REGION": [
1056
+ "eu"
1057
+ ]
1058
+ }
1059
+ },
1060
+ {
1061
+ "id": "adr-region-adequate",
1062
+ "type": "adr",
1063
+ "label": "Kept in the EU/EEA and adequate countries",
1064
+ "x": 780,
1065
+ "y": 910,
1066
+ "concern": "personal-data",
1067
+ "status": "accepted",
1068
+ "date": "",
1069
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1070
+ "decision": "Personal data may be stored and processed in EU/EEA regions and transferred to processors in countries the European Commission has found adequate (GDPR Art. 45): the UK, Switzerland, Japan, Canada, the Republic of Korea and the others on the Commission's list, and the US only for processors certified under the Data Privacy Framework. The processor register lists each processor with its country and, for the US, its certification; a policy check in CI refuses any other.",
1071
+ "consequences": "• A wider choice of processors with no clauses to sign and no assessment to write.\n• The adequacy list changes (a decision can be withdrawn, as Schrems II did for Privacy Shield): someone owns keeping the list current and has a plan for a withdrawal.\n• US processors must stay certified: the certification is checked when the register is reviewed.",
1072
+ "alternatives": "1. The EU/EEA only: nothing to follow, fewer processors.\n2. Any country under standard contractual clauses: every processor allowed, at the cost of an assessment each.",
1073
+ "hubWhen": {
1074
+ "PERSONAL": [
1075
+ "yes"
1076
+ ],
1077
+ "REGION": [
1078
+ "adequate"
1079
+ ]
1080
+ }
1081
+ },
1082
+ {
1083
+ "id": "adr-region-any",
1084
+ "type": "adr",
1085
+ "label": "Transfers under standard contractual clauses",
1086
+ "x": 780,
1087
+ "y": 1040,
1088
+ "concern": "personal-data",
1089
+ "status": "accepted",
1090
+ "date": "",
1091
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1092
+ "decision": "Personal data may be transferred to processors in any country. Inside the EU/EEA and adequate countries nothing more is needed; for every other processor the Commission's standard contractual clauses (2021/914) are signed and a transfer impact assessment of the destination's law and the safeguards (encryption with keys held in the EU, pseudonymisation) is written before the first transfer and reviewed every 12 months. The processor register carries the dates of both, and a policy check in CI refuses a processor without them.",
1093
+ "consequences": "• Any processor can be used, including global support and analytics tools.\n• A transfer impact assessment per processor is legal work to own and to refresh yearly; a negative one blocks the processor.\n• Supplementary measures (keys in the EU) shape the architecture of what the processor may see.",
1094
+ "alternatives": "1. The EU/EEA and adequate countries: no assessments, fewer processors.\n2. The EU/EEA only: nothing to maintain, the fewest processors.",
1095
+ "hubWhen": {
1096
+ "PERSONAL": [
1097
+ "yes"
1098
+ ],
1099
+ "REGION": [
1100
+ "any"
1101
+ ]
1102
+ }
1103
+ },
863
1104
  {
864
1105
  "id": "adr-special",
865
1106
  "type": "adr",
866
1107
  "label": "Special categories encrypted and logged",
867
1108
  "x": 780,
868
- "y": 390,
1109
+ "y": 1170,
869
1110
  "concern": "personal-data",
870
1111
  "status": "accepted",
871
1112
  "date": "",
872
- "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)). Here the store keeps special-category data (GDPR Art. 9), whose leak harms most and whose processing is forbidden unless an exception applies.",
873
- "decision": "Special-category fields are kept in their own tables or documents, encrypted at field level (pgcrypto or application-side envelope encryption with keys in the key management service) with keys only the services named in the record of processing may use. Each person's Art. 9(2) condition, usually explicit consent, is recorded with its date. Every read of these fields is logged with reader, time and purpose (pgAudit for direct database access, the service's own audit log otherwise) and the log is kept 12 months. A data protection impact assessment is approved before any new purpose, store or recipient, and the change that brings one links it.",
1113
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)). Here the store keeps special-category data (GDPR Art. 9), whose leak harms most and whose processing is forbidden unless an exception applies.",
1114
+ "decision": "Special-category fields are kept in their own tables or documents, encrypted at field level (pgcrypto or application-side envelope encryption with keys in the key management service) with keys only the services named in the record of processing may use. Each person's Art. 9(2) condition, usually explicit consent, is recorded with its date. Every read of these fields is logged with reader, time and purpose (pgAudit object audit logging through the auditor role for direct database access, the service's own audit log otherwise) and the log is kept 12 months. A data protection impact assessment is approved before any new purpose, store or recipient, and the change that brings one links it in the record of processing.",
874
1115
  "consequences": "• A leak of the main tables or a backup does not expose the special categories.\n• Analytics on these fields needs its own approved purpose and key, which slows ad-hoc analysis on purpose.\n• Read logs grow with use and are themselves personal data with a 12-month retention.\n• The DPIA becomes a release gate for changes that touch these fields.",
875
1116
  "alternatives": "1. Treat them like other personal data: simpler, but falls short of Art. 9 and Art. 32 for the data whose leak harms most.\n2. A separate system for special categories only: the strongest separation, but a second system to run and integrate.",
876
1117
  "hubWhen": {
@@ -882,16 +1123,38 @@
882
1123
  ]
883
1124
  }
884
1125
  },
1126
+ {
1127
+ "id": "adr-no-special",
1128
+ "type": "adr",
1129
+ "label": "No special categories kept",
1130
+ "x": 780,
1131
+ "y": 1300,
1132
+ "concern": "personal-data",
1133
+ "status": "accepted",
1134
+ "date": "",
1135
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)).",
1136
+ "decision": "The store keeps no special-category data (GDPR Art. 9) and no criminal-record data (Art. 10): no health, genetic, biometric, ethnic, religious, political, trade-union or sex-life field, and none that lets one be inferred. A field that would hold one needs this decision superseded and a data protection impact assessment first; the classification check on every column is where it would show up.",
1137
+ "consequences": "• No field-level encryption, read logging or impact assessment to run here.\n• Free-text fields are the risk: a support note can hold a diagnosis, so the scan covers them.\n• The first special-category field is a decision and an assessment, not a migration.",
1138
+ "alternatives": "1. Special categories guarded: encryption, read logs and a DPIA, when such a field is needed.\n2. A separate system for special categories, keeping this store ordinary.",
1139
+ "hubWhen": {
1140
+ "PERSONAL": [
1141
+ "yes"
1142
+ ],
1143
+ "SPECIAL": [
1144
+ "no"
1145
+ ]
1146
+ }
1147
+ },
885
1148
  {
886
1149
  "id": "adr-no-personal",
887
1150
  "type": "adr",
888
1151
  "label": "No personal data kept",
889
1152
  "x": 780,
890
- "y": 520,
1153
+ "y": 1430,
891
1154
  "concern": "personal-data",
892
1155
  "status": "accepted",
893
1156
  "date": "",
894
- "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)). Here the store keeps no data about people.",
1157
+ "context": "This store keeps data, and some of it may be about people. The forces: data protection law (GDPR) limits why personal data may be processed, for how long it is kept and where it may go, and gives people the rights to get, take away and erase it, each within one month; copies multiply (replicas, backups, logs, exports, analytics, processors) and every one of them has to follow; health, biometric and other special categories carry a higher bar; a breach has to be assessed, and most often notified to the authority, within 72 hours of becoming aware of it, when the facts are still unclear; erasing must not break the records others still need (invoices, the audit trail); and the controller has to be able to prove all of it (accountability, Art. 5(2)). Here the store keeps no data about people.",
895
1158
  "decision": "The store keeps no data that identifies a person, directly or with other data the organisation holds; its events and logs carry none either (no user, device or session ids, no IP addresses). A scan with Microsoft Presidio of the schema, a sample of rows and a day of logs keeps it true. A feature that needs personal data needs this decision superseded first.",
896
1159
  "consequences": "• No retention, erasure, access or transfer obligations here.\n• Logs and analytics lose the user dimension: per-user debugging and funnels need a store that takes on the obligations.\n• A personal field added by accident fails the scan rather than staying unnoticed.",
897
1160
  "alternatives": "1. Keep personal data with limits, when a feature needs it: superseding this decision with the personal-data pack.\n2. Pseudonymous ids only: still personal data under GDPR Art. 4(5), so it would not lift the obligations.",
@@ -904,12 +1167,15 @@
904
1167
  {
905
1168
  "id": "ff-retention",
906
1169
  "type": "fitness-fn",
907
- "label": "Retention and erasure on time",
1170
+ "label": "Retention and requests on time",
908
1171
  "x": 1040,
909
1172
  "y": 0,
910
- "category": "operational",
911
- "threshold": "0 personal records unused for more than {{RETENTION_MONTHS}} months, and 0 erasure requests open for more than {{ERASE_DAYS}} days",
912
- "description": "A daily data test returns the records past retention and the erasure requests past their deadline; any row fails it and alerts the data owner.\n\nTool: dbt (a singular data test, run daily by the scheduler)\n\n```sql\n-- tests/personal_data_on_time.sql: every row returned is a failure\nselect 'past retention' as problem, cast(customer_id as text) as id\nfrom {{ ref('customers') }}\nwhere last_used_at < now() - interval '{{RETENTION_MONTHS}} months'\n and erased_at is null\n and legal_hold is not true\nunion all\nselect 'erasure overdue', cast(request_id as text)\nfrom {{ ref('erasure_requests') }}\nwhere completed_at is null\n and accepted_at < now() - interval '{{ERASE_DAYS}} days'\n```",
1173
+ "characteristic": "security",
1174
+ "scope": "atomic",
1175
+ "cadence": "triggered",
1176
+ "trigger": "nightly",
1177
+ "invocation": "automated",
1178
+ "description": "A daily data test returns the records past retention and its 7-day grace, and the access and erasure requests past their deadline; any row fails it and alerts the data owner.\n\nThreshold: 0 personal records unused for more than {{RETENTION_MONTHS}} months plus the 7-day grace, and 0 access or erasure requests open for more than {{REQUEST_DAYS}} days\n\nTool: dbt (a singular data test, run daily by the scheduler)\n\n```sql\n-- tests/personal_data_on_time.sql: every row returned is a failure\nselect 'past retention' as problem, cast(customer_id as text) as id\nfrom {{ ref('customers') }}\nwhere last_used_at < now() - interval '{{RETENTION_MONTHS}} months' - interval '7 days'\n and erased_at is null\n and legal_hold is not true\nunion all\nselect 'erasure overdue', cast(request_id as text)\nfrom {{ ref('erasure_requests') }}\nwhere completed_at is null\n and accepted_at < now() - interval '{{REQUEST_DAYS}} days'\nunion all\nselect 'access request overdue', cast(request_id as text)\nfrom {{ ref('access_requests') }}\nwhere delivered_at is null\n and verified_at < now() - interval '{{REQUEST_DAYS}} days'\n```",
913
1179
  "hubWhen": {
914
1180
  "PERSONAL": [
915
1181
  "yes"
@@ -919,12 +1185,15 @@
919
1185
  {
920
1186
  "id": "ff-record",
921
1187
  "type": "fitness-fn",
922
- "label": "Every field classified",
1188
+ "label": "Every field classified and recorded",
923
1189
  "x": 1040,
924
1190
  "y": 130,
925
- "category": "structural",
926
- "threshold": "0 columns in the migrated schema without a classification (personal or not-personal) in their comment",
927
- "description": "In CI, after the migrations run against an empty database, a query lists the columns without a classification; a new column fails the build until it is classified, and a personal one until the record of processing names it.\n\nTool: psql in the CI pipeline, against the migrated schema\n\n```sql\n-- fails the build when it returns a row\nselect c.table_name, c.column_name\nfrom information_schema.columns c\njoin pg_class t on t.relname = c.table_name\njoin pg_namespace n on n.oid = t.relnamespace and n.nspname = c.table_schema\nleft join pg_description d on d.objoid = t.oid and d.objsubid = c.ordinal_position\nwhere c.table_schema = 'public'\n and coalesce(d.description, '') !~ '^(personal|not-personal)( |:|$)';\n```",
1191
+ "characteristic": "security",
1192
+ "scope": "atomic",
1193
+ "cadence": "triggered",
1194
+ "trigger": "pull-request",
1195
+ "invocation": "automated",
1196
+ "description": "In CI, after the migrations run against an empty database, a script lists the columns without a classification and checks every personal or special column against docs/record-of-processing.json; a new column fails the build until it is classified, and a personal one until the record names it with all five facts.\n\nThreshold: 0 columns in the migrated schema without a classification (personal, special or not-personal) in their comment; 0 personal or special columns absent from the record of processing or without purpose, basis, retention, recipients and location there\n\nTool: psql and jq in the CI pipeline, against the migrated schema\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nunclassified=$(psql \"$DATABASE_URL\" -Atc \"\n select c.table_name || '.' || c.column_name\n from information_schema.columns c\n join pg_class t on t.relname = c.table_name\n join pg_namespace n on n.oid = t.relnamespace and n.nspname = c.table_schema\n left join pg_description d on d.objoid = t.oid and d.objsubid = c.ordinal_position\n where c.table_schema = 'public'\n and coalesce(d.description, '') !~ '^(personal|special|not-personal)( |:|$)'\")\n[ -z \"$unclassified\" ] || { echo \"unclassified columns:\"; echo \"$unclassified\"; exit 1; }\nmissing=0\nfor col in $(psql \"$DATABASE_URL\" -Atc \"\n select c.table_name || '.' || c.column_name\n from information_schema.columns c\n join pg_class t on t.relname = c.table_name\n join pg_namespace n on n.oid = t.relnamespace and n.nspname = c.table_schema\n join pg_description d on d.objoid = t.oid and d.objsubid = c.ordinal_position\n where c.table_schema = 'public' and d.description ~ '^(personal|special)( |:|$)'\"); do\n jq -e --arg c \"$col\" '.fields[] | select(.column == $c) | .purpose and .basis and .retention and .recipients and .location' \\\n docs/record-of-processing.json > /dev/null || { echo \"$col is not in the record of processing with all five facts\"; missing=$((missing+1)); }\ndone\nexit $missing\n```",
928
1197
  "hubWhen": {
929
1198
  "PERSONAL": [
930
1199
  "yes"
@@ -937,9 +1206,12 @@
937
1206
  "label": "Personal data where declared",
938
1207
  "x": 1040,
939
1208
  "y": 260,
940
- "category": "structural",
941
- "threshold": "0 personal data findings with a score of 0.6 or more in a day of logs and a sample of rows outside the fields classified as personal",
942
- "description": "A nightly job exports a day of logs and a sample of rows from the fields not classified as personal and scans them for e-mail addresses, phone numbers, IP addresses, card numbers, IBANs and names; it reports the place and kind of each finding, never the value.\n\nTool: Microsoft Presidio (presidio-analyzer)\n\n```python\n# scan.py <file>: exits 1 when the file holds personal data\nimport sys\nfrom presidio_analyzer import AnalyzerEngine\n\nENTITIES = [\"EMAIL_ADDRESS\", \"PHONE_NUMBER\", \"IP_ADDRESS\", \"CREDIT_CARD\", \"IBAN_CODE\", \"PERSON\"]\nanalyzer = AnalyzerEngine()\nfound = 0\nwith open(sys.argv[1], encoding=\"utf-8\") as f:\n for n, line in enumerate(f, 1):\n for r in analyzer.analyze(text=line, entities=ENTITIES, language=\"en\", score_threshold=0.6):\n print(f\"{sys.argv[1]}:{n}: {r.entity_type}\") # never print the value\n found += 1\nsys.exit(1 if found else 0)\n```"
1209
+ "characteristic": "security",
1210
+ "scope": "holistic",
1211
+ "cadence": "triggered",
1212
+ "trigger": "nightly",
1213
+ "invocation": "automated",
1214
+ "description": "A nightly job exports a day of logs and a sample of rows from the fields not classified as personal and scans them for e-mail addresses, phone numbers, IP addresses, card numbers and IBANs; it reports the place and kind of each finding, never the value. Names (PERSON) are left out of the free-text scan because the recogniser flags product and place names at this threshold; they are scanned only in structured fields.\n\nThreshold: 0 e-mail addresses, phone numbers, IP addresses, card numbers or IBANs with a score of 0.6 or more in a day of logs and a sample of rows outside the fields classified as personal\n\nTool: Microsoft Presidio (presidio-analyzer)\n\n```python\n# scan.py <file>: exits 1 when the file holds personal data\nimport sys\nfrom presidio_analyzer import AnalyzerEngine\n\nENTITIES = [\"EMAIL_ADDRESS\", \"PHONE_NUMBER\", \"IP_ADDRESS\", \"CREDIT_CARD\", \"IBAN_CODE\"]\nanalyzer = AnalyzerEngine()\nfound = 0\nwith open(sys.argv[1], encoding=\"utf-8\") as f:\n for n, line in enumerate(f, 1):\n for r in analyzer.analyze(text=line, entities=ENTITIES, language=\"en\", score_threshold=0.6):\n print(f\"{sys.argv[1]}:{n}: {r.entity_type}\") # never print the value\n found += 1\nsys.exit(1 if found else 0)\n```"
943
1215
  },
944
1216
  {
945
1217
  "id": "ff-erasure",
@@ -947,9 +1219,12 @@
947
1219
  "label": "Erasure reaches every store",
948
1220
  "x": 1040,
949
1221
  "y": 390,
950
- "category": "structural",
951
- "threshold": "0 occurrences of an erased person's identifiers in any store after the erasure routine, and 0 after a restore of an older backup",
952
- "description": "An integration test seeds one person with a unique e-mail across every store the record of processing names, runs the erasure routine, and searches each store for the e-mail and the person's id; it then restores a backup taken before the erasure and searches again after the ledger replay.\n\nTool: Vitest with Testcontainers (PostgreSQL and the other stores of the deployment)\n\n```ts\nit('erases a person from every store, and keeps them erased after a restore', async () => {\n const email = `erase-${crypto.randomUUID()}@example.test`\n const person = await seedEverywhere({ email }) // account, orders, tickets, search index\n const backup = await takeBackup()\n await erasure.run(person.id)\n for (const store of stores) expect(await store.find(email, person.id)).toEqual([])\n await restore(backup) // replays the erasure ledger before serving\n for (const store of stores) expect(await store.find(email, person.id)).toEqual([])\n})\n```",
1222
+ "characteristic": "functional-suitability",
1223
+ "scope": "atomic",
1224
+ "cadence": "triggered",
1225
+ "trigger": "pull-request",
1226
+ "invocation": "automated",
1227
+ "description": "An integration test seeds one person with unique identifiers across every store the record of processing names, runs the erasure routine, searches each store by the identifiers and reads the row by its internal id (gone under deletion; present with every identifier overwritten under anonymisation, so identifiersOf returns [] in both cases); it then restores a backup taken before the erasure and checks again after the ledger replay.\n\nThreshold: 0 stores where an erased person's identifiers (e-mail, name, phone) are found after the erasure routine, 0 identifiers left on the person's row by id, and 0 after a restore of an older backup\n\nTool: Vitest with Testcontainers (PostgreSQL and the other stores of the deployment)\n\n```ts\nimport { erasure } from '../src/privacy/erasure'\nimport { stores } from './privacy/stores' // every store of the record of processing: findByIdentifiers, identifiersOf\nimport { seedEverywhere, takeBackup, restore } from './privacy/fixtures'\n\nit('erases a person from every store, and keeps them erased after a restore', async () => {\n const email = `erase-${crypto.randomUUID()}@example.test`\n const person = await seedEverywhere({ email, name: `Erase ${crypto.randomUUID()}`, phone: '+48600000000' })\n const backup = await takeBackup()\n await erasure.run(person.id)\n for (const store of stores) {\n expect(await store.findByIdentifiers(person)).toEqual([]) // by e-mail, name and phone\n expect(await store.identifiersOf(person.id)).toEqual([]) // row gone, or kept with no identifier left\n }\n await restore(backup) // replays the erasure ledger before serving\n for (const store of stores) {\n expect(await store.findByIdentifiers(person)).toEqual([])\n expect(await store.identifiersOf(person.id)).toEqual([])\n }\n})\n```",
953
1228
  "hubWhen": {
954
1229
  "PERSONAL": [
955
1230
  "yes"
@@ -966,9 +1241,12 @@
966
1241
  "label": "Anonymised records not singled out",
967
1242
  "x": 1040,
968
1243
  "y": 520,
969
- "category": "operational",
970
- "threshold": "Every combination of quasi-identifiers among anonymised records occurs in at least 5 records (k ≥ 5)",
971
- "description": "A daily data test groups the anonymised records by their quasi-identifiers and returns every group smaller than 5.\n\nTool: dbt (a singular data test)\n\n```sql\n-- tests/anonymised_k5.sql: every row returned is a group that singles people out\nselect birth_year, postcode_prefix, gender, count(*) as k\nfrom {{ ref('customers') }}\nwhere anonymised_at is not null\ngroup by birth_year, postcode_prefix, gender\nhaving count(*) < 5\n```",
1244
+ "characteristic": "security",
1245
+ "scope": "atomic",
1246
+ "cadence": "triggered",
1247
+ "trigger": "nightly",
1248
+ "invocation": "automated",
1249
+ "description": "A daily data test groups the anonymised records by their quasi-identifiers and returns every group smaller than 5, and every anonymised row whose free text was not cleared.\n\nThreshold: Every combination of quasi-identifiers among anonymised records occurs in at least 5 records (k ≥ 5); 0 anonymised rows with a non-empty free-text field\n\nTool: dbt (a singular data test)\n\n```sql\n-- tests/anonymised_k5.sql: every row returned singles people out\nselect 'group of ' || count(*) as problem, birth_year || ' ' || postcode_prefix || ' ' || gender as who\nfrom {{ ref('customers') }}\nwhere anonymised_at is not null\ngroup by birth_year, postcode_prefix, gender\nhaving count(*) < 5\nunion all\nselect 'free text kept', cast(customer_id as text)\nfrom {{ ref('customers') }}\nwhere anonymised_at is not null\n and coalesce(notes, '') <> ''\n```",
972
1250
  "hubWhen": {
973
1251
  "PERSONAL": [
974
1252
  "yes"
@@ -984,9 +1262,12 @@
984
1262
  "label": "Shredded data unreadable",
985
1263
  "x": 1040,
986
1264
  "y": 650,
987
- "category": "structural",
988
- "threshold": "After an erasure, 0 of the person's encrypted fields decrypt in the store, the event stream or a backup, and their key is scheduled for deletion within 24 hours",
989
- "description": "An integration test against a local KMS writes a person's fields, copies the ciphertext as a backup would, erases the person and expects the key to be pending deletion and every decryption to fail.\n\nTool: Vitest with LocalStack (AWS KMS) or a Vault dev server\n\n```ts\nit('makes every copy of an erased person unreadable', async () => {\n const person = await createPerson({ email: 'shred@example.test' })\n const copies = [await store.rawFields(person.id), await events.rawFields(person.id)] // ciphertext, as backups hold it\n await erasure.run(person.id)\n const key = await kms.send(new DescribeKeyCommand({ KeyId: person.keyId }))\n expect(key.KeyMetadata?.KeyState).toBe('PendingDeletion')\n for (const fields of copies) await expect(decryptFields(fields)).rejects.toThrow()\n})\n```",
1265
+ "characteristic": "security",
1266
+ "scope": "atomic",
1267
+ "cadence": "triggered",
1268
+ "trigger": "pull-request",
1269
+ "invocation": "automated",
1270
+ "description": "An integration test writes a person's fields through the envelope layer, copies the ciphertext as a backup would, erases the person, and expects the key table to hold no data key for them, the key table's backup retention to be at most {{BACKUP_DAYS}} days, and every decryption of the copies to fail; the wrapping key in the key service stays, since it wraps everyone's data keys.\n\nThreshold: After an erasure, the person's wrapped data key is gone from the key table, its backup copies expire within {{BACKUP_DAYS}} days, and 0 of the person's encrypted fields decrypt in the store, the event stream or a copy taken before\n\nTool: Vitest with LocalStack (AWS KMS) or a Vault dev server behind the application's envelope layer\n\n```ts\nimport { envelope } from '../src/crypto/envelope' // encryptFor(personId, fields), decryptFields(ciphertext)\nimport { dataKeys } from '../src/crypto/dataKeys' // the key table: wrapped data key per person, with its backup retention\nimport { erasure } from '../src/privacy/erasure'\nimport { store, events, createPerson } from './privacy/fixtures'\n\nit('makes every copy of an erased person unreadable', async () => {\n const person = await createPerson({ email: 'shred@example.test' })\n const copies = [await store.rawFields(person.id), await events.rawFields(person.id)] // ciphertext, as backups hold it\n expect(await dataKeys.find(person.id)).toBeDefined()\n await erasure.run(person.id)\n expect(await dataKeys.find(person.id)).toBeUndefined()\n expect(dataKeys.backupRetentionDays).toBeLessThanOrEqual({{BACKUP_DAYS}})\n envelope.dropCachedKeys()\n for (const fields of copies) await expect(envelope.decryptFields(fields)).rejects.toThrow()\n})\n```",
990
1271
  "hubWhen": {
991
1272
  "PERSONAL": [
992
1273
  "yes"
@@ -996,15 +1277,72 @@
996
1277
  ]
997
1278
  }
998
1279
  },
1280
+ {
1281
+ "id": "ff-protect",
1282
+ "type": "fitness-fn",
1283
+ "label": "TLS floor and reviewed roles",
1284
+ "x": 1040,
1285
+ "y": 780,
1286
+ "characteristic": "security",
1287
+ "scope": "atomic",
1288
+ "cadence": "triggered",
1289
+ "trigger": "pull-request",
1290
+ "invocation": "automated",
1291
+ "description": "A database test run in CI against the migrated database checks the server's minimum TLS version, and joins the roles with SELECT on personal tables (the ones with a column commented personal or special) with the role_reviews table the access owner fills in; any role not reviewed in 6 months fails it.\n\nThreshold: The database refuses TLS below 1.2 (ssl_min_protocol_version TLSv1.2 or higher); 0 roles with SELECT on a table holding personal data whose last review is older than 6 months\n\nTool: pgTAP (run with pg_prove); for a managed database the TLS floor is a parameter-group check with the provider's CLI\n\n```sql\nBEGIN;\nSELECT plan(2);\n\nSELECT ok(current_setting('ssl_min_protocol_version') IN ('TLSv1.2', 'TLSv1.3'), 'connections below TLS 1.2 are refused');\n\nSELECT is_empty($$\n SELECT DISTINCT g.grantee\n FROM information_schema.role_table_grants g\n JOIN information_schema.columns c ON c.table_schema = g.table_schema AND c.table_name = g.table_name\n JOIN pg_class t ON t.relname = c.table_name\n JOIN pg_namespace n ON n.oid = t.relnamespace AND n.nspname = c.table_schema\n JOIN pg_description d ON d.objoid = t.oid AND d.objsubid = c.ordinal_position\n LEFT JOIN role_reviews r ON r.role_name = g.grantee\n WHERE g.privilege_type = 'SELECT'\n AND d.description ~ '^(personal|special)( |:|$)'\n AND (r.reviewed_at IS NULL OR r.reviewed_at < now() - interval '6 months')\n$$, 'every role reading personal data was reviewed in the last 6 months');\n\nSELECT * FROM finish();\nROLLBACK;\n```",
1292
+ "hubWhen": {
1293
+ "PERSONAL": [
1294
+ "yes"
1295
+ ]
1296
+ }
1297
+ },
1298
+ {
1299
+ "id": "ff-breach-register",
1300
+ "type": "fitness-fn",
1301
+ "label": "Every breach documented and notified in time",
1302
+ "x": 1040,
1303
+ "y": 910,
1304
+ "characteristic": "security",
1305
+ "scope": "atomic",
1306
+ "cadence": "triggered",
1307
+ "trigger": "nightly",
1308
+ "invocation": "automated",
1309
+ "description": "A daily CI job reads docs/breaches/register.json, the breach register kept in the repository (categories and numbers, never the people's data): reconciled_at, and per breach id, aware_at, facts, effects, remedy, risk (unlikely, risk or high), not_notified_reason, notifications (one entry per phase: at, nature, dpo_contact, consequences, measures), delay_reason, people_told_at and art34_exception; times are in UTC (2026-09-07T09:00:00Z). When the breaches are kept as incidents in the incident tool the Incident management pack decides, the job first exports them to this shape. It fails on any gap and prints the breach ids, never their contents.\n\nThreshold: 0 breaches in the register without an awareness time, facts, effects, remedy and a risk assessment; 0 assessed unlikely without the reason not to notify; 0 others not notified 72 hours after awareness, or first notified later without the reasons for the delay, or whose notification phases together lack the nature, the data protection officer's contact, the consequences or the measures; 0 high-risk ones without the time people were told or an Art. 34(3) exception; the last reconciliation with the security incidents at most 92 days old\n\nTool: jq 1.7 in a daily CI job (bash)\n\n```bash\n#!/usr/bin/env bash\n# daily CI: docs/breaches/register.json documents every breach and its notification (GDPR Art. 33, 34); times in UTC\nset -euo pipefail\nproblems=$(jq -r --argjson now \"$(date -u +%s)\" '\n def t: (. // \"1970-01-01T00:00:00Z\") | sub(\"\\\\.[0-9]+\"; \"\") | fromdateiso8601;\n def text(k): (.[k] // \"\" | tostring | length) > 0;\n (select($now - (.reconciled_at | t) > 92 * 86400) | \"not reconciled with the security incidents for 92 days\"),\n (.breaches[] | .id as $id | (.notifications // []) as $n |\n ([\"aware_at\", \"facts\", \"effects\", \"remedy\"][] as $k | select(text($k) | not) | \"\\($id): no \\($k)\"),\n (select(.risk | IN(\"unlikely\", \"risk\", \"high\") | not) | \"\\($id): risk is not assessed as unlikely, risk or high\"),\n (select(.risk == \"unlikely\" and (text(\"not_notified_reason\") | not)) | \"\\($id): not notified, and no reason\"),\n (select((.risk == \"risk\" or .risk == \"high\") and ($n | length) == 0 and $now - (.aware_at | t) > 72 * 3600) | \"\\($id): not notified 72 hours after awareness\"),\n (select(($n | length) > 0 and ($n[0].at | t) - (.aware_at | t) > 72 * 3600 and (text(\"delay_reason\") | not)) | \"\\($id): notified after 72 hours without the reasons for the delay\"),\n (select(($n | length) > 0) | [\"nature\", \"dpo_contact\", \"consequences\", \"measures\"][] as $k | select([$n[] | has($k)] | any | not) | \"\\($id): no phase of the notification gives \\($k)\"),\n (select(.risk == \"high\" and (text(\"people_told_at\") or text(\"art34_exception\") | not)) | \"\\($id): high risk, people not told and no Art. 34(3) exception\")\n )' docs/breaches/register.json)\n[ -z \"$problems\" ] || { echo \"$problems\"; exit 1; }\n```",
1310
+ "hubWhen": {
1311
+ "PERSONAL": [
1312
+ "yes"
1313
+ ]
1314
+ }
1315
+ },
1316
+ {
1317
+ "id": "ff-breach-runbook",
1318
+ "type": "fitness-fn",
1319
+ "label": "Breach runbook and processor notice ready",
1320
+ "x": 1040,
1321
+ "y": 1040,
1322
+ "characteristic": "security",
1323
+ "scope": "atomic",
1324
+ "cadence": "triggered",
1325
+ "trigger": "pull-request",
1326
+ "invocation": "automated",
1327
+ "description": "A CI step on every change fails when the breach runbook stops naming the supervisory authority with its notification link, the person who decides whether to notify, the 72 hours or any of the four parts of the notification of GDPR Art. 33(3), or when a processor in processors.yaml, the processor register, has no breach_notice_hours from its contract or a longer one than allowed.\n\nThreshold: docs/breaches/runbook.md has the lines Supervisory authority: (with a link) and Decides:, and names the 72 hours, the nature of the breach, the data protection officer, the likely consequences and the measures; 0 processors in processors.yaml without breach_notice_hours or with more than {{PROCESSOR_NOTICE_HOURS}} hours\n\nTool: bash with grep and yq (mikefarah yq v4) in a CI step\n\n```bash\n#!/usr/bin/env bash\n# CI, on every change: the breach runbook says whom to notify, by when, with what and who decides; processors report in time\nset -euo pipefail\nf=docs/breaches/runbook.md\nproblems=0\nneed() { grep -Eqi \"$1\" \"$f\" || { echo \"$f: $2\"; problems=$((problems + 1)); }; }\nneed '^Supervisory authority: .*https://' 'no line \"Supervisory authority:\" with its name and notification link'\nneed '^Decides: +[^ ]' 'no line \"Decides:\" naming who decides whether to notify'\nneed '72 hours' 'does not say the authority is notified within 72 hours of becoming aware'\nneed 'nature of the breach' 'does not ask for the nature of the breach (categories and numbers of people and records)'\nneed 'data protection officer' 'does not give the contact of the data protection officer'\nneed 'likely consequences' 'does not ask for the likely consequences'\nneed 'measures' 'does not ask for the measures taken or proposed'\nlate=$(yq '.processors[] | select((.breach_notice_hours // 1000) > {{PROCESSOR_NOTICE_HOURS}}) | .name' processors.yaml)\n[ -z \"$late\" ] || { echo \"processors.yaml: no breach notice within {{PROCESSOR_NOTICE_HOURS}} hours: $late\"; problems=$((problems + 1)); }\nexit $problems\n```",
1328
+ "hubWhen": {
1329
+ "PERSONAL": [
1330
+ "yes"
1331
+ ]
1332
+ }
1333
+ },
999
1334
  {
1000
1335
  "id": "ff-region",
1001
1336
  "type": "fitness-fn",
1002
1337
  "label": "Deployed in EU regions",
1003
1338
  "x": 1040,
1004
- "y": 780,
1005
- "category": "structural",
1006
- "threshold": "0 providers, backup copies or processors outside EU/EEA regions in the infrastructure plan and the processor register",
1007
- "description": "In CI the Terraform plan (terraform show -json) is checked by a policy that fails on any provider or backup copy destination outside the allowed EU regions; the same run checks processors.yaml, the processor register.\n\nTool: Open Policy Agent (conftest)\n\n```rego\npackage main\nimport rego.v1\n\neu_regions := {\"eu-central-1\", \"eu-central-2\", \"eu-west-1\", \"eu-west-3\", \"eu-north-1\", \"eu-south-1\", \"eu-south-2\"}\n\ndeny contains msg if {\n some name, p in input.configuration.provider_config\n p.name == \"aws\"\n region := p.expressions.region.constant_value\n not region in eu_regions\n msg := sprintf(\"provider %s deploys to %s, outside the EU\", [name, region])\n}\n\ndeny contains msg if {\n some r in input.resource_changes\n r.type == \"aws_backup_plan\"\n some rule in r.change.after.rule\n some copy in rule.copy_action\n not regex.match(\"arn:aws:backup:eu-\", copy.destination_vault_arn)\n msg := sprintf(\"backup plan %s copies outside the EU\", [r.address])\n}\n```",
1339
+ "y": 1170,
1340
+ "characteristic": "security",
1341
+ "scope": "atomic",
1342
+ "cadence": "triggered",
1343
+ "trigger": "pull-request",
1344
+ "invocation": "automated",
1345
+ "description": "In CI the Terraform plan (terraform show -json) is checked by a policy that fails on any provider or backup copy destination outside the allowed EU regions (the region is read from the vault ARN, so eu-west-2, London, is refused); the same run checks processors.yaml, the processor register, against the EEA country list.\n\nThreshold: 0 providers, backup copies or processors outside EU/EEA regions in the infrastructure plan and the processor register\n\nTool: Conftest (on the Terraform plan and on processors.yaml)\n\n```rego\npackage main\n\nimport rego.v1\n\neu_regions := {\"eu-central-1\", \"eu-central-2\", \"eu-west-1\", \"eu-west-3\", \"eu-north-1\", \"eu-south-1\", \"eu-south-2\"}\neea := {\"AT\", \"BE\", \"BG\", \"HR\", \"CY\", \"CZ\", \"DK\", \"EE\", \"FI\", \"FR\", \"DE\", \"GR\", \"HU\", \"IE\", \"IT\", \"LV\", \"LT\", \"LU\", \"MT\", \"NL\", \"PL\", \"PT\", \"RO\", \"SK\", \"SI\", \"ES\", \"SE\", \"IS\", \"LI\", \"NO\"}\n\ndeny contains msg if {\n\tsome name, p in input.configuration.provider_config\n\tp.name == \"aws\"\n\tregion := p.expressions.region.constant_value\n\tnot region in eu_regions\n\tmsg := sprintf(\"provider %s deploys to %s, outside the EU\", [name, region])\n}\n\ndeny contains msg if {\n\tsome r in input.resource_changes\n\tr.type == \"aws_backup_plan\"\n\tsome rule in r.change.after.rule\n\tsome copy in rule.copy_action\n\tregion := split(copy.destination_vault_arn, \":\")[3]\n\tnot region in eu_regions\n\tmsg := sprintf(\"backup plan %s copies to %s, outside the EU\", [r.address, region])\n}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tnot p.country in eea\n\tmsg := sprintf(\"processor %s is in %s, outside the EU/EEA\", [p.name, p.country])\n}\n```",
1008
1346
  "hubWhen": {
1009
1347
  "PERSONAL": [
1010
1348
  "yes"
@@ -1019,10 +1357,13 @@
1019
1357
  "type": "fitness-fn",
1020
1358
  "label": "Processors in adequate countries",
1021
1359
  "x": 1040,
1022
- "y": 910,
1023
- "category": "process",
1024
- "threshold": "0 processors in the register outside the EU/EEA and the countries with an adequacy decision",
1025
- "description": "In CI a policy checks processors.yaml, the processor register kept in the repository, against the EU/EEA and the adequacy list; the list is updated when the Commission adopts or withdraws a decision.\n\nTool: Open Policy Agent (conftest)\n\n```rego\npackage main\nimport rego.v1\n\neea := {\"AT\",\"BE\",\"BG\",\"HR\",\"CY\",\"CZ\",\"DK\",\"EE\",\"FI\",\"FR\",\"DE\",\"GR\",\"HU\",\"IE\",\"IT\",\"LV\",\"LT\",\"LU\",\"MT\",\"NL\",\"PL\",\"PT\",\"RO\",\"SK\",\"SI\",\"ES\",\"SE\",\"IS\",\"LI\",\"NO\"}\n# Adequacy decisions (GDPR Art. 45); US only for companies certified under the Data Privacy Framework\nadequate := {\"AD\",\"AR\",\"CA\",\"FO\",\"GG\",\"IL\",\"IM\",\"JP\",\"JE\",\"NZ\",\"KR\",\"CH\",\"GB\",\"UY\",\"US\"}\n\ndeny contains msg if {\n some p in input.processors\n not p.country in eea\n not p.country in adequate\n msg := sprintf(\"processor %s is in %s, which has no adequacy decision\", [p.name, p.country])\n}\n\ndeny contains msg if {\n some p in input.processors\n p.country == \"US\"\n not p.dpf_certified\n msg := sprintf(\"processor %s is in the US but not certified under the Data Privacy Framework\", [p.name])\n}\n```",
1360
+ "y": 1300,
1361
+ "characteristic": "security",
1362
+ "scope": "atomic",
1363
+ "cadence": "triggered",
1364
+ "trigger": "pull-request",
1365
+ "invocation": "automated",
1366
+ "description": "In CI a policy checks processors.yaml, the processor register kept in the repository, against the EU/EEA and the adequacy list; the list is updated when the Commission adopts or withdraws a decision.\n\nThreshold: 0 processors in the register outside the EU/EEA and the countries with an adequacy decision; 0 US processors without Data Privacy Framework certification\n\nTool: Conftest (on processors.yaml)\n\n```rego\npackage main\n\nimport rego.v1\n\neea := {\"AT\", \"BE\", \"BG\", \"HR\", \"CY\", \"CZ\", \"DK\", \"EE\", \"FI\", \"FR\", \"DE\", \"GR\", \"HU\", \"IE\", \"IT\", \"LV\", \"LT\", \"LU\", \"MT\", \"NL\", \"PL\", \"PT\", \"RO\", \"SK\", \"SI\", \"ES\", \"SE\", \"IS\", \"LI\", \"NO\"}\n# Adequacy decisions (GDPR Art. 45); US only for companies certified under the Data Privacy Framework\nadequate := {\"AD\", \"AR\", \"CA\", \"FO\", \"GG\", \"IL\", \"IM\", \"JP\", \"JE\", \"NZ\", \"KR\", \"CH\", \"GB\", \"UY\", \"US\"}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tnot p.country in eea\n\tnot p.country in adequate\n\tmsg := sprintf(\"processor %s is in %s, which has no adequacy decision\", [p.name, p.country])\n}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tp.country == \"US\"\n\tnot p.dpf_certified\n\tmsg := sprintf(\"processor %s is in the US but not certified under the Data Privacy Framework\", [p.name])\n}\n```",
1026
1367
  "hubWhen": {
1027
1368
  "PERSONAL": [
1028
1369
  "yes"
@@ -1037,10 +1378,13 @@
1037
1378
  "type": "fitness-fn",
1038
1379
  "label": "Transfers have clauses and assessment",
1039
1380
  "x": 1040,
1040
- "y": 1040,
1041
- "category": "process",
1042
- "threshold": "0 processors outside the EU/EEA without signed standard contractual clauses and a transfer impact assessment reviewed in the last 12 months",
1043
- "description": "In CI a policy checks processors.yaml, the processor register: every processor outside the EU/EEA needs the date its clauses were signed and the date of its transfer impact assessment, not older than 12 months.\n\nTool: Open Policy Agent (conftest)\n\n```rego\npackage main\nimport rego.v1\n\neea := {\"AT\",\"BE\",\"BG\",\"HR\",\"CY\",\"CZ\",\"DK\",\"EE\",\"FI\",\"FR\",\"DE\",\"GR\",\"HU\",\"IE\",\"IT\",\"LV\",\"LT\",\"LU\",\"MT\",\"NL\",\"PL\",\"PT\",\"RO\",\"SK\",\"SI\",\"ES\",\"SE\",\"IS\",\"LI\",\"NO\"}\nyear_ns := 365 * 24 * 60 * 60 * 1000000000\n\ndeny contains msg if {\n some p in input.processors\n not p.country in eea\n not p.scc_signed\n msg := sprintf(\"processor %s in %s has no standard contractual clauses\", [p.name, p.country])\n}\n\ndeny contains msg if {\n some p in input.processors\n not p.country in eea\n time.now_ns() - time.parse_rfc3339_ns(sprintf(\"%sT00:00:00Z\", [p.tia_reviewed])) > year_ns\n msg := sprintf(\"processor %s: transfer impact assessment older than 12 months\", [p.name])\n}\n```",
1381
+ "y": 1430,
1382
+ "characteristic": "security",
1383
+ "scope": "atomic",
1384
+ "cadence": "triggered",
1385
+ "trigger": "pull-request",
1386
+ "invocation": "automated",
1387
+ "description": "In CI a policy checks processors.yaml, the processor register: every processor outside the EU/EEA and the adequate countries needs the date its clauses were signed and the date of its transfer impact assessment, not older than 12 months; a missing date fails as much as an old one.\n\nThreshold: 0 processors outside the EU/EEA and adequate countries without a signing date for the standard contractual clauses and a transfer impact assessment reviewed in the last 12 months\n\nTool: Conftest (on processors.yaml)\n\n```rego\npackage main\n\nimport rego.v1\n\neea := {\"AT\", \"BE\", \"BG\", \"HR\", \"CY\", \"CZ\", \"DK\", \"EE\", \"FI\", \"FR\", \"DE\", \"GR\", \"HU\", \"IE\", \"IT\", \"LV\", \"LT\", \"LU\", \"MT\", \"NL\", \"PL\", \"PT\", \"RO\", \"SK\", \"SI\", \"ES\", \"SE\", \"IS\", \"LI\", \"NO\"}\nadequate := {\"AD\", \"AR\", \"CA\", \"FO\", \"GG\", \"IL\", \"IM\", \"JP\", \"JE\", \"NZ\", \"KR\", \"CH\", \"GB\", \"UY\", \"US\"}\nyear_ns := 365 * 24 * 60 * 60 * 1000000000\n\nneeds_safeguards(p) if {\n\tnot p.country in eea\n\tnot p.country in adequate\n}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tneeds_safeguards(p)\n\tnot p.scc_signed\n\tmsg := sprintf(\"processor %s in %s has no standard contractual clauses\", [p.name, p.country])\n}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tneeds_safeguards(p)\n\tnot p.tia_reviewed\n\tmsg := sprintf(\"processor %s in %s has no transfer impact assessment\", [p.name, p.country])\n}\n\ndeny contains msg if {\n\tsome p in input.processors\n\tneeds_safeguards(p)\n\ttime.now_ns() - time.parse_rfc3339_ns(sprintf(\"%sT00:00:00Z\", [p.tia_reviewed])) > year_ns\n\tmsg := sprintf(\"processor %s: transfer impact assessment older than 12 months\", [p.name])\n}\n```",
1044
1388
  "hubWhen": {
1045
1389
  "PERSONAL": [
1046
1390
  "yes"
@@ -1053,12 +1397,15 @@
1053
1397
  {
1054
1398
  "id": "ff-special",
1055
1399
  "type": "fitness-fn",
1056
- "label": "Special fields encrypted",
1400
+ "label": "Special fields encrypted and read-logged",
1057
1401
  "x": 1040,
1058
- "y": 1170,
1059
- "category": "structural",
1060
- "threshold": "Every column classified as special category is stored as ciphertext (bytea), and 0 roles outside the record of processing may read it",
1061
- "description": "A database test run in CI after the migrations asserts that each special-category column holds ciphertext and that only the listed roles have SELECT on its table, and that pgAudit logs reads of it.\n\nTool: pgTAP (run with pg_prove)\n\n```sql\nBEGIN;\nSELECT plan(4);\nSELECT col_type_is('health', 'conditions', 'diagnosis', 'bytea', 'diagnosis is stored encrypted');\nSELECT table_privs_are('health', 'conditions', 'care_service', ARRAY['SELECT', 'INSERT', 'UPDATE']);\nSELECT table_privs_are('health', 'conditions', 'reporting', ARRAY[]::text[], 'reporting cannot read diagnoses');\nSELECT ok(current_setting('pgaudit.log') ~ 'read', 'pgAudit logs reads');\nSELECT * FROM finish();\nROLLBACK;\n```",
1402
+ "y": 1560,
1403
+ "characteristic": "security",
1404
+ "scope": "atomic",
1405
+ "cadence": "triggered",
1406
+ "trigger": "pull-request",
1407
+ "invocation": "automated",
1408
+ "description": "A database test run in CI after the migrations asserts that each special-category column holds ciphertext, that only the listed roles have SELECT on its table, that pgaudit.role names the auditor role, and that the auditor role holds SELECT on the table, which is what makes pgAudit log every read of it.\n\nThreshold: Every column classified as special category is stored as ciphertext (bytea), 0 roles outside the record of processing may read it, and pgAudit object logging through the auditor role covers its table\n\nTool: pgTAP (run with pg_prove) with the pgAudit extension\n\n```sql\nBEGIN;\nSELECT plan(5);\nSELECT col_type_is('health', 'conditions', 'diagnosis', 'bytea', 'diagnosis is stored encrypted');\nSELECT table_privs_are('health', 'conditions', 'care_service', ARRAY['SELECT', 'INSERT', 'UPDATE']);\nSELECT table_privs_are('health', 'conditions', 'reporting', ARRAY[]::text[], 'reporting cannot read diagnoses');\nSELECT is(current_setting('pgaudit.role', true), 'auditor', 'pgAudit object logging goes through the auditor role');\nSELECT table_privs_are('health', 'conditions', 'auditor', ARRAY['SELECT'], 'reads of diagnoses are logged');\nSELECT * FROM finish();\nROLLBACK;\n```",
1062
1409
  "hubWhen": {
1063
1410
  "PERSONAL": [
1064
1411
  "yes"
@@ -1067,6 +1414,90 @@
1067
1414
  "yes"
1068
1415
  ]
1069
1416
  }
1417
+ },
1418
+ {
1419
+ "id": "ff-dpia-gate",
1420
+ "type": "fitness-fn",
1421
+ "label": "No DPIA, no deploy",
1422
+ "x": 1040,
1423
+ "y": 1690,
1424
+ "characteristic": "security",
1425
+ "scope": "atomic",
1426
+ "cadence": "triggered",
1427
+ "trigger": "release",
1428
+ "invocation": "automated",
1429
+ "description": "A release gate reads docs/record-of-processing.json: every entry marked special must link a DPIA file under docs/dpia whose front matter says status: approved; the release stops on any that does not.\n\nThreshold: 0 purposes, stores or recipients of special-category data in the record of processing without an approved impact assessment linked\n\nTool: jq and grep in the release pipeline (bash)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nfailed=0\nfor entry in $(jq -r '.processing[] | select(.special == true) | \"\\(.purpose)|\\(.dpia // \"\")\"' docs/record-of-processing.json); do\n purpose=${entry%%|*}; dpia=${entry#*|}\n if [ -z \"$dpia\" ] || [ ! -f \"docs/dpia/$dpia\" ]; then echo \"$purpose: no DPIA linked\"; failed=1; continue; fi\n grep -q '^status: approved$' \"docs/dpia/$dpia\" || { echo \"$purpose: $dpia is not approved\"; failed=1; }\ndone\nexit $failed\n```",
1430
+ "hubWhen": {
1431
+ "PERSONAL": [
1432
+ "yes"
1433
+ ],
1434
+ "SPECIAL": [
1435
+ "yes"
1436
+ ]
1437
+ }
1438
+ },
1439
+ {
1440
+ "id": "ff-purpose-roles",
1441
+ "type": "fitness-fn",
1442
+ "label": "Purpose enforced by role",
1443
+ "x": 1040,
1444
+ "y": 1820,
1445
+ "characteristic": "security",
1446
+ "scope": "atomic",
1447
+ "cadence": "triggered",
1448
+ "trigger": "pull-request",
1449
+ "invocation": "automated",
1450
+ "description": "A database test run in CI after the migrations compares the SELECT grants on personal tables with the recipients of docs/record-of-processing.json, loaded into a temporary table by the pipeline, and fails on any grant the record does not explain.\n\nThreshold: Every service role has SELECT on a personal table only when the record of processing lists it for a purpose of that table; 0 grants beyond the record\n\nTool: pgTAP (run with pg_prove); the pipeline loads the record into record_recipients(table_name, role_name) first\n\n```sql\nBEGIN;\nSELECT plan(1);\n\nSELECT is_empty($$\n SELECT g.grantee, g.table_name\n FROM information_schema.role_table_grants g\n JOIN information_schema.columns c ON c.table_schema = g.table_schema AND c.table_name = g.table_name\n JOIN pg_class t ON t.relname = c.table_name\n JOIN pg_namespace n ON n.oid = t.relnamespace AND n.nspname = c.table_schema\n JOIN pg_description d ON d.objoid = t.oid AND d.objsubid = c.ordinal_position\n LEFT JOIN record_recipients r ON r.table_name = g.table_name AND r.role_name = g.grantee\n WHERE g.privilege_type = 'SELECT'\n AND d.description ~ '^(personal|special)( |:|$)'\n AND g.grantee NOT IN ('postgres', 'migrator')\n AND r.role_name IS NULL\n$$, 'no role reads personal data beyond the record of processing');\n\nSELECT * FROM finish();\nROLLBACK;\n```",
1451
+ "hubWhen": {
1452
+ "PERSONAL": [
1453
+ "yes"
1454
+ ],
1455
+ "BASIS": [
1456
+ "contract"
1457
+ ]
1458
+ }
1459
+ },
1460
+ {
1461
+ "id": "ff-consent",
1462
+ "type": "fitness-fn",
1463
+ "label": "Consent recorded and honoured",
1464
+ "x": 1040,
1465
+ "y": 1950,
1466
+ "characteristic": "functional-suitability",
1467
+ "scope": "atomic",
1468
+ "cadence": "triggered",
1469
+ "trigger": "pull-request",
1470
+ "invocation": "automated",
1471
+ "description": "An integration test gives consent for personalised offers as a person, withdraws it with one request, reads both records back, and runs the personalisation job to check that the person is skipped.\n\nThreshold: Giving and withdrawing consent each produce 1 record with purpose, wording version, time and channel; withdrawal takes 1 request; after it the purpose's job skips the person\n\nTool: Vitest with supertest\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { consents } from '../src/privacy/consents'\nimport { personalisation } from '../src/marketing/personalisation'\nimport { createPerson, tokenFor } from './privacy/fixtures'\n\nit('records consent and its withdrawal, and stops the processing', async () => {\n const person = await createPerson({ email: 'consent@example.test' })\n await request(app).post('/me/consents').send({ purpose: 'personalised-offers', wordingVersion: 3 }).set('Authorization', `Bearer ${await tokenFor(person)}`).expect(201)\n await request(app).delete('/me/consents/personalised-offers').set('Authorization', `Bearer ${await tokenFor(person)}`).expect(204)\n const records = await consents.history(person.id, 'personalised-offers')\n expect(records).toHaveLength(2)\n for (const r of records) expect(r).toMatchObject({ purpose: 'personalised-offers', wordingVersion: 3, at: expect.any(Date), channel: 'web' })\n expect(records.map((r) => r.event)).toEqual(['given', 'withdrawn'])\n expect(await personalisation.run({ personIds: [person.id] })).toMatchObject({ processed: [], skipped: [person.id] })\n})\n```",
1472
+ "hubWhen": {
1473
+ "PERSONAL": [
1474
+ "yes"
1475
+ ],
1476
+ "BASIS": [
1477
+ "consent"
1478
+ ]
1479
+ }
1480
+ },
1481
+ {
1482
+ "id": "ff-objection",
1483
+ "type": "fitness-fn",
1484
+ "label": "Objections honoured",
1485
+ "x": 1040,
1486
+ "y": 2080,
1487
+ "characteristic": "functional-suitability",
1488
+ "scope": "atomic",
1489
+ "cadence": "triggered",
1490
+ "trigger": "pull-request",
1491
+ "invocation": "automated",
1492
+ "description": "An integration test objects as a person, sends a marketing campaign and runs the analytics job, and checks that neither touched the person and that the exclusion list holds the objection with its date.\n\nThreshold: After an objection, 0 marketing messages to the person and 0 analytics rows for them from the next job run on; the objection is on the exclusion list with its date\n\nTool: Vitest with supertest, the mail sender captured by the test harness\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { exclusions } from '../src/privacy/exclusions'\nimport { campaigns } from '../src/marketing/campaigns'\nimport { usageAnalytics } from '../src/analytics/usage'\nimport { createPerson, tokenFor, mails } from './privacy/fixtures'\n\nit('stops marketing at once and analytics from the next run', async () => {\n const person = await createPerson({ email: 'object@example.test' })\n await request(app).post('/me/objections').send({ purposes: ['marketing', 'usage-analytics'] }).set('Authorization', `Bearer ${await tokenFor(person)}`).expect(201)\n expect(await exclusions.find(person.id)).toMatchObject({ purposes: ['marketing', 'usage-analytics'], objectedAt: expect.any(Date) })\n await campaigns.send('autumn-offers')\n expect(await mails.sentTo(person.email)).toEqual([])\n await usageAnalytics.run()\n expect(await usageAnalytics.rowsFor(person.id)).toEqual([])\n})\n```",
1493
+ "hubWhen": {
1494
+ "PERSONAL": [
1495
+ "yes"
1496
+ ],
1497
+ "BASIS": [
1498
+ "legitimate"
1499
+ ]
1500
+ }
1070
1501
  }
1071
1502
  ],
1072
1503
  "relations": [
@@ -1124,6 +1555,24 @@
1124
1555
  "targetId": "need",
1125
1556
  "relationType": "derives"
1126
1557
  },
1558
+ {
1559
+ "id": "req-breach-register--derives--need",
1560
+ "sourceId": "req-breach-register",
1561
+ "targetId": "need",
1562
+ "relationType": "derives"
1563
+ },
1564
+ {
1565
+ "id": "req-breach-people--derives--need",
1566
+ "sourceId": "req-breach-people",
1567
+ "targetId": "need",
1568
+ "relationType": "derives"
1569
+ },
1570
+ {
1571
+ "id": "req-breach-processor--derives--need",
1572
+ "sourceId": "req-breach-processor",
1573
+ "targetId": "need",
1574
+ "relationType": "derives"
1575
+ },
1127
1576
  {
1128
1577
  "id": "req-region-eu--derives--need",
1129
1578
  "sourceId": "req-region-eu",
@@ -1232,6 +1681,24 @@
1232
1681
  "targetId": "req-breach",
1233
1682
  "relationType": "verifies"
1234
1683
  },
1684
+ {
1685
+ "id": "sc-breach-register--verifies--req-breach-register",
1686
+ "sourceId": "sc-breach-register",
1687
+ "targetId": "req-breach-register",
1688
+ "relationType": "verifies"
1689
+ },
1690
+ {
1691
+ "id": "sc-breach-people--verifies--req-breach-people",
1692
+ "sourceId": "sc-breach-people",
1693
+ "targetId": "req-breach-people",
1694
+ "relationType": "verifies"
1695
+ },
1696
+ {
1697
+ "id": "sc-breach-processor--verifies--req-breach-processor",
1698
+ "sourceId": "sc-breach-processor",
1699
+ "targetId": "req-breach-processor",
1700
+ "relationType": "verifies"
1701
+ },
1235
1702
  {
1236
1703
  "id": "sc-region-eu--verifies--req-region-eu",
1237
1704
  "sourceId": "sc-region-eu",
@@ -1322,6 +1789,12 @@
1322
1789
  "targetId": "adr-crypto",
1323
1790
  "relationType": "implements"
1324
1791
  },
1792
+ {
1793
+ "id": "ff-record--implements--adr-no-special",
1794
+ "sourceId": "ff-record",
1795
+ "targetId": "adr-no-special",
1796
+ "relationType": "implements"
1797
+ },
1325
1798
  {
1326
1799
  "id": "ff-pii-scan--implements--adr-delete",
1327
1800
  "sourceId": "ff-pii-scan",
@@ -1371,64 +1844,106 @@
1371
1844
  "relationType": "implements"
1372
1845
  },
1373
1846
  {
1374
- "id": "ff-region--implements--adr-delete",
1375
- "sourceId": "ff-region",
1847
+ "id": "ff-protect--implements--adr-delete",
1848
+ "sourceId": "ff-protect",
1376
1849
  "targetId": "adr-delete",
1377
1850
  "relationType": "implements"
1378
1851
  },
1379
1852
  {
1380
- "id": "ff-region--implements--adr-anonymise",
1381
- "sourceId": "ff-region",
1853
+ "id": "ff-protect--implements--adr-anonymise",
1854
+ "sourceId": "ff-protect",
1382
1855
  "targetId": "adr-anonymise",
1383
1856
  "relationType": "implements"
1384
1857
  },
1385
1858
  {
1386
- "id": "ff-region--implements--adr-crypto",
1387
- "sourceId": "ff-region",
1859
+ "id": "ff-protect--implements--adr-crypto",
1860
+ "sourceId": "ff-protect",
1388
1861
  "targetId": "adr-crypto",
1389
1862
  "relationType": "implements"
1390
1863
  },
1391
1864
  {
1392
- "id": "ff-adequacy--implements--adr-delete",
1393
- "sourceId": "ff-adequacy",
1865
+ "id": "ff-breach-register--implements--adr-delete",
1866
+ "sourceId": "ff-breach-register",
1394
1867
  "targetId": "adr-delete",
1395
1868
  "relationType": "implements"
1396
1869
  },
1397
1870
  {
1398
- "id": "ff-adequacy--implements--adr-anonymise",
1399
- "sourceId": "ff-adequacy",
1871
+ "id": "ff-breach-register--implements--adr-anonymise",
1872
+ "sourceId": "ff-breach-register",
1400
1873
  "targetId": "adr-anonymise",
1401
1874
  "relationType": "implements"
1402
1875
  },
1403
1876
  {
1404
- "id": "ff-adequacy--implements--adr-crypto",
1405
- "sourceId": "ff-adequacy",
1877
+ "id": "ff-breach-register--implements--adr-crypto",
1878
+ "sourceId": "ff-breach-register",
1406
1879
  "targetId": "adr-crypto",
1407
1880
  "relationType": "implements"
1408
1881
  },
1409
1882
  {
1410
- "id": "ff-scc--implements--adr-delete",
1411
- "sourceId": "ff-scc",
1883
+ "id": "ff-breach-runbook--implements--adr-delete",
1884
+ "sourceId": "ff-breach-runbook",
1412
1885
  "targetId": "adr-delete",
1413
1886
  "relationType": "implements"
1414
1887
  },
1415
1888
  {
1416
- "id": "ff-scc--implements--adr-anonymise",
1417
- "sourceId": "ff-scc",
1889
+ "id": "ff-breach-runbook--implements--adr-anonymise",
1890
+ "sourceId": "ff-breach-runbook",
1418
1891
  "targetId": "adr-anonymise",
1419
1892
  "relationType": "implements"
1420
1893
  },
1421
1894
  {
1422
- "id": "ff-scc--implements--adr-crypto",
1423
- "sourceId": "ff-scc",
1895
+ "id": "ff-breach-runbook--implements--adr-crypto",
1896
+ "sourceId": "ff-breach-runbook",
1424
1897
  "targetId": "adr-crypto",
1425
1898
  "relationType": "implements"
1426
1899
  },
1900
+ {
1901
+ "id": "ff-region--implements--adr-region-eu",
1902
+ "sourceId": "ff-region",
1903
+ "targetId": "adr-region-eu",
1904
+ "relationType": "implements"
1905
+ },
1906
+ {
1907
+ "id": "ff-adequacy--implements--adr-region-adequate",
1908
+ "sourceId": "ff-adequacy",
1909
+ "targetId": "adr-region-adequate",
1910
+ "relationType": "implements"
1911
+ },
1912
+ {
1913
+ "id": "ff-scc--implements--adr-region-any",
1914
+ "sourceId": "ff-scc",
1915
+ "targetId": "adr-region-any",
1916
+ "relationType": "implements"
1917
+ },
1427
1918
  {
1428
1919
  "id": "ff-special--implements--adr-special",
1429
1920
  "sourceId": "ff-special",
1430
1921
  "targetId": "adr-special",
1431
1922
  "relationType": "implements"
1923
+ },
1924
+ {
1925
+ "id": "ff-dpia-gate--implements--adr-special",
1926
+ "sourceId": "ff-dpia-gate",
1927
+ "targetId": "adr-special",
1928
+ "relationType": "implements"
1929
+ },
1930
+ {
1931
+ "id": "ff-purpose-roles--implements--adr-basis-contract",
1932
+ "sourceId": "ff-purpose-roles",
1933
+ "targetId": "adr-basis-contract",
1934
+ "relationType": "implements"
1935
+ },
1936
+ {
1937
+ "id": "ff-consent--implements--adr-basis-consent",
1938
+ "sourceId": "ff-consent",
1939
+ "targetId": "adr-basis-consent",
1940
+ "relationType": "implements"
1941
+ },
1942
+ {
1943
+ "id": "ff-objection--implements--adr-basis-legitimate",
1944
+ "sourceId": "ff-objection",
1945
+ "targetId": "adr-basis-legitimate",
1946
+ "relationType": "implements"
1432
1947
  }
1433
1948
  ]
1434
1949
  }