@radicaltools/cli 0.6.0 → 0.6.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.
- package/README.md +46 -7
- package/dist/{chunk-CWKX2ULF.js → chunk-5EK2V6G3.js} +1 -1
- package/dist/{dist-KTTOUFHF.js → dist-BJQ35APN.js} +2 -2
- package/dist/hub-catalogue/concern/concern-accessibility.radical +85 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-errors.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +121 -3
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +78 -1
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +83 -7
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +77 -1
- package/dist/hub-catalogue/concern/concern-authentication.radical +178 -8
- package/dist/hub-catalogue/concern/concern-authorization.radical +133 -7
- package/dist/hub-catalogue/concern/concern-availability.radical +156 -6
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +71 -8
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +136 -6
- package/dist/hub-catalogue/concern/concern-caching.radical +73 -1
- package/dist/hub-catalogue/concern/concern-capacity.radical +124 -5
- package/dist/hub-catalogue/concern/concern-ci-cd-pipeline.radical +154 -15
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +131 -13
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +116 -7
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +174 -13
- package/dist/hub-catalogue/concern/concern-code-style.radical +148 -16
- package/dist/hub-catalogue/concern/concern-communication-style.radical +94 -7
- package/dist/hub-catalogue/concern/concern-data-classification.radical +77 -1
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +87 -5
- package/dist/hub-catalogue/concern/concern-data-store.radical +87 -5
- package/dist/hub-catalogue/concern/concern-decomposition.radical +78 -1
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +150 -11
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +130 -5
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +127 -10
- package/dist/hub-catalogue/concern/concern-deployment.radical +113 -9
- package/dist/hub-catalogue/concern/concern-encryption.radical +146 -5
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +118 -12
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +69 -1
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +148 -9
- package/dist/hub-catalogue/concern/concern-incident-management.radical +122 -1
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +54 -1
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +110 -5
- package/dist/hub-catalogue/concern/concern-messaging.radical +89 -2
- package/dist/hub-catalogue/concern/concern-mobile-performance.radical +67 -1
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +92 -5
- package/dist/hub-catalogue/concern/concern-observability.radical +105 -1
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +140 -5
- package/dist/hub-catalogue/concern/concern-personal-data.radical +206 -7
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +104 -12
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +110 -1
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +99 -7
- package/dist/hub-catalogue/concern/concern-retention.radical +130 -9
- package/dist/hub-catalogue/concern/concern-secrets.radical +196 -12
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +122 -1
- package/dist/hub-catalogue/concern/concern-secure-development.radical +118 -1
- package/dist/hub-catalogue/concern/concern-security-detection.radical +124 -1
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +116 -1
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +162 -19
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +152 -18
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +111 -1
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +83 -7
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +120 -1
- package/dist/hub-catalogue/concern/concern-usability.radical +84 -5
- package/dist/index.js +299 -100
- package/dist/{pdfjs-ABY3IR7F.js → pdfjs-4U3YUAVN.js} +1 -1
- package/dist/{undici-7Z7ZFI7Q.js → undici-7IHHEPSO.js} +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,126 @@
|
|
|
19
19
|
"trigger": "LIST RELATIONS WHERE target.external != true AND (target.type = \"database\" OR target.type = \"queue\" OR ((source.type = \"person\" OR source.external = true) AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")))",
|
|
20
20
|
"applyTo": "target",
|
|
21
21
|
"why": "data reaches these elements from outside or is stored in them, so how it is encrypted on the wire and on disk, and who holds the keys, has to be decided.",
|
|
22
|
-
"group": "security"
|
|
22
|
+
"group": "security",
|
|
23
|
+
"scope": {
|
|
24
|
+
"group": "security",
|
|
25
|
+
"questions": [
|
|
26
|
+
{
|
|
27
|
+
"key": "EXPOSURE",
|
|
28
|
+
"label": "Who can reach it?",
|
|
29
|
+
"default": "customers",
|
|
30
|
+
"hint": "The more strangers can reach it, the more attacks it meets that need no inside knowledge (Microsoft SDL asks this first).",
|
|
31
|
+
"options": [
|
|
32
|
+
{
|
|
33
|
+
"value": "staff",
|
|
34
|
+
"label": "only our own staff",
|
|
35
|
+
"description": "An internal system: everyone who reaches it works for the organisation that runs it, from its network or with its accounts."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"value": "customers",
|
|
39
|
+
"label": "our customers and staff",
|
|
40
|
+
"description": "People who come to us for a service (to book, order, pay, look something up) and our staff; there is no open sign-up, community or API for strangers."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"value": "public",
|
|
44
|
+
"label": "anyone, at scale",
|
|
45
|
+
"description": "Open sign-up, a public API, content anyone can post, or so many users that bots and automated abuse come with them."
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"key": "DATA",
|
|
51
|
+
"label": "What would a leak of its data harm?",
|
|
52
|
+
"default": "ordinary",
|
|
53
|
+
"hint": "The most sensitive data it keeps decides (FIPS 199 confidentiality; GDPR Art. 9 for special categories).",
|
|
54
|
+
"options": [
|
|
55
|
+
{
|
|
56
|
+
"value": "none",
|
|
57
|
+
"label": "nothing: nothing private",
|
|
58
|
+
"description": "Public information only, and staff sign-in."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": "ordinary",
|
|
62
|
+
"label": "little: ordinary personal or business data",
|
|
63
|
+
"description": "Names, e-mail addresses, orders, ordinary business documents: a leak is unpleasant, not ruinous."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"value": "confidential",
|
|
67
|
+
"label": "a lot: confidential data",
|
|
68
|
+
"description": "Financial or account data, identity numbers, location, private messages, trade secrets or customer lists: a leak seriously harms people or the business."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"value": "special",
|
|
72
|
+
"label": "people deeply: special categories",
|
|
73
|
+
"description": "Health, biometrics, genetic data, religion, politics, sexual orientation, union membership, criminal records, or children's data (GDPR Art. 9 and 10)."
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"key": "TENANCY",
|
|
79
|
+
"label": "How many customer organisations does one running copy serve?",
|
|
80
|
+
"default": "one",
|
|
81
|
+
"hint": "Several organisations in one deployment means one missed filter shows one customer another's data (AWS SaaS Lens).",
|
|
82
|
+
"options": [
|
|
83
|
+
{
|
|
84
|
+
"value": "one",
|
|
85
|
+
"label": "one organisation",
|
|
86
|
+
"description": "It serves one organisation (a shop, a company, a public body), however many people use it."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"value": "shared",
|
|
90
|
+
"label": "several, sharing",
|
|
91
|
+
"description": "Several customer organisations (tenants) share the same deployment and data stores, kept apart by the software."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"value": "separate",
|
|
95
|
+
"label": "several, each its own",
|
|
96
|
+
"description": "Several customer organisations, each with its own database or its own copy of the system."
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"key": "CAPACITY",
|
|
102
|
+
"label": "Who looks after its IT and security?",
|
|
103
|
+
"default": "ig1",
|
|
104
|
+
"hint": "What an organisation can run decides how much security practice it can keep up (CIS Controls Implementation Groups 1 to 3).",
|
|
105
|
+
"options": [
|
|
106
|
+
{
|
|
107
|
+
"value": "ig1",
|
|
108
|
+
"label": "the people who build it",
|
|
109
|
+
"description": "A few people who build it; nobody works on IT or security full time (CIS IG1)."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"value": "ig2",
|
|
113
|
+
"label": "people who run IT",
|
|
114
|
+
"description": "There are people whose job includes running and protecting the infrastructure; several departments rely on it (CIS IG2)."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"value": "ig3",
|
|
118
|
+
"label": "security specialists",
|
|
119
|
+
"description": "A security team or specialists of their own (security operations, penetration testers), under regulators' eyes (CIS IG3)."
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"scopeAnswers": [
|
|
126
|
+
{
|
|
127
|
+
"when": {
|
|
128
|
+
"DATA": [
|
|
129
|
+
"none",
|
|
130
|
+
"ordinary"
|
|
131
|
+
],
|
|
132
|
+
"CAPACITY": [
|
|
133
|
+
"ig1"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"answers": {
|
|
137
|
+
"INTERNAL": "private",
|
|
138
|
+
"AT_REST": "provider"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
23
142
|
},
|
|
24
143
|
"sources": [
|
|
25
144
|
{
|
|
@@ -159,7 +278,13 @@
|
|
|
159
278
|
"label": "from our own or a commercial CA, renewed by a tracked process",
|
|
160
279
|
"description": "Certificates from the company's PKI or a commercial CA (EV/OV), with an inventory and alerts before expiry. Pick it when partners pin your CA, a regulator requires one, or the endpoint cannot run ACME."
|
|
161
280
|
}
|
|
162
|
-
]
|
|
281
|
+
],
|
|
282
|
+
"scopeWhen": {
|
|
283
|
+
"CAPACITY": [
|
|
284
|
+
"ig2",
|
|
285
|
+
"ig3"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
163
288
|
},
|
|
164
289
|
{
|
|
165
290
|
"key": "KEY_ROTATE_DAYS",
|
|
@@ -208,6 +333,10 @@
|
|
|
208
333
|
"hubWhen": {
|
|
209
334
|
"TLS": [
|
|
210
335
|
"modern"
|
|
336
|
+
],
|
|
337
|
+
"CERTS": [
|
|
338
|
+
"acme",
|
|
339
|
+
"managed-ca"
|
|
211
340
|
]
|
|
212
341
|
}
|
|
213
342
|
},
|
|
@@ -224,6 +353,10 @@
|
|
|
224
353
|
"hubWhen": {
|
|
225
354
|
"TLS": [
|
|
226
355
|
"intermediate"
|
|
356
|
+
],
|
|
357
|
+
"CERTS": [
|
|
358
|
+
"acme",
|
|
359
|
+
"managed-ca"
|
|
227
360
|
]
|
|
228
361
|
}
|
|
229
362
|
},
|
|
@@ -427,6 +560,10 @@
|
|
|
427
560
|
"hubWhen": {
|
|
428
561
|
"TLS": [
|
|
429
562
|
"modern"
|
|
563
|
+
],
|
|
564
|
+
"CERTS": [
|
|
565
|
+
"acme",
|
|
566
|
+
"managed-ca"
|
|
430
567
|
]
|
|
431
568
|
}
|
|
432
569
|
},
|
|
@@ -442,6 +579,10 @@
|
|
|
442
579
|
"hubWhen": {
|
|
443
580
|
"TLS": [
|
|
444
581
|
"intermediate"
|
|
582
|
+
],
|
|
583
|
+
"CERTS": [
|
|
584
|
+
"acme",
|
|
585
|
+
"managed-ca"
|
|
445
586
|
]
|
|
446
587
|
}
|
|
447
588
|
},
|
|
@@ -625,7 +766,7 @@
|
|
|
625
766
|
"status": "accepted",
|
|
626
767
|
"date": "",
|
|
627
768
|
"context": "Data reaches this element from people or other systems, or is kept in it. The forces: traffic is read or changed wherever it crosses a network someone else controls, and \"inside our network\" stops being true with the first misconfigured peering, mirror port or compromised host; old protocol versions and cipher suites stay enabled for years after they are broken; disks, snapshots and backups leave the system in ways nobody tracks; whoever holds the keys can read the data, so who controls them (the provider, us, or only the application) decides who can be compelled or tricked into reading it; certificates and keys that expire or are never rotated cause outages or stay useful to an attacker for years. Snippets assume Terraform under infra/ (plans read with terraform show -json), Kubernetes and Istio manifests rendered under manifests/, the public endpoints listed one host per line in endpoints.txt, internal ones as host:port in internal-endpoints.txt, certificates issued by hand in cert-inventory.txt, and the application under src/ with its tests under tests/. The cloud snippets (Config rules, key policy, key rotation and age, private network) are for AWS; each tool line names the Azure and Google equivalent.",
|
|
628
|
-
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS)
|
|
769
|
+
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS). Between our own elements, an Istio service mesh with a mesh-wide PeerAuthentication in STRICT mode encrypts and authenticates every hop with mutual TLS and workload certificates that expire within 24 hours (Istio's default lifetime); databases and managed queues outside the mesh are reached with TLS and certificate verification. Istio runs with sidecars, or in ambient mode when the sidecars' cost matters; its CA can chain to the company's PKI through a plugged-in intermediate.",
|
|
629
770
|
"consequences": "• Every hop is encrypted and authenticated without changes to the code.\n• Callers inside get identities that authorisation policies can use.\n• The mesh is on every request's path: its upgrades and its CA are now critical.\n• Traffic to managed services outside the mesh still needs its own TLS settings.\n• Where TLS 1.2 is still offered to outside callers, whether it can be dropped is reviewed once a year.",
|
|
630
771
|
"alternatives": "1. Linkerd: the least to run, mutual TLS on by default; its policy resources differ (Server, default inbound policy all-authenticated), so the checks would be rewritten for it.\n2. Cilium mutual authentication with WireGuard encryption: no sidecars where Cilium already runs as the network plugin, with a different identity model to check.\n3. TLS on every connection, configured per element: no mesh to run, but no caller identity and more places to get wrong.\n4. Clear text inside a private network: simplest, and safe only while the network is ours alone.",
|
|
631
772
|
"hubWhen": {
|
|
@@ -644,7 +785,7 @@
|
|
|
644
785
|
"status": "accepted",
|
|
645
786
|
"date": "",
|
|
646
787
|
"context": "Data reaches this element from people or other systems, or is kept in it. The forces: traffic is read or changed wherever it crosses a network someone else controls, and \"inside our network\" stops being true with the first misconfigured peering, mirror port or compromised host; old protocol versions and cipher suites stay enabled for years after they are broken; disks, snapshots and backups leave the system in ways nobody tracks; whoever holds the keys can read the data, so who controls them (the provider, us, or only the application) decides who can be compelled or tricked into reading it; certificates and keys that expire or are never rotated cause outages or stay useful to an attacker for years. Snippets assume Terraform under infra/ (plans read with terraform show -json), Kubernetes and Istio manifests rendered under manifests/, the public endpoints listed one host per line in endpoints.txt, internal ones as host:port in internal-endpoints.txt, certificates issued by hand in cert-inventory.txt, and the application under src/ with its tests under tests/. The cloud snippets (Config rules, key policy, key rotation and age, private network) are for AWS; each tool line names the Azure and Google equivalent.",
|
|
647
|
-
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS)
|
|
788
|
+
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS). The load balancer re-encrypts to the element, and the element connects to databases, queues and other elements over TLS 1.2 or newer, verifying the certificate and host name against our internal CA or the provider's (for example Amazon RDS CA bundles, Azure Database certificates). Turning verification off is not allowed in any environment; tests run against real certificates from a local CA (mkcert or a test step-ca).",
|
|
648
789
|
"consequences": "• No clear text on any network, without a mesh to operate.\n• Every element and driver must be configured and kept configured; a default that skips verification is a finding.\n• The connection proves the server, not the caller: who is calling is decided by authentication.\n• Where TLS 1.2 is still offered to outside callers, whether it can be dropped is reviewed once a year.",
|
|
649
790
|
"alternatives": "1. Mutual TLS in a service mesh: identity on every hop, a mesh to run.\n2. Clear text inside a private network: simplest, weakest.",
|
|
650
791
|
"hubWhen": {
|
|
@@ -663,7 +804,7 @@
|
|
|
663
804
|
"status": "accepted",
|
|
664
805
|
"date": "",
|
|
665
806
|
"context": "Data reaches this element from people or other systems, or is kept in it. The forces: traffic is read or changed wherever it crosses a network someone else controls, and \"inside our network\" stops being true with the first misconfigured peering, mirror port or compromised host; old protocol versions and cipher suites stay enabled for years after they are broken; disks, snapshots and backups leave the system in ways nobody tracks; whoever holds the keys can read the data, so who controls them (the provider, us, or only the application) decides who can be compelled or tricked into reading it; certificates and keys that expire or are never rotated cause outages or stay useful to an attacker for years. Snippets assume Terraform under infra/ (plans read with terraform show -json), Kubernetes and Istio manifests rendered under manifests/, the public endpoints listed one host per line in endpoints.txt, internal ones as host:port in internal-endpoints.txt, certificates issued by hand in cert-inventory.txt, and the application under src/ with its tests under tests/. The cloud snippets (Config rules, key policy, key rotation and age, private network) are for AWS; each tool line names the Azure and Google equivalent.",
|
|
666
|
-
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS)
|
|
807
|
+
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS). TLS ends at the load balancer; traffic between our elements stays in clear text inside one private network (VPC or VNet) with no peering, no public addresses and no shared tenants, relying on the provider's physical-layer encryption between its data centres. Any connection that leaves that network, or carries card or health data, uses TLS; peering or a shared tenant supersedes this decision.",
|
|
667
808
|
"consequences": "• Nothing to configure or rotate inside; the cheapest option.\n• A foothold on the network reads every internal call: one compromised host sees everything.\n• Audits (PCI DSS, HIPAA, ISO 27001) may not accept it; the conditions must stay true and be checked.\n• Where TLS 1.2 is still offered to outside callers, whether it can be dropped is reviewed once a year.",
|
|
668
809
|
"alternatives": "1. TLS on every connection: modest effort, removes the clear text.\n2. Mutual TLS in a service mesh: encryption and identity on every hop.",
|
|
669
810
|
"hubWhen": {
|
|
@@ -18,7 +18,53 @@
|
|
|
18
18
|
"id": "error-handling-logging",
|
|
19
19
|
"trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
|
|
20
20
|
"why": "code lives in these elements and fails in production, so how a failure is signalled, where it is handled and how it is recorded has to be decided once for everyone who writes in them; one decision usually covers a whole repository and is bound to every element built from it.",
|
|
21
|
-
"group": "coding"
|
|
21
|
+
"group": "coding",
|
|
22
|
+
"scope": {
|
|
23
|
+
"group": "coding",
|
|
24
|
+
"questions": [
|
|
25
|
+
{
|
|
26
|
+
"key": "TEAM",
|
|
27
|
+
"label": "Who writes the code?",
|
|
28
|
+
"default": "small",
|
|
29
|
+
"hint": "Code others must read and change needs written conventions and documentation.",
|
|
30
|
+
"options": [
|
|
31
|
+
{
|
|
32
|
+
"value": "small",
|
|
33
|
+
"label": "one or two people",
|
|
34
|
+
"description": "One or two developers who know all of it."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"value": "team",
|
|
38
|
+
"label": "a team",
|
|
39
|
+
"description": "A team of its own, with people joining and leaving."
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"value": "teams",
|
|
43
|
+
"label": "several teams",
|
|
44
|
+
"description": "Several teams working in the same codebase or in parts of it."
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"key": "LIFETIME",
|
|
50
|
+
"label": "How long must the code live?",
|
|
51
|
+
"default": "years",
|
|
52
|
+
"hint": "A prototype thrown away soon needs little; code kept for years needs its debt paid down.",
|
|
53
|
+
"options": [
|
|
54
|
+
{
|
|
55
|
+
"value": "short",
|
|
56
|
+
"label": "a prototype or a short-lived tool",
|
|
57
|
+
"description": "A trial, a demo or a tool for a few months, then thrown away."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"value": "years",
|
|
61
|
+
"label": "years",
|
|
62
|
+
"description": "It will be kept and changed for years."
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
22
68
|
},
|
|
23
69
|
"sources": [
|
|
24
70
|
{
|
|
@@ -116,7 +162,13 @@
|
|
|
116
162
|
"label": "translation at every layer",
|
|
117
163
|
"description": "Each layer catches the errors of the layer below and raises its own, with the original as the cause: a repository turns a driver error into a persistence error, the domain turns that into a domain error, the API maps domain errors to responses. Pick it when the domain must not depend on the drivers' error types, or when a layer is reused behind several edges (HTTP, messaging, batch)."
|
|
118
164
|
}
|
|
119
|
-
]
|
|
165
|
+
],
|
|
166
|
+
"scopeWhen": {
|
|
167
|
+
"TEAM": [
|
|
168
|
+
"team",
|
|
169
|
+
"teams"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
120
172
|
},
|
|
121
173
|
{
|
|
122
174
|
"key": "LOGS",
|
|
@@ -135,7 +187,13 @@
|
|
|
135
187
|
"label": "fixed-layout text lines",
|
|
136
188
|
"description": "One human-readable line per event in a fixed layout (time, level, correlation id in brackets, message, key=value fields), parsed with one regular expression. Pick it for CLIs, build tools and small utilities whose logs are read by a person on a terminal, not indexed."
|
|
137
189
|
}
|
|
138
|
-
]
|
|
190
|
+
],
|
|
191
|
+
"scopeWhen": {
|
|
192
|
+
"TEAM": [
|
|
193
|
+
"team",
|
|
194
|
+
"teams"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
139
197
|
},
|
|
140
198
|
{
|
|
141
199
|
"key": "REDACTION",
|
|
@@ -229,6 +287,10 @@
|
|
|
229
287
|
"hubWhen": {
|
|
230
288
|
"STYLE": [
|
|
231
289
|
"exceptions"
|
|
290
|
+
],
|
|
291
|
+
"LOGS": [
|
|
292
|
+
"structured",
|
|
293
|
+
"text"
|
|
232
294
|
]
|
|
233
295
|
}
|
|
234
296
|
},
|
|
@@ -312,7 +374,13 @@
|
|
|
312
374
|
"y": 1040,
|
|
313
375
|
"ears_type": "ubiquitous",
|
|
314
376
|
"action": "put the {{CORRELATION_FIELD}} of the current request, message or job in every log line, taken from the incoming trace context or request id or created at the edge, through the logger's context (async-local storage, MDC, contextvars), never by hand at each call",
|
|
315
|
-
"rationale": "The id is how one request's lines are found among millions and joined across elements; a line without it is noise at the moment it is needed (OWASP Logging Cheat Sheet: event attributes; The Twelve-Factor App, XI)."
|
|
377
|
+
"rationale": "The id is how one request's lines are found among millions and joined across elements; a line without it is noise at the moment it is needed (OWASP Logging Cheat Sheet: event attributes; The Twelve-Factor App, XI).",
|
|
378
|
+
"hubWhen": {
|
|
379
|
+
"LOGS": [
|
|
380
|
+
"structured",
|
|
381
|
+
"text"
|
|
382
|
+
]
|
|
383
|
+
}
|
|
316
384
|
},
|
|
317
385
|
{
|
|
318
386
|
"id": "req-structured",
|
|
@@ -373,7 +441,13 @@
|
|
|
373
441
|
"y": 1690,
|
|
374
442
|
"ears_type": "ubiquitous",
|
|
375
443
|
"action": "use the levels {{LEVELS}} by meaning: error only for a failure that lost work or needs a person to act, warn for a failure handled or degraded, info for business events and lifecycle, debug for diagnosis and off in production; a request answered with a 4xx status is logged at warn or info, never error",
|
|
376
|
-
"rationale": "Alerts and dashboards count by level; a 404 logged at error buries the real failures and teaches everyone to ignore the level (Google SRE book, chapter 6: as simple as possible, no simpler; OWASP Logging Cheat Sheet)."
|
|
444
|
+
"rationale": "Alerts and dashboards count by level; a 404 logged at error buries the real failures and teaches everyone to ignore the level (Google SRE book, chapter 6: as simple as possible, no simpler; OWASP Logging Cheat Sheet).",
|
|
445
|
+
"hubWhen": {
|
|
446
|
+
"LOGS": [
|
|
447
|
+
"structured",
|
|
448
|
+
"text"
|
|
449
|
+
]
|
|
450
|
+
}
|
|
377
451
|
},
|
|
378
452
|
{
|
|
379
453
|
"id": "sc-no-swallow",
|
|
@@ -407,6 +481,10 @@
|
|
|
407
481
|
"hubWhen": {
|
|
408
482
|
"STYLE": [
|
|
409
483
|
"exceptions"
|
|
484
|
+
],
|
|
485
|
+
"LOGS": [
|
|
486
|
+
"structured",
|
|
487
|
+
"text"
|
|
410
488
|
]
|
|
411
489
|
}
|
|
412
490
|
},
|
|
@@ -488,7 +566,13 @@
|
|
|
488
566
|
"y": 1040,
|
|
489
567
|
"given": "the log output of a full test run",
|
|
490
568
|
"when": "each line is read",
|
|
491
|
-
"then": "every line carries a {{CORRELATION_FIELD}} of 16 to 36 hex characters (dashes allowed); one without fails the test"
|
|
569
|
+
"then": "every line carries a {{CORRELATION_FIELD}} of 16 to 36 hex characters (dashes allowed); one without fails the test",
|
|
570
|
+
"hubWhen": {
|
|
571
|
+
"LOGS": [
|
|
572
|
+
"structured",
|
|
573
|
+
"text"
|
|
574
|
+
]
|
|
575
|
+
}
|
|
492
576
|
},
|
|
493
577
|
{
|
|
494
578
|
"id": "sc-structured",
|
|
@@ -548,7 +632,13 @@
|
|
|
548
632
|
"y": 1690,
|
|
549
633
|
"given": "the log output of a full test run, with requests answered 404 and a request that hit a database outage",
|
|
550
634
|
"when": "the log-shape test reads the lines",
|
|
551
|
-
"then": "no line with a 4xx status is at error level, and the outage line is"
|
|
635
|
+
"then": "no line with a 4xx status is at error level, and the outage line is",
|
|
636
|
+
"hubWhen": {
|
|
637
|
+
"LOGS": [
|
|
638
|
+
"structured",
|
|
639
|
+
"text"
|
|
640
|
+
]
|
|
641
|
+
}
|
|
552
642
|
},
|
|
553
643
|
{
|
|
554
644
|
"id": "adr-exceptions",
|
|
@@ -560,7 +650,7 @@
|
|
|
560
650
|
"status": "accepted",
|
|
561
651
|
"date": "",
|
|
562
652
|
"context": "Code in this element fails: a dependency times out, input is wrong, a record is gone, a bug is hit. The forces: a failure that is swallowed becomes a wrong answer nobody can explain; one that is logged at every layer on its way up becomes five lines about one event; a caller that is handed a stack trace learns the file layout, the framework and sometimes the SQL; a log line without the request's id cannot be found when it matters; logs are read widely and copied to places with weaker access, so a password or an e-mail address in them is a leak; expected failures (not found, rejected, conflict) and unexpected ones (bugs, outages) need different handling, and a style that does not separate them handles both badly; and every convention here is kept by hundreds of hands, so it holds only if a tool checks it. What is done with the lines once written (shipping, retention, alerting, traces) is the Observability concern's decision, not this one's; that pack takes the shape and redaction decided here as given. What an HTTP API's error body looks like (its format, codes and field errors) is the Errors pack's decision; what must never reach a caller at any edge is this one's. The snippets assume one repository layout: source in src/ with the edge in src/http, the inner code in src/domain and src/application, the error types in src/errors, the logger in src/logger.js, and tests in test/; the TypeScript snippets name the Python, JVM, Go and .NET equivalents.",
|
|
563
|
-
"decision": "Expected failures are thrown as subclasses of one base class {{BASE_ERROR}} in src/errors (NotFoundError, ValidationError, ConflictError, UpstreamUnavailableError, each with a stable code and an HTTP status hint; under ten classes in all); unexpected errors (TypeError, NullPointerException, driver errors nobody translated) are not caught below the boundary. Every wrap passes the original as the cause (Error.cause, inner exception, raise … from).
|
|
653
|
+
"decision": "Expected failures are thrown as subclasses of one base class {{BASE_ERROR}} in src/errors (NotFoundError, ValidationError, ConflictError, UpstreamUnavailableError, each with a stable code and an HTTP status hint; under ten classes in all); unexpected errors (TypeError, NullPointerException, driver errors nobody translated) are not caught below the boundary. Every wrap passes the original as the cause (Error.cause, inner exception, raise … from). The handler maps {{BASE_ERROR}} subclasses by their code, treats everything else as 500 and logs each failure once at the level its meaning asks for ({{LEVELS}}). An HTTP caller sees the error body the Errors pack decides (RFC 9457 problem details unless it says otherwise), and no caller at any edge sees a stack trace, class name, SQL, path or internal host. Conventions are held by the linters: ESLint (no-empty, preserve-caught-error, only-throw-error), Semgrep (log-and-continue, log-and-rethrow, whole objects), Ruff (BLE, TRY, LOG), Error Prone and Sonar on the JVM; in .NET the Roslyn analyzers CA1031 (do not catch general exceptions) and CA2200 (rethrow to preserve the stack), configured as errors in .editorconfig.",
|
|
564
654
|
"consequences": "• Little ceremony: the happy path reads straight, and the frameworks already map exceptions to responses.\n• A function's signature does not say what it can fail with; reviewers and the hierarchy carry that knowledge.\n• An exception used for an expected case that is frequent (a cache miss, a validation on every field) costs stack capture; batch validation is reported as a notification object, not thrown field by field.\n• The hierarchy must stay small (under ten classes, checked) or it becomes a second type system nobody keeps up.",
|
|
565
655
|
"alternatives": "1. Result types: failures in the signature, at the cost of handling at every call and fighting libraries that throw.\n2. Error codes from a catalogue: stable for clients, but codes compared by hand everywhere inside the code.\n3. Catch-all handlers per controller: the same mapping written many times, drifting apart.",
|
|
566
656
|
"hubWhen": {
|
|
@@ -579,7 +669,7 @@
|
|
|
579
669
|
"status": "accepted",
|
|
580
670
|
"date": "",
|
|
581
671
|
"context": "Code in this element fails: a dependency times out, input is wrong, a record is gone, a bug is hit. The forces: a failure that is swallowed becomes a wrong answer nobody can explain; one that is logged at every layer on its way up becomes five lines about one event; a caller that is handed a stack trace learns the file layout, the framework and sometimes the SQL; a log line without the request's id cannot be found when it matters; logs are read widely and copied to places with weaker access, so a password or an e-mail address in them is a leak; expected failures (not found, rejected, conflict) and unexpected ones (bugs, outages) need different handling, and a style that does not separate them handles both badly; and every convention here is kept by hundreds of hands, so it holds only if a tool checks it. What is done with the lines once written (shipping, retention, alerting, traces) is the Observability concern's decision, not this one's; that pack takes the shape and redaction decided here as given. What an HTTP API's error body looks like (its format, codes and field errors) is the Errors pack's decision; what must never reach a caller at any edge is this one's. The snippets assume one repository layout: source in src/ with the edge in src/http, the inner code in src/domain and src/application, the error types in src/errors, the logger in src/logger.js, and tests in test/; the TypeScript snippets name the Python, JVM, Go and .NET equivalents.",
|
|
582
|
-
"decision": "A function that can fail in an expected way returns a Result: Result<T, E> and the ? operator in Rust (thiserror for error types, anyhow only at the binary's edge), error values with %w and errors.Is/As in Go, kotlin.Result or Arrow's Either in Kotlin, neverthrow (or fp-ts Either) in TypeScript. The error type of each module names its cases and carries a stable code; wraps keep the source. Exceptions and panics are for bugs and broken invariants only and are never caught except at the boundary. An ignored Result fails the build (unused_must_use, errcheck, neverthrow/must-use-result).
|
|
672
|
+
"decision": "A function that can fail in an expected way returns a Result: Result<T, E> and the ? operator in Rust (thiserror for error types, anyhow only at the binary's edge), error values with %w and errors.Is/As in Go, kotlin.Result or Arrow's Either in Kotlin, neverthrow (or fp-ts Either) in TypeScript. The error type of each module names its cases and carries a stable code; wraps keep the source. Exceptions and panics are for bugs and broken invariants only and are never caught except at the boundary. An ignored Result fails the build (unused_must_use, errcheck, neverthrow/must-use-result). The handler maps the error cases to responses and logs each failure once at the level its meaning asks for ({{LEVELS}}). An HTTP caller sees the error body the Errors pack decides (RFC 9457 problem details unless it says otherwise), and no caller at any edge sees a stack trace, class name, SQL, path or internal host.",
|
|
583
673
|
"consequences": "• Every expected failure is in the signature; forgetting one is a compile error, not an incident.\n• Every call that can fail is handled or passed on explicitly, which is more code and a style the whole team must share.\n• Libraries that throw (HTTP clients, ORMs, JSON parsers) are wrapped at the module boundary into Results, and that wrapping is where bugs hide.\n• Unexpected errors still need the boundary handler, so the element has two mechanisms, not one.",
|
|
584
674
|
"alternatives": "1. Exceptions with a hierarchy: less ceremony, failures invisible in signatures.\n2. Error codes from a catalogue: values too, but untyped; a Result's error type can carry the catalogue code.\n3. Results everywhere, bugs included: panics wrapped as values hide what should crash loudly.",
|
|
585
675
|
"hubWhen": {
|
|
@@ -598,7 +688,7 @@
|
|
|
598
688
|
"status": "accepted",
|
|
599
689
|
"date": "",
|
|
600
690
|
"context": "Code in this element fails: a dependency times out, input is wrong, a record is gone, a bug is hit. The forces: a failure that is swallowed becomes a wrong answer nobody can explain; one that is logged at every layer on its way up becomes five lines about one event; a caller that is handed a stack trace learns the file layout, the framework and sometimes the SQL; a log line without the request's id cannot be found when it matters; logs are read widely and copied to places with weaker access, so a password or an e-mail address in them is a leak; expected failures (not found, rejected, conflict) and unexpected ones (bugs, outages) need different handling, and a style that does not separate them handles both badly; and every convention here is kept by hundreds of hands, so it holds only if a tool checks it. What is done with the lines once written (shipping, retention, alerting, traces) is the Observability concern's decision, not this one's; that pack takes the shape and redaction decided here as given. What an HTTP API's error body looks like (its format, codes and field errors) is the Errors pack's decision; what must never reach a caller at any edge is this one's. The snippets assume one repository layout: source in src/ with the edge in src/http, the inner code in src/domain and src/application, the error types in src/errors, the logger in src/logger.js, and tests in test/; the TypeScript snippets name the Python, JVM, Go and .NET equivalents.",
|
|
601
|
-
"decision": "One catalogue in the repository (src/errors/catalogue.ts, or a generated enum from it) defines every error: a stable upper-case code (ORDER_NOT_FOUND), the HTTP status or exit status, a message template with named placeholders and a type URI. Code signals an error by returning or raising an error value built from a catalogue entry (fail('ORDER_NOT_FOUND', { orderId }) in TypeScript or Python, an error struct with the code in Go, an enum in C), never an ad-hoc string; a code that is not in the catalogue fails a test, and a renamed or removed code fails the catalogue snapshot (codes are added or deprecated, never changed).
|
|
691
|
+
"decision": "One catalogue in the repository (src/errors/catalogue.ts, or a generated enum from it) defines every error: a stable upper-case code (ORDER_NOT_FOUND), the HTTP status or exit status, a message template with named placeholders and a type URI. Code signals an error by returning or raising an error value built from a catalogue entry (fail('ORDER_NOT_FOUND', { orderId }) in TypeScript or Python, an error struct with the code in Go, an enum in C), never an ad-hoc string; a code that is not in the catalogue fails a test, and a renamed or removed code fails the catalogue snapshot (codes are added or deprecated, never changed). The handler maps the catalogue entry to the status and to the error body the Errors pack decides (RFC 9457 problem details unless it says otherwise), with the catalogue's code as the stable code wherever that pack gives callers codes (its api/errors/codes.yaml is generated from this catalogue, so there is one list), and logs each failure once at the level its meaning asks for ({{LEVELS}}), with the code as a field. Unexpected errors map to one catalogue entry (INTERNAL) and keep their cause in the log only.",
|
|
602
692
|
"consequences": "• Clients and support share one documented list; a code never changes meaning.\n• The catalogue is a shared file everyone edits; ownership and review of it must be clear or it fills with near-duplicates.\n• Codes are compared as values inside the code too, which is weaker than types; a generated enum limits typos.\n• Message templates in one place are easy to translate and easy to leave stale.",
|
|
603
693
|
"alternatives": "1. Exceptions with a hierarchy: the type is the code; works until a client needs the list.\n2. Result types with an error enum per module: typed, but there is no one list across the element.\n3. Codes invented at call sites: what a catalogue replaces; nobody can list them.",
|
|
604
694
|
"hubWhen": {
|
|
@@ -695,7 +785,13 @@
|
|
|
695
785
|
"cadence": "triggered",
|
|
696
786
|
"trigger": "pull-request",
|
|
697
787
|
"invocation": "automated",
|
|
698
|
-
"description": "Semgrep runs on src with five rules: console in TypeScript, print in Python, a log call passed a whole request, response, headers or body object (as a bare argument or as a property of the first object), a catch whose body is a single log call (the error is swallowed), and a catch that logs and rethrows (the error would be logged twice).\n\nThreshold: 0 Semgrep findings of the five logging rules in src on every pull request\n\nTool: Semgrep\n\n```yaml\n# .semgrep/logging.yml (semgrep --config .semgrep/ --error src/)\nrules:\n - id: no-console\n languages: [typescript, javascript]\n severity: ERROR\n message: Use the logger; console lines have no level, no correlation id and no redaction\n pattern: console.$M(...)\n - id: no-print\n languages: [python]\n severity: ERROR\n message: Use the logger, not print\n pattern: print(...)\n - id: no-whole-object-logged\n languages: [typescript, javascript, python]\n severity: ERROR\n message: Never log a whole request, response, headers or body; log the fields the serializer allows\n patterns:\n - pattern-either:\n - pattern: '$LOG.$LEVEL(..., $OBJ, ...)'\n - pattern: '$LOG.$LEVEL({ ..., $OBJ: $V, ... }, ...)'\n - metavariable-regex:\n metavariable: $LEVEL\n regex: '^(error|warn|warning|info|debug|exception)$'\n - metavariable-regex:\n metavariable: $OBJ\n regex: '^(req|request|res|response|ctx|event|body|headers)$'\n - id: log-and-continue\n languages: [typescript, javascript]\n severity: ERROR\n message: A catch that only logs swallows the error; rethrow it, return it, or handle it with a stated recovery\n pattern: |\n try { ... } catch ($E) { $LOG.$LEVEL(...); }\n - id: log-and-rethrow\n languages: [typescript, javascript]\n severity: ERROR\n message: Log once, where the error is handled; a catch that logs and rethrows logs it twice\n pattern: |\n try { ... } catch ($E) { ... $LOG.$LEVEL(...); ... throw ...; }\n```"
|
|
788
|
+
"description": "Semgrep runs on src with five rules: console in TypeScript, print in Python, a log call passed a whole request, response, headers or body object (as a bare argument or as a property of the first object), a catch whose body is a single log call (the error is swallowed), and a catch that logs and rethrows (the error would be logged twice).\n\nThreshold: 0 Semgrep findings of the five logging rules in src on every pull request\n\nTool: Semgrep\n\n```yaml\n# .semgrep/logging.yml (semgrep --config .semgrep/ --error src/)\nrules:\n - id: no-console\n languages: [typescript, javascript]\n severity: ERROR\n message: Use the logger; console lines have no level, no correlation id and no redaction\n pattern: console.$M(...)\n - id: no-print\n languages: [python]\n severity: ERROR\n message: Use the logger, not print\n pattern: print(...)\n - id: no-whole-object-logged\n languages: [typescript, javascript, python]\n severity: ERROR\n message: Never log a whole request, response, headers or body; log the fields the serializer allows\n patterns:\n - pattern-either:\n - pattern: '$LOG.$LEVEL(..., $OBJ, ...)'\n - pattern: '$LOG.$LEVEL({ ..., $OBJ: $V, ... }, ...)'\n - metavariable-regex:\n metavariable: $LEVEL\n regex: '^(error|warn|warning|info|debug|exception)$'\n - metavariable-regex:\n metavariable: $OBJ\n regex: '^(req|request|res|response|ctx|event|body|headers)$'\n - id: log-and-continue\n languages: [typescript, javascript]\n severity: ERROR\n message: A catch that only logs swallows the error; rethrow it, return it, or handle it with a stated recovery\n pattern: |\n try { ... } catch ($E) { $LOG.$LEVEL(...); }\n - id: log-and-rethrow\n languages: [typescript, javascript]\n severity: ERROR\n message: Log once, where the error is handled; a catch that logs and rethrows logs it twice\n pattern: |\n try { ... } catch ($E) { ... $LOG.$LEVEL(...); ... throw ...; }\n```",
|
|
789
|
+
"hubWhen": {
|
|
790
|
+
"LOGS": [
|
|
791
|
+
"structured",
|
|
792
|
+
"text"
|
|
793
|
+
]
|
|
794
|
+
}
|
|
699
795
|
},
|
|
700
796
|
{
|
|
701
797
|
"id": "ff-redact-denylist",
|
|
@@ -744,7 +840,13 @@
|
|
|
744
840
|
"cadence": "triggered",
|
|
745
841
|
"trigger": "pull-request",
|
|
746
842
|
"invocation": "automated",
|
|
747
|
-
"description": "The test run writes its logs to a file; a test afterwards reads every line and asserts the shape: JSON lines must parse, hold the fields, carry a level word from the list and never pair a 4xx status with level error; text lines must match the fixed layout built from the same levels and limit. One malformed, uncorrelated or mislevelled line fails the build.\n\nThreshold: 100 % of the lines written during a full test run parse as {{LOGS}}, carry a level from {{LEVELS}}, a {{CORRELATION_FIELD}} of 16 to 36 hex characters and a message of at most {{MAX_MESSAGE_CHARS}} characters; 0 JSON lines with a 4xx status at level error\n\nTool: Vitest (a test over the test run's log file); the same test under pytest for Python\n\n```ts\n// test/log-shape.test.ts (the app writes LOG_FILE=test-logs/app.log during the run)\nimport { readFileSync } from 'node:fs'\nimport { expect, it } from 'vitest'\nconst FIELD = '{{CORRELATION_FIELD}}'\nconst LEVELS = '{{LEVELS}}'.split(/,\\s*/)\nconst MAX = {{MAX_MESSAGE_CHARS}}\nconst ID = /^[0-9a-f-]{16,36}$/ // a trace id, or a UUID with dashes\nconst TEXT = new RegExp(`^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\S+ (${LEVELS.map((l) => l.toUpperCase()).join('|')}) \\\\[[0-9a-f-]{16,36}\\\\] .{1,${MAX}}(\\\\s\\\\w+=\\\\S+)*$`)\nit('every log line of the test run is well-formed, correlated and levelled by meaning', () => {\n const lines = readFileSync('test-logs/app.log', 'utf8').split('\\n').filter((l) => l && !l.startsWith(' ')) // indented = stack trace\n expect(lines.length).toBeGreaterThan(0)\n for (const line of lines) {\n if (line.startsWith('{')) {\n const o = JSON.parse(line)\n expect(LEVELS, line).toContain(o.level)\n expect(o[FIELD], line).toMatch(ID)\n expect(String(o.msg ?? o.message).length, line).toBeLessThanOrEqual(MAX)\n if (typeof o.status === 'number' && o.status >= 400 && o.status < 500) expect(o.level, `a 4xx logged at error: ${line}`).not.toBe('error')\n } else expect(line).toMatch(TEXT)\n }\n})\n```"
|
|
843
|
+
"description": "The test run writes its logs to a file; a test afterwards reads every line and asserts the shape: JSON lines must parse, hold the fields, carry a level word from the list and never pair a 4xx status with level error; text lines must match the fixed layout built from the same levels and limit. One malformed, uncorrelated or mislevelled line fails the build.\n\nThreshold: 100 % of the lines written during a full test run parse as {{LOGS}}, carry a level from {{LEVELS}}, a {{CORRELATION_FIELD}} of 16 to 36 hex characters and a message of at most {{MAX_MESSAGE_CHARS}} characters; 0 JSON lines with a 4xx status at level error\n\nTool: Vitest (a test over the test run's log file); the same test under pytest for Python\n\n```ts\n// test/log-shape.test.ts (the app writes LOG_FILE=test-logs/app.log during the run)\nimport { readFileSync } from 'node:fs'\nimport { expect, it } from 'vitest'\nconst FIELD = '{{CORRELATION_FIELD}}'\nconst LEVELS = '{{LEVELS}}'.split(/,\\s*/)\nconst MAX = {{MAX_MESSAGE_CHARS}}\nconst ID = /^[0-9a-f-]{16,36}$/ // a trace id, or a UUID with dashes\nconst TEXT = new RegExp(`^\\\\d{4}-\\\\d\\\\d-\\\\d\\\\dT\\\\S+ (${LEVELS.map((l) => l.toUpperCase()).join('|')}) \\\\[[0-9a-f-]{16,36}\\\\] .{1,${MAX}}(\\\\s\\\\w+=\\\\S+)*$`)\nit('every log line of the test run is well-formed, correlated and levelled by meaning', () => {\n const lines = readFileSync('test-logs/app.log', 'utf8').split('\\n').filter((l) => l && !l.startsWith(' ')) // indented = stack trace\n expect(lines.length).toBeGreaterThan(0)\n for (const line of lines) {\n if (line.startsWith('{')) {\n const o = JSON.parse(line)\n expect(LEVELS, line).toContain(o.level)\n expect(o[FIELD], line).toMatch(ID)\n expect(String(o.msg ?? o.message).length, line).toBeLessThanOrEqual(MAX)\n if (typeof o.status === 'number' && o.status >= 400 && o.status < 500) expect(o.level, `a 4xx logged at error: ${line}`).not.toBe('error')\n } else expect(line).toMatch(TEXT)\n }\n})\n```",
|
|
844
|
+
"hubWhen": {
|
|
845
|
+
"LOGS": [
|
|
846
|
+
"structured",
|
|
847
|
+
"text"
|
|
848
|
+
]
|
|
849
|
+
}
|
|
748
850
|
},
|
|
749
851
|
{
|
|
750
852
|
"id": "ff-no-stack-to-caller",
|
|
@@ -774,6 +876,10 @@
|
|
|
774
876
|
"hubWhen": {
|
|
775
877
|
"STYLE": [
|
|
776
878
|
"exceptions"
|
|
879
|
+
],
|
|
880
|
+
"LOGS": [
|
|
881
|
+
"structured",
|
|
882
|
+
"text"
|
|
777
883
|
]
|
|
778
884
|
}
|
|
779
885
|
},
|
|
@@ -17,7 +17,75 @@
|
|
|
17
17
|
"id": "eu-dora",
|
|
18
18
|
"trigger": "LIST NODES WHERE type = \"system\" AND external != true",
|
|
19
19
|
"why": "the organisation running this system may be a financial entity or an ICT provider to one, so whether and how the EU Digital Operational Resilience Act (DORA, Regulation (EU) 2022/2554) applies to it has to be decided.",
|
|
20
|
-
"group": "compliance"
|
|
20
|
+
"group": "compliance",
|
|
21
|
+
"scope": {
|
|
22
|
+
"group": "compliance",
|
|
23
|
+
"questions": [
|
|
24
|
+
{
|
|
25
|
+
"key": "PERSONAL",
|
|
26
|
+
"label": "What does it keep about people?",
|
|
27
|
+
"default": "ordinary",
|
|
28
|
+
"hint": "Any personal data brings the GDPR's duties; special categories or children bring more (Art. 9, WP248).",
|
|
29
|
+
"options": [
|
|
30
|
+
{
|
|
31
|
+
"value": "none",
|
|
32
|
+
"label": "nothing about people",
|
|
33
|
+
"description": "No personal data beyond staff sign-in."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"value": "ordinary",
|
|
37
|
+
"label": "ordinary personal data",
|
|
38
|
+
"description": "Names, e-mail addresses, phone numbers, orders, accounts."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"value": "special",
|
|
42
|
+
"label": "special categories or children",
|
|
43
|
+
"description": "Health, biometrics, genetic data, religion, politics, sexual orientation, union membership, criminal records, or data about children (GDPR Art. 9 and 10)."
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"key": "REGULATION",
|
|
49
|
+
"label": "Which law or standard binds it most?",
|
|
50
|
+
"default": "none",
|
|
51
|
+
"hint": "Pick the most binding one; a lawyer settles the exceptions. This only says which packs to consider.",
|
|
52
|
+
"options": [
|
|
53
|
+
{
|
|
54
|
+
"value": "none",
|
|
55
|
+
"label": "none beyond the GDPR",
|
|
56
|
+
"description": "No sector law or payment standard applies."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"value": "cards",
|
|
60
|
+
"label": "card numbers on our own pages",
|
|
61
|
+
"description": "Card numbers are typed into pages we serve (PCI DSS beyond SAQ A); with a payment provider's hosted page or iframe, pick none."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"value": "finance",
|
|
65
|
+
"label": "EU financial services",
|
|
66
|
+
"description": "A bank, payment or e-money institution, investment firm, crypto-asset provider, insurer or pension fund in the EU, or an ICT supplier to one (DORA)."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"value": "health",
|
|
70
|
+
"label": "health records",
|
|
71
|
+
"description": "Patient or health records, or a supplier to a health provider or plan (HIPAA in the US)."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"value": "essential",
|
|
75
|
+
"label": "an essential sector",
|
|
76
|
+
"description": "Energy, transport, water, health, digital infrastructure, managed IT or security services, public administration, manufacturing, food and the like, with 50+ staff or €10M+ turnover (NIS2)."
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"when": [
|
|
82
|
+
{
|
|
83
|
+
"REGULATION": [
|
|
84
|
+
"finance"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
21
89
|
},
|
|
22
90
|
"sources": [
|
|
23
91
|
{
|