@radicaltools/cli 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +353 -33
  2. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  3. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +1174 -0
  5. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  6. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  7. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  8. package/dist/hub-catalogue/concern/concern-architecture-style.radical +1268 -0
  9. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  10. package/dist/hub-catalogue/concern/concern-authentication.radical +895 -0
  11. package/dist/hub-catalogue/concern/concern-authorization.radical +1686 -0
  12. package/dist/hub-catalogue/concern/concern-availability.radical +1028 -0
  13. package/dist/hub-catalogue/concern/concern-backend-stack.radical +1037 -0
  14. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1560 -0
  15. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  16. package/dist/hub-catalogue/concern/concern-capacity.radical +915 -0
  17. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  18. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  19. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  20. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  21. package/dist/hub-catalogue/concern/concern-communication-style.radical +1508 -0
  22. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  23. package/dist/hub-catalogue/concern/concern-data-consistency.radical +1112 -0
  24. package/dist/hub-catalogue/concern/concern-data-store.radical +1282 -0
  25. package/dist/hub-catalogue/concern/concern-decomposition.radical +1318 -0
  26. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  27. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  28. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  29. package/dist/hub-catalogue/concern/concern-deployment.radical +1203 -0
  30. package/dist/hub-catalogue/concern/concern-encryption.radical +1318 -0
  31. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  32. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  33. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1647 -0
  34. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  35. package/dist/hub-catalogue/concern/concern-infrastructure.radical +2183 -0
  36. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1116 -0
  37. package/dist/hub-catalogue/concern/concern-messaging.radical +973 -0
  38. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +867 -0
  39. package/dist/hub-catalogue/concern/concern-observability.radical +997 -0
  40. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  41. package/dist/hub-catalogue/concern/concern-personal-data.radical +1949 -0
  42. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  43. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1445 -0
  44. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  45. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  46. package/dist/hub-catalogue/concern/concern-secrets.radical +1284 -0
  47. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  48. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  49. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  50. package/dist/hub-catalogue/concern/concern-supply-chain.radical +1386 -0
  51. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  52. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  53. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1440 -0
  54. package/dist/hub-catalogue/concern/concern-test-strategy.radical +1212 -0
  55. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  56. package/dist/index.js +12712 -7144
  57. package/package.json +5 -3
@@ -0,0 +1,1096 @@
1
+ {
2
+ "hub": {
3
+ "id": "concern-audit-trail",
4
+ "category": "concern",
5
+ "name": "Audit trail",
6
+ "description": "Who did what, when, to which record and from where: which operations are recorded, what a record holds, where records are kept so that tampering shows, for how long, and who may read them. The snippets are for a Node service on PostgreSQL or Azure SQL, with S3 or Azure storage; each tool line names the alternatives.",
7
+ "tags": [
8
+ "compliance",
9
+ "audit-trail",
10
+ "audit-log",
11
+ "tamper-evidence",
12
+ "worm",
13
+ "retention"
14
+ ],
15
+ "requiredMetamodel": "c4-ddd-governance-builtin",
16
+ "concern": {
17
+ "id": "audit-trail",
18
+ "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
19
+ "why": "these elements run the operations a regulator, an auditor or an investigation may ask about, so how their audit trail is recorded, protected, kept and read has to be decided.",
20
+ "group": "compliance"
21
+ },
22
+ "sources": [
23
+ {
24
+ "title": "OWASP Logging Cheat Sheet",
25
+ "url": "https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html"
26
+ },
27
+ {
28
+ "title": "NIST SP 800-92, Guide to Computer Security Log Management",
29
+ "url": "https://csrc.nist.gov/pubs/sp/800/92/final"
30
+ },
31
+ {
32
+ "title": "NIST SP 800-53 Rev. 5, Security and Privacy Controls, AU family (AU-2, AU-3, AU-5, AU-8, AU-9, AU-11)",
33
+ "url": "https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final"
34
+ },
35
+ {
36
+ "title": "ISO/IEC 27001:2022, Annex A 8.15 Logging and 8.17 Clock synchronization",
37
+ "url": "https://www.iso.org/standard/27001"
38
+ },
39
+ {
40
+ "title": "PCI DSS v4.0.1, Requirement 10: Log and monitor all access to system components and cardholder data",
41
+ "url": "https://www.pcisecuritystandards.org/document_library/"
42
+ },
43
+ {
44
+ "title": "Amazon S3 User Guide: Locking objects with Object Lock",
45
+ "url": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html"
46
+ },
47
+ {
48
+ "title": "Azure Storage: Immutable storage for blob data",
49
+ "url": "https://learn.microsoft.com/en-us/azure/storage/blobs/immutable-storage-overview"
50
+ },
51
+ {
52
+ "title": "Google Cloud Storage: Bucket Lock",
53
+ "url": "https://docs.cloud.google.com/storage/docs/bucket-lock"
54
+ },
55
+ {
56
+ "title": "Microsoft Learn: Ledger overview (SQL Server 2022, Azure SQL)",
57
+ "url": "https://learn.microsoft.com/en-us/sql/relational-databases/security/ledger/ledger-overview"
58
+ },
59
+ {
60
+ "title": "Debezium blog: Building Audit Logs with Change Data Capture and Stream Processing",
61
+ "url": "https://debezium.io/blog/2019/10/01/audit-logs-with-change-data-capture-and-stream-processing/"
62
+ },
63
+ {
64
+ "title": "Regulation (EU) 2016/679 (GDPR), Article 17",
65
+ "url": "https://eur-lex.europa.eu/eli/reg/2016/679/oj"
66
+ }
67
+ ],
68
+ "templateParams": [
69
+ {
70
+ "key": "STORE",
71
+ "title": "Store",
72
+ "label": "Where are audit records kept, and how does tampering show?",
73
+ "hint": "The store decides who could change a record unnoticed: the database's owner, the cloud account's administrators, or nobody within the retention. In every option the record is written in the same transaction as the change, so a change never commits without it.",
74
+ "defaultValue": "table",
75
+ "options": [
76
+ {
77
+ "value": "table",
78
+ "label": "an append-only table with a hash chain",
79
+ "description": "Records are rows of an audit table in the element's own PostgreSQL database: the application may only insert, a trigger refuses updates and deletes, each row carries the hash of the one before, and the head of the chain is copied to write-once storage every hour. Pick it for an element with its own PostgreSQL database and moderate write rates, when nobody requires WORM storage for the records themselves."
80
+ },
81
+ {
82
+ "value": "worm",
83
+ "label": "write-once object storage",
84
+ "description": "Records go to an outbox table in the same transaction and are shipped within minutes, in numbered batches, to storage that nobody can change or delete within the retention: S3 Object Lock in compliance mode, an Azure container with a locked time-based retention policy, or a Cloud Storage bucket with a locked retention policy. Pick it when an auditor or regulator expects WORM storage, or when the records must outlive the database."
85
+ },
86
+ {
87
+ "value": "ledger",
88
+ "label": "a ledger database",
89
+ "description": "Records are rows of an append-only ledger table in SQL Server 2022 or later, Azure SQL Database or Azure SQL Managed Instance; the database hashes every transaction into a chain of blocks, stores the digests in immutable Azure storage and verifies them on request. Pick it when the element already runs on SQL Server or Azure SQL. Old rows can never be deleted from such a table. Amazon QLDB, once the managed ledger on AWS, reached its end of support on 31 July 2025."
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "key": "SCOPE",
95
+ "title": "Scope",
96
+ "label": "Which operations are recorded?",
97
+ "hint": "A catalogue records what the business means (a payment approved), but only for the operations someone listed; capturing every write also catches changes made around the element (a migration, a fix in a database console, a batch job), at the cost of a pipeline to run. Reads and exports leave nothing in the database's log, so they stay in the catalogue either way.",
98
+ "defaultValue": "catalogue",
99
+ "options": [
100
+ {
101
+ "value": "catalogue",
102
+ "label": "the operations listed in a catalogue",
103
+ "description": "A file in the repository lists the audited operations, at the least money movements, changes to customer records, permission changes, reads of restricted data and exports, and every other operation that changes data is listed as exempt with a reason; each audited operation writes its record in code. Pick it when every change goes through the element's own operations and nobody changes data in the database directly."
104
+ },
105
+ {
106
+ "value": "cdc",
107
+ "label": "every write to the element's stores, plus the catalogue's reads",
108
+ "description": "Change data capture (Debezium reading the database's log) records every committed insert, update and delete, whatever made it, joined with the actor its transaction names; the catalogue still lists reads, exports and the business operations. Pick it when data is also changed by jobs, migrations or people outside the element's operations, or an auditor asks for every change to the records."
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "key": "ACCESS",
114
+ "title": "Readers",
115
+ "label": "Who may read the audit trail?",
116
+ "hint": "Whoever reads the trail learns what everyone did, and the people who run the element are among those it records. Every read of the trail is itself recorded, whichever you pick (PCI DSS v4.0.1 10.2.1.3).",
117
+ "defaultValue": "auditors",
118
+ "options": [
119
+ {
120
+ "value": "auditors",
121
+ "label": "a named audit role",
122
+ "description": "Only members of one audit role, held by compliance, internal audit or security and by nobody who develops or operates the element, read records, through the element's audit read operation. Pick it when the element handles money, customer records or regulated data, or an external audit is expected."
123
+ },
124
+ {
125
+ "value": "team",
126
+ "label": "the team that runs the element",
127
+ "description": "The members of the owning team read records to investigate incidents and support cases, and the list of their reads goes to the security owner every month. Pick it for internal tools and for organisations without a separate audit or compliance function."
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "key": "CONTENT",
133
+ "title": "Change detail",
134
+ "label": "What does a record keep of the change itself?",
135
+ "hint": "Nobody can edit the audit trail, so any personal data in it stays for the whole retention, past the erasure the Personal data pack decides. A keyed hash proves what a value was without keeping it.",
136
+ "defaultValue": "hashes",
137
+ "options": [
138
+ {
139
+ "value": "hashes",
140
+ "label": "the changed fields with keyed hashes of their values",
141
+ "description": "Each record names the fields a change touched and holds an HMAC-SHA-256 of the old and the new value, under a key kept in the key management service; the values themselves stay in the business store. Pick it when records touch personal data, which is almost always, or when values are large."
142
+ },
143
+ {
144
+ "value": "values",
145
+ "label": "the old and new values",
146
+ "description": "Each record holds the old and new value of every changed field, except secrets and card numbers. Pick it when an investigation must read past values years later without the business store or its backups, and either the fields hold no personal data or the organisation's DPO has confirmed a legal obligation to keep them for the retention."
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ "key": "AUDITED_OPERATIONS",
152
+ "label": "Which operations must the catalogue list at the least?",
153
+ "defaultValue": "money movements, changes to customer records, permission changes, reads of restricted data, exports"
154
+ },
155
+ {
156
+ "key": "AUDIT_YEARS",
157
+ "label": "For how many years are audit records kept? (a regulation or a contract may set it; PCI DSS asks for at least one)",
158
+ "defaultValue": "5",
159
+ "type": "number"
160
+ },
161
+ {
162
+ "key": "VERIFY_HOURS",
163
+ "label": "Within how many hours must tampering with a record be detected?",
164
+ "defaultValue": "24",
165
+ "type": "number"
166
+ },
167
+ {
168
+ "key": "CLOCK_MS",
169
+ "label": "How far may the clock of a host that writes records drift from UTC (milliseconds)?",
170
+ "defaultValue": "100",
171
+ "type": "number"
172
+ },
173
+ {
174
+ "key": "SHIP_MINUTES",
175
+ "label": "Within how many minutes must a record reach write-once storage? (write-once object storage only)",
176
+ "defaultValue": "15",
177
+ "type": "number"
178
+ },
179
+ {
180
+ "key": "CDC_MINUTES",
181
+ "label": "Within how many minutes must a captured write appear in the audit trail? (every write captured only)",
182
+ "defaultValue": "15",
183
+ "type": "number"
184
+ }
185
+ ]
186
+ },
187
+ "nodes": [
188
+ {
189
+ "id": "need",
190
+ "type": "need",
191
+ "label": "Who did what can be proved",
192
+ "x": 0,
193
+ "y": 0,
194
+ "kind": "brief",
195
+ "source": "Hub concern pack: Audit trail",
196
+ "description": "This element moves money, changes customers' records and permissions, or lets people read and export data that matters to someone outside the team. When a regulator, an auditor, a court or an incident investigation asks who did what, when, to which record and from where, the answer has to come from records that are complete, that nobody could have changed unnoticed, that are still there years later, and that the people they record cannot read or edit at will. The pack says what the system does and how the team proves it; which regulations apply and how long records must be kept is for the organisation's compliance officer or DPO to read, and nothing here is legal advice. The snippets assume the application under src/ (src/app exports the router's table, src/audit the audit writer and store), the tests under tests/ with fixtures in tests/audit, and under audit/ in the repository the catalogue (audit/catalogue.yaml), the record schema (audit/record.schema.json) and the readers (audit/readers.yaml)."
197
+ },
198
+ {
199
+ "id": "req-catalogue",
200
+ "type": "requirement",
201
+ "label": "Catalogued operations recorded",
202
+ "x": 260,
203
+ "y": 0,
204
+ "ears_type": "ubiquitous",
205
+ "action": "list its audited operations in audit/catalogue.yaml in the repository, at the least {{AUDITED_OPERATIONS}}, name every other operation that changes data in the same file as exempt with a reason, and write exactly one audit record for every call of an audited operation, refused and failed calls included",
206
+ "rationale": "A trail is evidence only of what it was meant to record; a list kept in the repository makes that choice reviewable, and refused attempts matter as much as successes after an incident (NIST SP 800-53 AU-2, Event Logging; OWASP Logging Cheat Sheet, which events to log)."
207
+ },
208
+ {
209
+ "id": "req-record",
210
+ "type": "requirement",
211
+ "label": "A record says who, what, when, where",
212
+ "x": 260,
213
+ "y": 130,
214
+ "ears_type": "ubiquitous",
215
+ "action": "give every audit record the actor, the person or system it acted for when that differs, the action, the target's type and id, the outcome, the time in UTC with milliseconds, the correlation id its log lines carry, the source (client address and client or calling system) and the version of the record format",
216
+ "rationale": "A record must say who did what, when, to which record and from where to stand as evidence (OWASP Logging Cheat Sheet, event attributes; NIST SP 800-53 AU-3, Content of Audit Records; PCI DSS v4.0.1 10.2.2). The correlation id is the one the Error handling and logging conventions pack puts in every log line, so a record leads to the request's logs."
217
+ },
218
+ {
219
+ "id": "req-atomic",
220
+ "type": "requirement",
221
+ "label": "No change without its record",
222
+ "x": 260,
223
+ "y": 260,
224
+ "ears_type": "unwanted-behaviour",
225
+ "unwanted_condition": "the audit record of a change cannot be written",
226
+ "action": "roll the change back and fail the operation, so that no change is committed without its record",
227
+ "rationale": "A trail that quietly misses records while its store is failing cannot be relied on for any period; NIST SP 800-53 AU-5 asks for a decided response to a failure of audit logging, and here the response is to stop the one operation (AU-5(4), shutdown on failure, at the scale of a transaction)."
228
+ },
229
+ {
230
+ "id": "req-hashes",
231
+ "type": "requirement",
232
+ "label": "Values kept only as keyed hashes",
233
+ "x": 260,
234
+ "y": 390,
235
+ "ears_type": "ubiquitous",
236
+ "action": "record the changed fields with an HMAC-SHA-256 of the old and of the new value under the element's audit key, and never write a value itself into an audit record",
237
+ "rationale": "Records nobody can edit must not become the one copy of a person's data that cannot be erased (GDPR Art. 17); a keyed hash still proves what a value was, and unlike a plain hash it cannot be confirmed by guessing (OWASP Logging Cheat Sheet: data to exclude, hash or encrypt).",
238
+ "hubWhen": {
239
+ "CONTENT": [
240
+ "hashes"
241
+ ]
242
+ }
243
+ },
244
+ {
245
+ "id": "req-values",
246
+ "type": "requirement",
247
+ "label": "Old and new values, no secrets",
248
+ "x": 260,
249
+ "y": 520,
250
+ "ears_type": "ubiquitous",
251
+ "action": "record the old and the new value of each changed field, and never write a password, token, key or full card number into an audit record, naming such a field as changed without its value",
252
+ "rationale": "Past values in the trail let an investigation read what changed without the business store; secrets in it would turn the evidence into the leak (OWASP Logging Cheat Sheet, data to exclude).",
253
+ "hubWhen": {
254
+ "CONTENT": [
255
+ "values"
256
+ ]
257
+ }
258
+ },
259
+ {
260
+ "id": "req-clock",
261
+ "type": "requirement",
262
+ "label": "Times from a synchronised clock",
263
+ "x": 260,
264
+ "y": 650,
265
+ "ears_type": "ubiquitous",
266
+ "action": "take the time of every audit record from a clock synchronised over NTP and kept within {{CLOCK_MS}} ms of UTC on every host that writes records",
267
+ "rationale": "Records from several hosts can be put in order and matched with other evidence only if their clocks agree (NIST SP 800-53 AU-8, Time Stamps; ISO/IEC 27001:2022 A.8.17; PCI DSS v4.0.1 10.6.1; OWASP Logging Cheat Sheet, synchronise time)."
268
+ },
269
+ {
270
+ "id": "req-append-only",
271
+ "type": "requirement",
272
+ "label": "Records cannot be changed",
273
+ "x": 260,
274
+ "y": 780,
275
+ "ears_type": "ubiquitous",
276
+ "action": "refuse every update and delete of an audit record within the retention, from any identity, the element's own and administrators' included",
277
+ "rationale": "A record its subject can edit is no evidence against that subject (NIST SP 800-53 AU-9, Protection of Audit Information; OWASP Logging Cheat Sheet: store log data on read-only media as soon as possible)."
278
+ },
279
+ {
280
+ "id": "req-tamper",
281
+ "type": "requirement",
282
+ "label": "Tampering detected",
283
+ "x": 260,
284
+ "y": 910,
285
+ "ears_type": "unwanted-behaviour",
286
+ "unwanted_condition": "an audit record has been changed or removed, by any means, the store's own protection bypassed included",
287
+ "action": "detect it within {{VERIFY_HOURS}} hours, name the first record affected, and alert the audit owner",
288
+ "rationale": "Whoever controls the machine can bypass any protection; tamper evidence makes the bypass visible (OWASP Logging Cheat Sheet: build in tamper detection; NIST SP 800-53 AU-9 and AU-9(3), Cryptographic Protection; PCI DSS v4.0.1 10.3.4)."
289
+ },
290
+ {
291
+ "id": "req-retention",
292
+ "type": "requirement",
293
+ "label": "Records kept for the retention",
294
+ "x": 260,
295
+ "y": 1040,
296
+ "ears_type": "ubiquitous",
297
+ "action": "keep every audit record for at least {{AUDIT_YEARS}} years from the time it was written",
298
+ "rationale": "An audit, a dispute or a regulator's request can come years after the event (NIST SP 800-53 AU-11, Audit Record Retention; NIST SP 800-92; PCI DSS v4.0.1 10.5.1 asks for at least 12 months). The period is the organisation's to set from the regulations and contracts that apply to it."
299
+ },
300
+ {
301
+ "id": "req-readers-auditors",
302
+ "type": "requirement",
303
+ "label": "Only the audit role reads",
304
+ "x": 260,
305
+ "y": 1170,
306
+ "ears_type": "ubiquitous",
307
+ "action": "let only members of the audit role read audit records, through the element's audit read operation, and refuse everyone else, the element's developers and operators included",
308
+ "rationale": "People are recorded in the trail they would read; keeping its readers apart from those it records keeps the trail private and its reading honest (NIST SP 800-53 AU-9(4), Access by Subset of Privileged Users; PCI DSS v4.0.1 10.3.1).",
309
+ "hubWhen": {
310
+ "ACCESS": [
311
+ "auditors"
312
+ ]
313
+ }
314
+ },
315
+ {
316
+ "id": "req-readers-team",
317
+ "type": "requirement",
318
+ "label": "The team reads, the security owner sees",
319
+ "x": 260,
320
+ "y": 1300,
321
+ "ears_type": "ubiquitous",
322
+ "action": "let only members of the team that runs the element read audit records, through the element's audit read operation, and send the list of the past month's reads to the security owner every month",
323
+ "rationale": "Without a separate audit function the readers are among the recorded; a monthly list read by someone outside the team keeps their reading visible (PCI DSS v4.0.1 10.3.1 and 10.2.1.3).",
324
+ "hubWhen": {
325
+ "ACCESS": [
326
+ "team"
327
+ ]
328
+ }
329
+ },
330
+ {
331
+ "id": "req-reads-recorded",
332
+ "type": "requirement",
333
+ "label": "Reads of the trail recorded",
334
+ "x": 260,
335
+ "y": 1430,
336
+ "ears_type": "event-driven",
337
+ "trigger": "someone reads audit records",
338
+ "action": "write an audit record of the read itself, with the reader, the time and the filter used",
339
+ "rationale": "Reading the trail is an access worth evidence of its own (PCI DSS v4.0.1 10.2.1.3: audit logs capture all access to audit logs)."
340
+ },
341
+ {
342
+ "id": "req-cdc",
343
+ "type": "requirement",
344
+ "label": "Every write captured",
345
+ "x": 260,
346
+ "y": 1560,
347
+ "ears_type": "event-driven",
348
+ "trigger": "a write to one of the element's stores is committed, whatever made it",
349
+ "action": "record it in the audit trail within {{CDC_MINUTES}} minutes with the table, the key, the changed columns and the actor of its transaction, or as unattributed with the database user when its transaction named no actor",
350
+ "rationale": "Changes made around the operations (a migration, a fix in a console, a batch job) are exactly the ones a catalogue misses; reading the database's log catches every committed change, and joining it with the transaction's context says who made it (Debezium, audit logs with change data capture).",
351
+ "hubWhen": {
352
+ "SCOPE": [
353
+ "cdc"
354
+ ]
355
+ }
356
+ },
357
+ {
358
+ "id": "sc-catalogue",
359
+ "type": "scenario",
360
+ "label": "Every audited call leaves a record",
361
+ "x": 520,
362
+ "y": 0,
363
+ "given": "the catalogue and the element's operations",
364
+ "when": "each audited operation is called once by a permitted caller and once by a caller it refuses",
365
+ "then": "each call leaves exactly one record, the refused one with outcome refused, and an operation that changes data but is in neither list fails the test"
366
+ },
367
+ {
368
+ "id": "sc-record",
369
+ "type": "scenario",
370
+ "label": "Records have every field",
371
+ "x": 520,
372
+ "y": 130,
373
+ "given": "the records written while every audited operation was called",
374
+ "when": "each is validated against audit/record.schema.json",
375
+ "then": "every record has actor, action, target, outcome, time, correlation id, source and version, and none is rejected"
376
+ },
377
+ {
378
+ "id": "sc-atomic",
379
+ "type": "scenario",
380
+ "label": "Failed record stops the change",
381
+ "x": 520,
382
+ "y": 260,
383
+ "given": "an audited operation whose audit write is made to fail in the test",
384
+ "when": "the operation is called",
385
+ "then": "it fails, the business record is unchanged, and no partial change remains"
386
+ },
387
+ {
388
+ "id": "sc-hashes",
389
+ "type": "scenario",
390
+ "label": "E-mail kept as a hash",
391
+ "x": 520,
392
+ "y": 390,
393
+ "given": "a customer record",
394
+ "when": "its e-mail address is changed to a random value",
395
+ "then": "the record names the field, its new-value hash equals the HMAC of the random value, and the value appears nowhere in the audit store",
396
+ "hubWhen": {
397
+ "CONTENT": [
398
+ "hashes"
399
+ ]
400
+ }
401
+ },
402
+ {
403
+ "id": "sc-values",
404
+ "type": "scenario",
405
+ "label": "Address kept, password not",
406
+ "x": 520,
407
+ "y": 520,
408
+ "given": "a customer record and an account",
409
+ "when": "the customer's address and the account's password are changed",
410
+ "then": "the record holds the old and new address, names the password as changed, and the password appears nowhere in the audit store",
411
+ "hubWhen": {
412
+ "CONTENT": [
413
+ "values"
414
+ ]
415
+ }
416
+ },
417
+ {
418
+ "id": "sc-clock",
419
+ "type": "scenario",
420
+ "label": "Clock in step",
421
+ "x": 520,
422
+ "y": 650,
423
+ "given": "every host that writes audit records",
424
+ "when": "its clock is compared with its NTP sources",
425
+ "then": "it is synchronised and its offset is within {{CLOCK_MS}} ms"
426
+ },
427
+ {
428
+ "id": "sc-append-only",
429
+ "type": "scenario",
430
+ "label": "Edits refused",
431
+ "x": 520,
432
+ "y": 780,
433
+ "given": "a stored audit record",
434
+ "when": "the element's own identity and an administrator each try to update it and to delete it",
435
+ "then": "all four attempts are refused and the record is unchanged"
436
+ },
437
+ {
438
+ "id": "sc-tamper",
439
+ "type": "scenario",
440
+ "label": "Edited copy fails verification",
441
+ "x": 520,
442
+ "y": 910,
443
+ "given": "a copy of the audit store",
444
+ "when": "one record is changed and another removed in the copy, around the application, and verification runs on the copy",
445
+ "then": "verification fails, names the first record affected, and the audit owner is alerted"
446
+ },
447
+ {
448
+ "id": "sc-retention",
449
+ "type": "scenario",
450
+ "label": "Retention configured",
451
+ "x": 520,
452
+ "y": 1040,
453
+ "given": "the audit store as deployed",
454
+ "when": "its retention configuration is read",
455
+ "then": "no record can be removed before {{AUDIT_YEARS}} years"
456
+ },
457
+ {
458
+ "id": "sc-readers-auditors",
459
+ "type": "scenario",
460
+ "label": "Outsiders refused",
461
+ "x": 520,
462
+ "y": 1170,
463
+ "given": "a member of the audit role, a developer of the element and a customer",
464
+ "when": "each asks the audit read operation for the records of one customer",
465
+ "then": "only the audit role's member gets them; the others are refused with 403",
466
+ "hubWhen": {
467
+ "ACCESS": [
468
+ "auditors"
469
+ ]
470
+ }
471
+ },
472
+ {
473
+ "id": "sc-readers-team",
474
+ "type": "scenario",
475
+ "label": "Team reads are reported",
476
+ "x": 520,
477
+ "y": 1300,
478
+ "given": "a member of the team and a developer of another team",
479
+ "when": "each asks the audit read operation for records and the month's report is made",
480
+ "then": "only the team member gets them, and the report to the security owner lists that read",
481
+ "hubWhen": {
482
+ "ACCESS": [
483
+ "team"
484
+ ]
485
+ }
486
+ },
487
+ {
488
+ "id": "sc-reads-recorded",
489
+ "type": "scenario",
490
+ "label": "A search leaves a record",
491
+ "x": 520,
492
+ "y": 1430,
493
+ "given": "a permitted reader of the audit trail",
494
+ "when": "they search the records of one customer",
495
+ "then": "a new record with action audit.read names the reader, the time and the filter"
496
+ },
497
+ {
498
+ "id": "sc-cdc",
499
+ "type": "scenario",
500
+ "label": "Direct change recorded",
501
+ "x": 520,
502
+ "y": 1560,
503
+ "given": "the change data capture pipeline running",
504
+ "when": "a row is changed directly in the database, outside the element",
505
+ "then": "within {{CDC_MINUTES}} minutes the audit trail holds a record of it, marked unattributed with the database user",
506
+ "hubWhen": {
507
+ "SCOPE": [
508
+ "cdc"
509
+ ]
510
+ }
511
+ },
512
+ {
513
+ "id": "adr-table",
514
+ "type": "adr",
515
+ "label": "Audit records in an append-only table with a hash chain",
516
+ "x": 780,
517
+ "y": 0,
518
+ "concern": "audit-trail",
519
+ "status": "accepted",
520
+ "date": "",
521
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
522
+ "decision": "Audit records are rows of an append-only table audit.records in the element's own PostgreSQL database, partitioned by month with pg_partman, inserted in the same transaction as the change they record, so that the change and its record commit or roll back together. The application's role may only insert and read; a row-level trigger refuses UPDATE and DELETE for every role, the owner included. Each row carries chain_pos, prev_hash and hash = SHA-256(prev_hash ‖ audit.canonical(row)), set by a SECURITY DEFINER trigger that takes a transaction-level advisory lock, so rows are chained in commit order; audit.canonical is versioned and never changed for rows already written. Every hour a job copies the chain head (position and hash) to write-once storage (S3 Object Lock in compliance mode, or an Azure container with a locked time-based policy); every {{VERIFY_HOURS}} hours a job recomputes the chain, compares it with the copied heads and pages the audit owner on a mismatch. pg_partman drops a month's partition once it is {{AUDIT_YEARS}} years old. Recorded: {{SCOPE}}. Each record keeps {{CONTENT}}. Readers: {{ACCESS}}, through the element's audit read operation, which records every read.",
523
+ "consequences": "• No new infrastructure: the record commits with the change, and a failed audit write fails the change.\n• The database's owner can still disable the trigger, rewrite rows and recompute the chain after the last copied head: the copied heads limit that to the last hour, and the verification notices it rather than prevents it.\n• The advisory lock serialises audited transactions from the moment they write their record until they commit; at high write rates, keep one chain per tenant or per partition, or choose write-once storage.\n• {{AUDIT_YEARS}} years of records live in the operational database: its storage, backups and restore times grow with them.\n• The hash code and the trigger are ours to keep right; a change to audit.canonical needs a new version, not an edit.",
524
+ "alternatives": "1. Write-once object storage: nobody can change a shipped record within the retention, but records travel through an outbox and arrive minutes later.\n2. A ledger database (SQL Server or Azure SQL ledger tables): the database chains and verifies for us, but only on SQL Server or Azure SQL, and records can never be removed.\n3. pgAudit or the database's own audit log: it records statements rather than business operations, and its log is kept by the same administrators.",
525
+ "hubWhen": {
526
+ "STORE": [
527
+ "table"
528
+ ]
529
+ }
530
+ },
531
+ {
532
+ "id": "adr-worm",
533
+ "type": "adr",
534
+ "label": "Audit records in write-once object storage",
535
+ "x": 780,
536
+ "y": 130,
537
+ "concern": "audit-trail",
538
+ "status": "accepted",
539
+ "date": "",
540
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
541
+ "decision": "Audit records are inserted into an outbox table audit_outbox in the element's database in the same transaction as the change they record. A relay, the only writer, numbers them gap-free and ships them at least every {{SHIP_MINUTES}} minutes as JSON Lines batches named audit/<element>/<yyyy>/<mm>/<dd>/<first>-<last>.jsonl.gz, and deletes them from the outbox only after the upload succeeded. The storage refuses any change or deletion within the retention: an S3 bucket with Object Lock in compliance mode and a default retention of {{AUDIT_YEARS}} years, an Azure container with a locked time-based retention policy of the same length, or a Cloud Storage bucket with a locked retention policy; a lifecycle rule removes batches whose retention has passed. Every {{VERIFY_HOURS}} hours a job checks that the record numbers of the listed batches have no gap (a delete marker hiding a batch shows as one) and that the outbox holds nothing older than {{SHIP_MINUTES}} minutes, and pages the audit owner otherwise. Recorded: {{SCOPE}}. Each record keeps {{CONTENT}}. Readers: {{ACCESS}}, through the element's audit read operation, which records every read; nobody else holds read access to the bucket.",
542
+ "consequences": "• Within the retention nobody can change or delete a shipped batch, the account's root user included (S3 compliance mode, a locked Azure or Cloud Storage policy); S3 Object Lock and Azure immutable storage have been assessed against SEC 17a-4(f).\n• Records wait up to {{SHIP_MINUTES}} minutes in the outbox, where the database's owner could still remove them; the gap check only sees what the relay numbered.\n• A retention set too long cannot be shortened: in S3 compliance mode the only way out is closing the account, so try the configuration in governance mode or with an unlocked policy first.\n• Searching needs an index or a query engine over the bucket (Amazon Athena, Azure Synapse serverless SQL); the audit read operation has to provide it for the readers.\n• Storage is cheap over {{AUDIT_YEARS}} years, and the records outlive the database and its backups.",
543
+ "alternatives": "1. An append-only table with a hash chain: no relay and no bucket, but the database's owner can rewrite the tail after the last copied head.\n2. A ledger database: verification built in, tied to SQL Server or Azure SQL.\n3. Records shipped only to the SIEM: searchable at once, but its administrators can delete them and its retention is set for detection, not evidence (the planned Security event logging and detection pack).",
544
+ "hubWhen": {
545
+ "STORE": [
546
+ "worm"
547
+ ]
548
+ }
549
+ },
550
+ {
551
+ "id": "adr-ledger",
552
+ "type": "adr",
553
+ "label": "Audit records in a ledger table",
554
+ "x": 780,
555
+ "y": 260,
556
+ "concern": "audit-trail",
557
+ "status": "accepted",
558
+ "date": "",
559
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
560
+ "decision": "Audit records are rows of an append-only ledger table audit.records (CREATE TABLE … WITH (LEDGER = ON (APPEND_ONLY = ON))) in the element's own database on SQL Server 2022 or later, Azure SQL Database or Azure SQL Managed Instance, inserted in the same transaction as the change they record. The database refuses UPDATE and DELETE on the table for every user, administrators included, hashes every transaction into a chain of blocks, and stores the database digests automatically in an Azure storage container with a locked time-based immutability policy of at least {{AUDIT_YEARS}} years (or in Azure Confidential Ledger). Every {{VERIFY_HOURS}} hours a job runs sys.sp_verify_database_ledger_from_digest_storage over the digest locations and pages the audit owner when it fails or the digest locations change. Recorded: {{SCOPE}}. Each record keeps {{CONTENT}}. Readers: {{ACCESS}}, through the element's audit read operation, which records every read.",
561
+ "consequences": "• Tamper evidence and its verification come with the database: no hash code of our own.\n• Only on SQL Server 2022 or later and Azure SQL: a ledger table cannot be turned back into an ordinary table, and TRUNCATE and partition switching are not supported on it.\n• Old rows cannot be deleted from an append-only ledger table: records stay for the life of the database, well past {{AUDIT_YEARS}} years, and any personal data in them with them; dropping the table only renames it.\n• An administrator of the machine can still edit the database files; ledger cannot prevent that, only detect it at the next verification.\n• Amazon QLDB, the managed ledger on AWS, reached its end of support on 31 July 2025: on AWS, choose one of the other stores.",
562
+ "alternatives": "1. An append-only table with a hash chain on PostgreSQL: the same idea in code of our own, with deletion after the retention.\n2. Write-once object storage: deletion after the retention is possible, verification of completeness is ours.\n3. Azure Confidential Ledger as the store itself: tamper-proof, but outside the business transaction, so a change could commit without its record.",
563
+ "hubWhen": {
564
+ "STORE": [
565
+ "ledger"
566
+ ]
567
+ }
568
+ },
569
+ {
570
+ "id": "adr-cdc",
571
+ "type": "adr",
572
+ "label": "Every write captured from the database log",
573
+ "x": 780,
574
+ "y": 390,
575
+ "concern": "audit-trail",
576
+ "status": "accepted",
577
+ "date": "",
578
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
579
+ "decision": "Besides the catalogue's operations, every committed insert, update and delete in the element's stores is recorded. Each audited transaction also inserts one row into audit.transaction_context (actor, on-behalf-of, correlation id, source). Debezium's connector for the element's database (PostgreSQL through pgoutput, SQL Server through its change data capture tables) captures that table with the others, with transaction metadata on (provide.transaction.metadata), and a Kafka Streams enricher joins every change event to the context row of the same transaction id and appends the result to the audit store within {{CDC_MINUTES}} minutes. A change whose transaction wrote no context row (a migration, a console fix, a batch job) is recorded as unattributed with the database user, and the day's unattributed changes are reported to the element's owner. Reads and exports stay in the catalogue, since the database's log does not show them.",
580
+ "consequences": "• Changes made around the element's operations are recorded too, and the unattributed ones become visible.\n• Kafka, Kafka Connect, Debezium and the enricher join the chain of evidence: an outage delays records, and a lost offset or a re-snapshot can skip or repeat them.\n• A captured change says which columns changed, not which business operation meant it; the catalogue still names the operations.\n• Captured changes reach the trail up to {{CDC_MINUTES}} minutes later, outside the business transaction.\n• A replication slot (or the change data capture tables) holds back the database's log while the connector is down: the database's disk has to be watched.",
581
+ "alternatives": "1. The catalogue alone: no pipeline, but changes made outside the operations go unrecorded.\n2. Database triggers writing every change into the audit table: no pipeline, but the actor has to travel in a session setting and every write pays for the trigger.\n3. The database's own audit (pgAudit, SQL Server Audit): it records statements rather than rows, kept by the database's administrators.",
582
+ "hubWhen": {
583
+ "SCOPE": [
584
+ "cdc"
585
+ ]
586
+ }
587
+ },
588
+ {
589
+ "id": "adr-hashes",
590
+ "type": "adr",
591
+ "label": "Records keep keyed hashes, not values",
592
+ "x": 780,
593
+ "y": 520,
594
+ "concern": "audit-trail",
595
+ "status": "accepted",
596
+ "date": "",
597
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
598
+ "decision": "An audit record names the fields a change touched and holds, for each, an HMAC-SHA-256 of the old and of the new value under an audit key kept in the key management service (AWS KMS, Azure Key Vault or Google Cloud KMS) and usable only by the element; the record never holds the values. The key's id is stored in each record, so the key can be rotated. A secret (password, token, key) is named as changed without any hash. To prove what a value was, an investigator computes the HMAC of the value from the business store or a backup and compares. The actor and target ids in the trail are internal ids; whether keeping them for the retention beside an erasure is covered by a legal obligation (GDPR Art. 17(3)(b)) is for the organisation's DPO to confirm.",
599
+ "consequences": "• The trail holds no personal values, so the erasure decided in the Personal data pack does not have to reach it; once a person's records are erased, the internal ids in the trail point to nobody.\n• An investigation needs the business store or a backup to learn what a value was; once the backup is gone, a record proves only that a field changed and whether a given value matches.\n• The audit key is a secret of its own: lost, no value can be checked; leaked, short values such as a birth date can be guessed back from their hashes.\n• Records stay small, whatever the size of the values.",
600
+ "alternatives": "1. The old and new values: readable without the business store, but personal data stays in a store nobody can edit.\n2. A plain SHA-256 without a key: anyone holding the trail can confirm a guessed e-mail address or name.\n3. Values encrypted under a key per person (crypto-shredding): readable until the person is erased, at the cost of a key lookup for every record.",
601
+ "hubWhen": {
602
+ "CONTENT": [
603
+ "hashes"
604
+ ]
605
+ }
606
+ },
607
+ {
608
+ "id": "adr-values",
609
+ "type": "adr",
610
+ "label": "Records keep the old and new values",
611
+ "x": 780,
612
+ "y": 650,
613
+ "concern": "audit-trail",
614
+ "status": "accepted",
615
+ "date": "",
616
+ "context": "This element runs operations that someone may later have to account for: money moved, customer records changed, permissions given, restricted data read or exported. The forces: a record written beside the change rather than with it goes missing exactly when something fails; whoever administers the store can edit what it holds unless the store refuses or the edit shows; a record detailed enough to answer an investigation holds personal data, which the trail then keeps for years; the people who read the trail are often among the people it records; clocks on different hosts disagree; and a trail kept for detection (a SIEM) is tuned for alerts and a short retention, not for evidence. Which sign-in and privileged-access events are audited is decided in the Authentication and Authorization packs, which write into this trail; operational logs and their retention belong to the Observability pack, redaction in log lines to the Error handling and logging conventions pack, and alerting on security events to the planned Security event logging and detection pack.",
617
+ "decision": "An audit record holds, as JSON, the old and new value of every field a change touched, except secrets (passwords, tokens, keys) and full card numbers, which are named as changed without a value; the exclusions are one list in src/audit, tested. Which fields hold personal data is taken from the classification the Personal data pack keeps; keeping those values for {{AUDIT_YEARS}} years rests on a legal obligation that the organisation's DPO or compliance officer has confirmed in writing (GDPR Art. 17(3)(b)), linked from this decision.",
618
+ "consequences": "• An investigation reads what changed from the trail alone, years later.\n• Personal values in the trail cannot be erased within the retention: an erasure request leaves them in place, which the DPO must accept and the privacy notice must say.\n• Records grow with the values: large documents are referenced by a hash, not copied.\n• A field that later becomes a secret or special-category data must join the exclusions before its first change is recorded.",
619
+ "alternatives": "1. Keyed hashes of the values: no personal data in the trail, proof only with the business store or a backup.\n2. Values encrypted under a key per person: erasable by destroying the key, more to run.",
620
+ "hubWhen": {
621
+ "CONTENT": [
622
+ "values"
623
+ ]
624
+ }
625
+ },
626
+ {
627
+ "id": "ff-catalogue",
628
+ "type": "fitness-fn",
629
+ "label": "Every audited call leaves a valid record",
630
+ "x": 1040,
631
+ "y": 0,
632
+ "characteristic": "security",
633
+ "scope": "atomic",
634
+ "cadence": "triggered",
635
+ "trigger": "pull-request",
636
+ "invocation": "automated",
637
+ "description": "A test lists the operations from the router (not from a list kept by hand) and fails on any that changes data but is neither audited nor exempt in audit/catalogue.yaml. It then calls each audited operation as a permitted and as a refused caller, reads the records written since the call, expects exactly one, and validates it against audit/record.schema.json, whose required fields are actor, action, target, outcome, at, correlationId, source and version.\n\nThreshold: 0 operations that change data outside the catalogue and the exemptions; exactly 1 record per call of each audited operation, permitted and refused, and 0 records rejected by audit/record.schema.json\n\nTool: Vitest with supertest, js-yaml and Ajv (or the test runner and HTTP client of your stack: JUnit with MockMvc and networknt json-schema-validator, xUnit with WebApplicationFactory)\n\n```ts\nimport { readFileSync } from 'node:fs'\nimport Ajv from 'ajv'\nimport { load } from 'js-yaml'\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes: the router's table\nimport { audit } from '../src/audit/store'\nimport { exampleBody, tokenFor } from './audit/fixtures'\n\nconst catalogue = load(readFileSync('audit/catalogue.yaml', 'utf8')) as { audited: string[]; exempt: Record<string, string> }\nconst validate = new Ajv({ allErrors: true }).compile(JSON.parse(readFileSync('audit/record.schema.json', 'utf8')))\nconst key = (r: { method: string; path: string }) => `${r.method} ${r.path}`\n\nit('names every operation that changes data as audited or exempt', () => {\n const writes = routes.filter((r) => r.method !== 'GET').map(key)\n expect(writes.filter((op) => !catalogue.audited.includes(op) && !(op in catalogue.exempt))).toEqual([])\n})\n\ndescribe.each(routes.filter((r) => catalogue.audited.includes(key(r))))('$method $path', (route) => {\n it.each(['permitted', 'refused'])('leaves one valid record when %s', async (who) => {\n const since = new Date()\n await request(app)[route.method.toLowerCase()](route.example).set('Authorization', `Bearer ${await tokenFor(who, route)}`).send(exampleBody(route))\n const records = await audit.find({ operation: key(route), since })\n expect(records).toHaveLength(1)\n expect(validate(records[0]), JSON.stringify(validate.errors)).toBe(true)\n })\n})\n```"
638
+ },
639
+ {
640
+ "id": "ff-atomic",
641
+ "type": "fitness-fn",
642
+ "label": "A failed record stops the change",
643
+ "x": 1040,
644
+ "y": 130,
645
+ "characteristic": "security",
646
+ "scope": "atomic",
647
+ "cadence": "triggered",
648
+ "trigger": "pull-request",
649
+ "invocation": "automated",
650
+ "description": "An integration test against the real database makes the audit writer fail once, calls an audited operation that changes a customer, and reads the customer back: the change must have been rolled back with the failed record. The audit writer runs on the business transaction's connection, which is what this test proves.\n\nThreshold: With the audit write failing, the operation answers 5xx and 0 business rows are changed\n\nTool: Vitest with supertest and a database started by Testcontainers (or the test runner of your stack with a spy on the audit writer)\n\n```ts\nimport request from 'supertest'\nimport { expect, it, vi } from 'vitest'\nimport { app } from '../src/app'\nimport { audit } from '../src/audit/store'\nimport { db } from './db'\nimport { createCustomer, tokenFor } from './audit/fixtures'\n\nit('commits no change without its audit record', async () => {\n const customer = await createCustomer({ email: 'before@example.test' })\n const append = vi.spyOn(audit, 'append').mockRejectedValueOnce(new Error('audit store unavailable'))\n const res = await request(app).patch(`/customers/${customer.id}`).send({ email: 'after@example.test' })\n .set('Authorization', `Bearer ${await tokenFor('support')}`)\n expect(append).toHaveBeenCalledOnce()\n expect(res.status).toBeGreaterThanOrEqual(500)\n const { rows } = await db.query('select email from customers where id = $1', [customer.id])\n expect(rows[0].email).toBe('before@example.test')\n})\n```"
651
+ },
652
+ {
653
+ "id": "ff-hashes",
654
+ "type": "fitness-fn",
655
+ "label": "Only keyed hashes in the trail",
656
+ "x": 1040,
657
+ "y": 260,
658
+ "characteristic": "security",
659
+ "scope": "atomic",
660
+ "cadence": "triggered",
661
+ "trigger": "pull-request",
662
+ "invocation": "automated",
663
+ "description": "An integration test changes a customer's e-mail address to a random value, reads the record, recomputes the HMAC with the test instance of the audit key, and searches a dump of the whole audit store (rows, outbox or shipped batches, as decided) for the value.\n\nThreshold: The new-value hash of a changed field equals HMAC-SHA-256 of the value under the test audit key; 0 occurrences of the value in the audit store\n\nTool: Vitest with supertest and node:crypto (or the test runner of your stack with its HMAC implementation)\n\n```ts\nimport { createHmac, randomUUID } from 'node:crypto'\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { audit } from '../src/audit/store'\nimport { auditKey, createCustomer, dumpAuditStore, tokenFor } from './audit/fixtures' // auditKey: the test instance of the key\n\nit('keeps a keyed hash of the new value and never the value', async () => {\n const customer = await createCustomer()\n const email = `${randomUUID()}@example.test`\n await request(app).patch(`/customers/${customer.id}`).send({ email })\n .set('Authorization', `Bearer ${await tokenFor('support')}`).expect(200)\n const [record] = await audit.find({ action: 'customer.update', target: { type: 'customer', id: customer.id } })\n const expected = createHmac('sha256', auditKey).update(email).digest('hex')\n expect(record.changes).toContainEqual(expect.objectContaining({ field: 'email', after: expected }))\n expect(await dumpAuditStore()).not.toContain(email)\n})\n```",
664
+ "hubWhen": {
665
+ "CONTENT": [
666
+ "hashes"
667
+ ]
668
+ }
669
+ },
670
+ {
671
+ "id": "ff-values",
672
+ "type": "fitness-fn",
673
+ "label": "Values kept, secrets not",
674
+ "x": 1040,
675
+ "y": 390,
676
+ "characteristic": "security",
677
+ "scope": "atomic",
678
+ "cadence": "triggered",
679
+ "trigger": "pull-request",
680
+ "invocation": "automated",
681
+ "description": "An integration test changes a customer's address and an account's password (a random value), reads both records, and searches a dump of the whole audit store for the password.\n\nThreshold: The record of an address change holds the old and new address; the record of a password change names the field with no value; 0 occurrences of the password in the audit store\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport { randomUUID } from 'node:crypto'\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { audit } from '../src/audit/store'\nimport { createAccount, createCustomer, dumpAuditStore, tokenFor } from './audit/fixtures'\n\nit('keeps old and new values and never a secret', async () => {\n const customer = await createCustomer({ address: 'Old Street 1' })\n const account = await createAccount()\n const password = `pw-${randomUUID()}`\n const auth = `Bearer ${await tokenFor('support')}`\n await request(app).patch(`/customers/${customer.id}`).send({ address: 'New Street 2' }).set('Authorization', auth).expect(200)\n await request(app).put(`/accounts/${account.id}/password`).send({ password }).set('Authorization', auth).expect(204)\n const [address] = await audit.find({ action: 'customer.update', target: { type: 'customer', id: customer.id } })\n expect(address.changes).toContainEqual({ field: 'address', before: 'Old Street 1', after: 'New Street 2' })\n const [secret] = await audit.find({ action: 'account.password.change', target: { type: 'account', id: account.id } })\n expect(secret.changes).toEqual([{ field: 'password' }])\n expect(await dumpAuditStore()).not.toContain(password)\n})\n```",
682
+ "hubWhen": {
683
+ "CONTENT": [
684
+ "values"
685
+ ]
686
+ }
687
+ },
688
+ {
689
+ "id": "ff-chain",
690
+ "type": "fitness-fn",
691
+ "label": "Hash chain verified",
692
+ "x": 1040,
693
+ "y": 520,
694
+ "characteristic": "security",
695
+ "scope": "atomic",
696
+ "cadence": "continual",
697
+ "invocation": "automated",
698
+ "description": "A scheduled job recomputes each row's hash with the same audit.canonical function the trigger uses, checks that every row points at the hash of the row before and that positions have no gap, then compares the heads copied to write-once storage over the last 30 days with the rows at their positions. Any finding names the first position affected and fails the job, which pages the audit owner. Positions below the oldest partition kept are skipped, since pg_partman dropped them after the retention.\n\nThreshold: Every {{VERIFY_HOURS}} hours: 0 rows whose hash differs from SHA-256(prev_hash ‖ canonical row), 0 breaks in prev_hash or chain_pos, and 0 copied heads that differ from the row at their position\n\nTool: bash with psql and the AWS CLI in a scheduled job (for an Azure container, az storage blob download in place of aws s3 cp)\n\n```bash\n#!/usr/bin/env bash\n# audit/verify-chain.sh: AUDIT_DATABASE_URL and HEADS_BUCKET are set by the scheduled job\nset -euo pipefail\nbroken=$(psql \"$AUDIT_DATABASE_URL\" -v ON_ERROR_STOP=1 -qAtc \"\n select chain_pos from (\n select chain_pos, hash, prev_hash, sha256(coalesce(prev_hash, ''::bytea) || audit.canonical(r)) as recomputed,\n lag(hash) over (order by chain_pos) as previous, lag(chain_pos) over (order by chain_pos) as previous_pos\n from audit.records r) c\n where hash <> recomputed\n or (previous_pos is not null and (chain_pos <> previous_pos + 1 or prev_hash is distinct from previous))\n order by chain_pos limit 1\")\n[ -z \"$broken\" ] || { echo \"audit chain broken at position $broken\"; exit 1; }\nfor day in $(seq 0 29); do\n key=\"heads/$(date -u -d \"-$day days\" +%F).txt\" # lines: <chain_pos> <hash in hex>, one per hour\n aws s3 cp \"s3://$HEADS_BUCKET/$key\" - 2>/dev/null || continue\ndone | while read -r pos hash; do\n stored=$(psql \"$AUDIT_DATABASE_URL\" -qAtc \"select encode(hash, 'hex') from audit.records where chain_pos = $pos\")\n [ -z \"$stored\" ] || [ \"$stored\" = \"$hash\" ] || { echo \"row $pos differs from its copied head\"; exit 1; }\ndone\n```",
699
+ "hubWhen": {
700
+ "STORE": [
701
+ "table"
702
+ ]
703
+ }
704
+ },
705
+ {
706
+ "id": "ff-table-append-only",
707
+ "type": "fitness-fn",
708
+ "label": "Audit table only appends and keeps",
709
+ "x": 1040,
710
+ "y": 650,
711
+ "characteristic": "security",
712
+ "scope": "atomic",
713
+ "cadence": "triggered",
714
+ "trigger": "pull-request",
715
+ "invocation": "automated",
716
+ "description": "A database test runs in CI after the migrations, as the table's owner: it checks the application role's privileges, appends one record, expects the append-only trigger to refuse an update and a delete of it, and reads the retention pg_partman applies to the table.\n\nThreshold: The application role holds only INSERT and SELECT on audit.records; an UPDATE and a DELETE by the table's owner are refused; pg_partman retention is {{AUDIT_YEARS}} years\n\nTool: pgTAP (run with pg_prove) with pg_partman 5\n\n```sql\nBEGIN;\nSELECT plan(5);\nSELECT table_privs_are('audit', 'records', 'app', ARRAY['INSERT', 'SELECT'], 'the application only appends and reads');\nSELECT lives_ok($$INSERT INTO audit.records (actor, action, target_type, target_id, outcome, correlation_id, source, version)\n VALUES ('test', 'test.append-only', 'test', '1', 'success', 'test', '{}', 1)$$, 'a record is appended');\nSELECT throws_ok($$UPDATE audit.records SET outcome = 'refused' WHERE action = 'test.append-only'$$,\n 'P0001', 'audit records are append-only', 'an update is refused, even for the owner');\nSELECT throws_ok($$DELETE FROM audit.records WHERE action = 'test.append-only'$$,\n 'P0001', 'audit records are append-only', 'a delete is refused, even for the owner');\nSELECT is((SELECT retention FROM partman.part_config WHERE parent_table = 'audit.records'), '{{AUDIT_YEARS}} years',\n 'partitions are dropped only after the retention');\nSELECT * FROM finish();\nROLLBACK;\n```",
717
+ "hubWhen": {
718
+ "STORE": [
719
+ "table"
720
+ ]
721
+ }
722
+ },
723
+ {
724
+ "id": "ff-object-lock",
725
+ "type": "fitness-fn",
726
+ "label": "Audit bucket locked for the retention",
727
+ "x": 1040,
728
+ "y": 780,
729
+ "characteristic": "security",
730
+ "scope": "atomic",
731
+ "cadence": "triggered",
732
+ "trigger": "pull-request",
733
+ "invocation": "automated",
734
+ "description": "A policy over the Terraform plan in CI fails when the audit bucket has no Object Lock configuration, when its default retention is in governance mode, or when it is shorter than the retention, so that no identity, the account's root user included, can change or delete a batch before it is due.\n\nThreshold: 0 audit buckets in the Terraform plan without an Object Lock configuration in compliance mode with a default retention of at least {{AUDIT_YEARS}} years\n\nTool: Conftest on the Terraform plan (terraform show -json); on Azure check azurerm_storage_container_immutability_policy (immutability_period_in_days, protected_append_writes_enabled false, locked), on Google Cloud google_storage_bucket retention_policy with is_locked = true\n\n```rego\npackage main\n\nimport rego.v1\n\nmin_days := {{AUDIT_YEARS}} * 365\n\nlocks := [r | some r in input.resource_changes; r.type == \"aws_s3_bucket_object_lock_configuration\"]\n\ndeny contains \"no Object Lock configuration on the audit bucket\" if count(locks) == 0\n\ndeny contains msg if {\n\tsome l in locks\n\tsome rule in l.change.after.rule\n\tsome retention in rule.default_retention\n\tretention.mode != \"COMPLIANCE\"\n\tmsg := sprintf(\"%s is not in compliance mode\", [l.address])\n}\n\ndeny contains msg if {\n\tsome l in locks\n\tsome rule in l.change.after.rule\n\tsome retention in rule.default_retention\n\tnumber_or_zero(retention.years) * 365 + number_or_zero(retention.days) < min_days\n\tmsg := sprintf(\"%s keeps audit records for less than %d days\", [l.address, min_days])\n}\n\nnumber_or_zero(x) := x if is_number(x)\n\nnumber_or_zero(x) := 0 if not is_number(x)\n```",
735
+ "hubWhen": {
736
+ "STORE": [
737
+ "worm"
738
+ ]
739
+ }
740
+ },
741
+ {
742
+ "id": "ff-batches",
743
+ "type": "fitness-fn",
744
+ "label": "No batch missing, nothing left behind",
745
+ "x": 1040,
746
+ "y": 910,
747
+ "characteristic": "security",
748
+ "scope": "atomic",
749
+ "cadence": "continual",
750
+ "invocation": "automated",
751
+ "description": "A scheduled job lists the element's batches, sorts them by first record number and fails on the first gap, which a batch hidden by a delete marker also shows as; it then counts the outbox rows waiting longer than the shipping limit. A failure pages the audit owner.\n\nThreshold: Every {{VERIFY_HOURS}} hours: 0 gaps between the record numbers of the listed batches, and 0 outbox rows older than {{SHIP_MINUTES}} minutes\n\nTool: bash with the AWS CLI, jq and psql in a scheduled job (for Azure, az storage blob list --query \"[].name\" in place of aws s3api list-objects-v2)\n\n```bash\n#!/usr/bin/env bash\n# audit/verify-batches.sh: AUDIT_BUCKET, ELEMENT and DATABASE_URL are set by the scheduled job\nset -euo pipefail\naws s3api list-objects-v2 --bucket \"$AUDIT_BUCKET\" --prefix \"audit/$ELEMENT/\" --query 'Contents[].Key' --output json > keys.json\ngap=$(jq -r '\n [ (. // [])[] | capture(\"/(?<first>[0-9]+)-(?<last>[0-9]+)\\\\.jsonl\\\\.gz$\") | {first: (.first | tonumber), last: (.last | tonumber)} ]\n | sort_by(.first)\n | [ range(1; length) as $i | select(.[$i].first != .[$i - 1].last + 1) | .[$i - 1].last + 1 ]\n | first // empty' keys.json)\n[ -z \"$gap\" ] || { echo \"audit batches missing from record $gap\"; exit 1; }\nwaiting=$(psql \"$DATABASE_URL\" -qAtc \"select count(*) from audit_outbox where created_at < now() - interval '{{SHIP_MINUTES}} minutes'\")\n[ \"$waiting\" -eq 0 ] || { echo \"$waiting audit records waited more than {{SHIP_MINUTES}} minutes to be shipped\"; exit 1; }\n```",
752
+ "hubWhen": {
753
+ "STORE": [
754
+ "worm"
755
+ ]
756
+ }
757
+ },
758
+ {
759
+ "id": "ff-ledger",
760
+ "type": "fitness-fn",
761
+ "label": "Ledger verified against its digests",
762
+ "x": 1040,
763
+ "y": 1040,
764
+ "characteristic": "security",
765
+ "scope": "atomic",
766
+ "cadence": "continual",
767
+ "invocation": "automated",
768
+ "description": "A scheduled job checks in the catalog views that the audit table is an append-only ledger table (so updates and deletes are refused by the database) and that a current digest location exists, runs the ledger verification over every digest location, and reads the immutability policy of the container that holds the digests. Any failure ends the job with an error and pages the audit owner.\n\nThreshold: Every {{VERIFY_HOURS}} hours: audit.records is an APPEND_ONLY_LEDGER_TABLE, automatic digest storage is on, ledger verification succeeds, and the digest container's immutability policy is Locked for at least {{AUDIT_YEARS}} × 365 days\n\nTool: bash with sqlcmd (-b ends on the first error) and the Azure CLI in a scheduled job or an Elastic Job\n\n```bash\n#!/usr/bin/env bash\n# audit/verify-ledger.sh: SQLCMDSERVER, SQLCMDDATABASE, the sign-in and DIGEST_ACCOUNT are set by the scheduled job\nset -euo pipefail\nsqlcmd -b -Q \"\nSET NOCOUNT ON;\nIF NOT EXISTS (SELECT 1 FROM sys.tables WHERE SCHEMA_NAME(schema_id) = 'audit' AND name = 'records' AND ledger_type_desc = 'APPEND_ONLY_LEDGER_TABLE')\n THROW 50001, 'audit.records is not an append-only ledger table', 1;\nIF NOT EXISTS (SELECT 1 FROM sys.database_ledger_digest_locations WHERE is_current = 1)\n THROW 50002, 'automatic digest storage is off', 1;\nDECLARE @digest_locations NVARCHAR(MAX) = (SELECT * FROM sys.database_ledger_digest_locations FOR JSON AUTO, INCLUDE_NULL_VALUES);\nEXECUTE sys.sp_verify_database_ledger_from_digest_storage @digest_locations;\"\nread -r state days < <(az storage container immutability-policy show --account-name \"$DIGEST_ACCOUNT\" \\\n --container-name sqldbledgerdigests --query '[state, immutabilityPeriodSinceCreationInDays]' -o tsv)\n[ \"$state\" = Locked ] && [ \"$days\" -ge $(( {{AUDIT_YEARS}} * 365 )) ] || { echo \"digest container policy is $state for $days days\"; exit 1; }\n```",
769
+ "hubWhen": {
770
+ "STORE": [
771
+ "ledger"
772
+ ]
773
+ }
774
+ },
775
+ {
776
+ "id": "ff-readers",
777
+ "type": "fitness-fn",
778
+ "label": "Only the decided readers read, and reads are recorded",
779
+ "x": 1040,
780
+ "y": 1170,
781
+ "characteristic": "security",
782
+ "scope": "atomic",
783
+ "cadence": "triggered",
784
+ "trigger": "pull-request",
785
+ "invocation": "automated",
786
+ "description": "audit/readers.yaml names the role that may read the trail (the audit role or the team, as decided) and, for the team, whom the monthly report of reads goes to. A test searches the trail as a member of another team and as a customer, expects 403, searches as a reader, and checks the record of the read and, where reads are reported, the report.\n\nThreshold: A search of the audit trail by a caller outside audit/readers.yaml is refused with 403; one by a reader succeeds and leaves exactly 1 audit.read record naming the reader and the filter; where reads are reported, the month's report lists it\n\nTool: Vitest with supertest and js-yaml (or the test runner and HTTP client of your stack)\n\n```ts\nimport { readFileSync } from 'node:fs'\nimport { load } from 'js-yaml'\nimport request from 'supertest'\nimport { app } from '../src/app'\nimport { audit } from '../src/audit/store'\nimport { monthlyReadReport, tokenFor } from './audit/fixtures'\n\nconst readers = load(readFileSync('audit/readers.yaml', 'utf8')) as { role: string; reportTo?: string }\nconst search = async (who: string) => request(app).get('/audit/records?target=customer:42')\n .set('Authorization', `Bearer ${await tokenFor(who)}`)\n\nit('lets only the decided readers search, and records each search', async () => {\n for (const outsider of ['other-team', 'customer']) expect((await search(outsider)).status).toBe(403)\n const since = new Date()\n expect((await search(readers.role)).status).toBe(200)\n const reads = await audit.find({ action: 'audit.read', since })\n expect(reads).toHaveLength(1)\n expect(reads[0]).toMatchObject({ actor: { role: readers.role }, details: { filter: 'target=customer:42' } })\n if (readers.reportTo) expect(await monthlyReadReport()).toContainEqual(expect.objectContaining({ id: reads[0].id }))\n})\n```"
787
+ },
788
+ {
789
+ "id": "ff-clock",
790
+ "type": "fitness-fn",
791
+ "label": "Clocks in step with UTC",
792
+ "x": 1040,
793
+ "y": 1300,
794
+ "characteristic": "security",
795
+ "scope": "atomic",
796
+ "cadence": "continual",
797
+ "invocation": "automated",
798
+ "description": "A check on every host that writes audit records (a cron job or the monitoring agent's script check, which pages on failure) reads chrony's tracking report and fails when the clock is not synchronised or its offset from NTP time is over the limit. On a managed runtime without host access (AWS Lambda, Fargate, Cloud Run) the provider keeps the clock, and the check runs on the hosts the team does run.\n\nThreshold: On every host that writes audit records, every 5 minutes: chrony is synchronised and its system time offset is within {{CLOCK_MS}} ms\n\nTool: bash with chronyc (chrony 4), as a cron job or a monitoring agent's script check\n\n```bash\n#!/usr/bin/env bash\n# audit/check-clock.sh, every 5 minutes on each host that writes audit records\nset -euo pipefail\ntracking=$(chronyc tracking)\nleap=$(awk -F' *: ' '/^Leap status/ {print $2}' <<< \"$tracking\")\noffset=$(awk '/^System time/ {print $4}' <<< \"$tracking\") # seconds, fast or slow of NTP time\n[ \"$leap\" != \"Not synchronised\" ] || { echo \"clock not synchronised\"; exit 1; }\nawk -v s=\"$offset\" -v max=\"{{CLOCK_MS}}\" 'BEGIN { exit !(s * 1000 <= max) }' \\\n || { echo \"clock is ${offset}s off NTP time, over {{CLOCK_MS}} ms\"; exit 1; }\n```"
799
+ },
800
+ {
801
+ "id": "ff-cdc",
802
+ "type": "fitness-fn",
803
+ "label": "Direct writes reach the trail",
804
+ "x": 1040,
805
+ "y": 1430,
806
+ "characteristic": "security",
807
+ "scope": "holistic",
808
+ "cadence": "continual",
809
+ "invocation": "automated",
810
+ "description": "A scheduled job asks Kafka Connect for the connector's status, writes a canary row straight into the database (outside the element, so with no transaction context), and polls the element's audit read operation until the change appears as unattributed, failing past the limit. The job's own searches are recorded like any read.\n\nThreshold: Every hour: the connector and all its tasks are RUNNING, and a canary row written outside the element appears in the audit trail as unattributed within {{CDC_MINUTES}} minutes\n\nTool: bash with curl, jq and psql in a scheduled job (sqlcmd -Q on SQL Server), against the Kafka Connect REST API\n\n```bash\n#!/usr/bin/env bash\n# audit/canary-cdc.sh: CONNECT_URL, CONNECTOR, DATABASE_URL, APP_URL and AUDIT_READER_TOKEN are set by the scheduled job\nset -euo pipefail\ncurl -fsS \"$CONNECT_URL/connectors/$CONNECTOR/status\" \\\n | jq -e '.connector.state == \"RUNNING\" and all(.tasks[]; .state == \"RUNNING\")' > /dev/null \\\n || { echo \"connector $CONNECTOR is not running\"; exit 1; }\nid=$(psql \"$DATABASE_URL\" -qAtc \"insert into audit_canary (touched_at) values (now()) returning id\")\ndeadline=$(( $(date +%s) + {{CDC_MINUTES}} * 60 ))\nuntil curl -fsS -H \"Authorization: Bearer $AUDIT_READER_TOKEN\" \"$APP_URL/audit/records?target=audit_canary:$id\" \\\n | jq -e '.items[] | select(.actor == \"unattributed\")' > /dev/null; do\n [ \"$(date +%s)\" -lt \"$deadline\" ] || { echo \"canary write $id not in the audit trail after {{CDC_MINUTES}} minutes\"; exit 1; }\n sleep 30\ndone\n```",
811
+ "hubWhen": {
812
+ "SCOPE": [
813
+ "cdc"
814
+ ]
815
+ }
816
+ }
817
+ ],
818
+ "relations": [
819
+ {
820
+ "id": "req-catalogue--derives--need",
821
+ "sourceId": "req-catalogue",
822
+ "targetId": "need",
823
+ "relationType": "derives"
824
+ },
825
+ {
826
+ "id": "req-record--derives--need",
827
+ "sourceId": "req-record",
828
+ "targetId": "need",
829
+ "relationType": "derives"
830
+ },
831
+ {
832
+ "id": "req-atomic--derives--need",
833
+ "sourceId": "req-atomic",
834
+ "targetId": "need",
835
+ "relationType": "derives"
836
+ },
837
+ {
838
+ "id": "req-hashes--derives--need",
839
+ "sourceId": "req-hashes",
840
+ "targetId": "need",
841
+ "relationType": "derives"
842
+ },
843
+ {
844
+ "id": "req-values--derives--need",
845
+ "sourceId": "req-values",
846
+ "targetId": "need",
847
+ "relationType": "derives"
848
+ },
849
+ {
850
+ "id": "req-clock--derives--need",
851
+ "sourceId": "req-clock",
852
+ "targetId": "need",
853
+ "relationType": "derives"
854
+ },
855
+ {
856
+ "id": "req-append-only--derives--need",
857
+ "sourceId": "req-append-only",
858
+ "targetId": "need",
859
+ "relationType": "derives"
860
+ },
861
+ {
862
+ "id": "req-tamper--derives--need",
863
+ "sourceId": "req-tamper",
864
+ "targetId": "need",
865
+ "relationType": "derives"
866
+ },
867
+ {
868
+ "id": "req-retention--derives--need",
869
+ "sourceId": "req-retention",
870
+ "targetId": "need",
871
+ "relationType": "derives"
872
+ },
873
+ {
874
+ "id": "req-readers-auditors--derives--need",
875
+ "sourceId": "req-readers-auditors",
876
+ "targetId": "need",
877
+ "relationType": "derives"
878
+ },
879
+ {
880
+ "id": "req-readers-team--derives--need",
881
+ "sourceId": "req-readers-team",
882
+ "targetId": "need",
883
+ "relationType": "derives"
884
+ },
885
+ {
886
+ "id": "req-reads-recorded--derives--need",
887
+ "sourceId": "req-reads-recorded",
888
+ "targetId": "need",
889
+ "relationType": "derives"
890
+ },
891
+ {
892
+ "id": "req-cdc--derives--need",
893
+ "sourceId": "req-cdc",
894
+ "targetId": "need",
895
+ "relationType": "derives"
896
+ },
897
+ {
898
+ "id": "sc-catalogue--verifies--req-catalogue",
899
+ "sourceId": "sc-catalogue",
900
+ "targetId": "req-catalogue",
901
+ "relationType": "verifies"
902
+ },
903
+ {
904
+ "id": "sc-record--verifies--req-record",
905
+ "sourceId": "sc-record",
906
+ "targetId": "req-record",
907
+ "relationType": "verifies"
908
+ },
909
+ {
910
+ "id": "sc-atomic--verifies--req-atomic",
911
+ "sourceId": "sc-atomic",
912
+ "targetId": "req-atomic",
913
+ "relationType": "verifies"
914
+ },
915
+ {
916
+ "id": "sc-hashes--verifies--req-hashes",
917
+ "sourceId": "sc-hashes",
918
+ "targetId": "req-hashes",
919
+ "relationType": "verifies"
920
+ },
921
+ {
922
+ "id": "sc-values--verifies--req-values",
923
+ "sourceId": "sc-values",
924
+ "targetId": "req-values",
925
+ "relationType": "verifies"
926
+ },
927
+ {
928
+ "id": "sc-clock--verifies--req-clock",
929
+ "sourceId": "sc-clock",
930
+ "targetId": "req-clock",
931
+ "relationType": "verifies"
932
+ },
933
+ {
934
+ "id": "sc-append-only--verifies--req-append-only",
935
+ "sourceId": "sc-append-only",
936
+ "targetId": "req-append-only",
937
+ "relationType": "verifies"
938
+ },
939
+ {
940
+ "id": "sc-tamper--verifies--req-tamper",
941
+ "sourceId": "sc-tamper",
942
+ "targetId": "req-tamper",
943
+ "relationType": "verifies"
944
+ },
945
+ {
946
+ "id": "sc-retention--verifies--req-retention",
947
+ "sourceId": "sc-retention",
948
+ "targetId": "req-retention",
949
+ "relationType": "verifies"
950
+ },
951
+ {
952
+ "id": "sc-readers-auditors--verifies--req-readers-auditors",
953
+ "sourceId": "sc-readers-auditors",
954
+ "targetId": "req-readers-auditors",
955
+ "relationType": "verifies"
956
+ },
957
+ {
958
+ "id": "sc-readers-team--verifies--req-readers-team",
959
+ "sourceId": "sc-readers-team",
960
+ "targetId": "req-readers-team",
961
+ "relationType": "verifies"
962
+ },
963
+ {
964
+ "id": "sc-reads-recorded--verifies--req-reads-recorded",
965
+ "sourceId": "sc-reads-recorded",
966
+ "targetId": "req-reads-recorded",
967
+ "relationType": "verifies"
968
+ },
969
+ {
970
+ "id": "sc-cdc--verifies--req-cdc",
971
+ "sourceId": "sc-cdc",
972
+ "targetId": "req-cdc",
973
+ "relationType": "verifies"
974
+ },
975
+ {
976
+ "id": "ff-catalogue--implements--adr-table",
977
+ "sourceId": "ff-catalogue",
978
+ "targetId": "adr-table",
979
+ "relationType": "implements"
980
+ },
981
+ {
982
+ "id": "ff-catalogue--implements--adr-worm",
983
+ "sourceId": "ff-catalogue",
984
+ "targetId": "adr-worm",
985
+ "relationType": "implements"
986
+ },
987
+ {
988
+ "id": "ff-catalogue--implements--adr-ledger",
989
+ "sourceId": "ff-catalogue",
990
+ "targetId": "adr-ledger",
991
+ "relationType": "implements"
992
+ },
993
+ {
994
+ "id": "ff-atomic--implements--adr-table",
995
+ "sourceId": "ff-atomic",
996
+ "targetId": "adr-table",
997
+ "relationType": "implements"
998
+ },
999
+ {
1000
+ "id": "ff-atomic--implements--adr-worm",
1001
+ "sourceId": "ff-atomic",
1002
+ "targetId": "adr-worm",
1003
+ "relationType": "implements"
1004
+ },
1005
+ {
1006
+ "id": "ff-atomic--implements--adr-ledger",
1007
+ "sourceId": "ff-atomic",
1008
+ "targetId": "adr-ledger",
1009
+ "relationType": "implements"
1010
+ },
1011
+ {
1012
+ "id": "ff-hashes--implements--adr-hashes",
1013
+ "sourceId": "ff-hashes",
1014
+ "targetId": "adr-hashes",
1015
+ "relationType": "implements"
1016
+ },
1017
+ {
1018
+ "id": "ff-values--implements--adr-values",
1019
+ "sourceId": "ff-values",
1020
+ "targetId": "adr-values",
1021
+ "relationType": "implements"
1022
+ },
1023
+ {
1024
+ "id": "ff-chain--implements--adr-table",
1025
+ "sourceId": "ff-chain",
1026
+ "targetId": "adr-table",
1027
+ "relationType": "implements"
1028
+ },
1029
+ {
1030
+ "id": "ff-table-append-only--implements--adr-table",
1031
+ "sourceId": "ff-table-append-only",
1032
+ "targetId": "adr-table",
1033
+ "relationType": "implements"
1034
+ },
1035
+ {
1036
+ "id": "ff-object-lock--implements--adr-worm",
1037
+ "sourceId": "ff-object-lock",
1038
+ "targetId": "adr-worm",
1039
+ "relationType": "implements"
1040
+ },
1041
+ {
1042
+ "id": "ff-batches--implements--adr-worm",
1043
+ "sourceId": "ff-batches",
1044
+ "targetId": "adr-worm",
1045
+ "relationType": "implements"
1046
+ },
1047
+ {
1048
+ "id": "ff-ledger--implements--adr-ledger",
1049
+ "sourceId": "ff-ledger",
1050
+ "targetId": "adr-ledger",
1051
+ "relationType": "implements"
1052
+ },
1053
+ {
1054
+ "id": "ff-readers--implements--adr-table",
1055
+ "sourceId": "ff-readers",
1056
+ "targetId": "adr-table",
1057
+ "relationType": "implements"
1058
+ },
1059
+ {
1060
+ "id": "ff-readers--implements--adr-worm",
1061
+ "sourceId": "ff-readers",
1062
+ "targetId": "adr-worm",
1063
+ "relationType": "implements"
1064
+ },
1065
+ {
1066
+ "id": "ff-readers--implements--adr-ledger",
1067
+ "sourceId": "ff-readers",
1068
+ "targetId": "adr-ledger",
1069
+ "relationType": "implements"
1070
+ },
1071
+ {
1072
+ "id": "ff-clock--implements--adr-table",
1073
+ "sourceId": "ff-clock",
1074
+ "targetId": "adr-table",
1075
+ "relationType": "implements"
1076
+ },
1077
+ {
1078
+ "id": "ff-clock--implements--adr-worm",
1079
+ "sourceId": "ff-clock",
1080
+ "targetId": "adr-worm",
1081
+ "relationType": "implements"
1082
+ },
1083
+ {
1084
+ "id": "ff-clock--implements--adr-ledger",
1085
+ "sourceId": "ff-clock",
1086
+ "targetId": "adr-ledger",
1087
+ "relationType": "implements"
1088
+ },
1089
+ {
1090
+ "id": "ff-cdc--implements--adr-cdc",
1091
+ "sourceId": "ff-cdc",
1092
+ "targetId": "adr-cdc",
1093
+ "relationType": "implements"
1094
+ }
1095
+ ]
1096
+ }