@radicaltools/mcp 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Z7THA3L5.js → chunk-2SZDTOYJ.js} +65 -33
- package/dist/{elkLayout-TAUBPPVN.js → elkLayout-VYJDCCIT.js} +1 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +1001 -230
- package/package.json +1 -1
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
{
|
|
50
50
|
"title": "RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3",
|
|
51
51
|
"url": "https://www.rfc-editor.org/rfc/rfc8446"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"title": "PCI DSS v4.0.1, Requirement 3 (protect stored account data)",
|
|
55
|
+
"url": "https://www.pcisecuritystandards.org/document_library/"
|
|
52
56
|
}
|
|
53
57
|
],
|
|
54
58
|
"templateParams": [
|
|
@@ -56,13 +60,13 @@
|
|
|
56
60
|
"key": "TLS",
|
|
57
61
|
"title": "TLS from outside",
|
|
58
62
|
"label": "Which TLS versions do outside callers get?",
|
|
59
|
-
"hint": "Every version and cipher suite you accept is one an attacker may downgrade to; every one you drop is a client that stops working.",
|
|
63
|
+
"hint": "Every version and cipher suite you accept is one an attacker may downgrade to; every one you drop is a client that stops working. This question and the certificate one are about the endpoints outside callers reach: when the pack lands on a database or queue, answer them for the public edge of the system that holds it.",
|
|
60
64
|
"defaultValue": "intermediate",
|
|
61
65
|
"options": [
|
|
62
66
|
{
|
|
63
67
|
"value": "modern",
|
|
64
|
-
"label": "TLS 1.3
|
|
65
|
-
"description": "Mozilla's \"modern\" profile: no legacy suites to misconfigure, forward secrecy always. Pick it when every client is a current browser, mobile app or SDK (Android 10+, iOS 12.2+, Java 11+, OpenSSL 1.1.1+)."
|
|
68
|
+
"label": "TLS 1.3",
|
|
69
|
+
"description": "Mozilla's \"modern\" profile, nothing older offered: no legacy suites to misconfigure, forward secrecy always. Pick it when every client is a current browser, mobile app or SDK (Android 10+, iOS 12.2+, Java 11+, OpenSSL 1.1.1+)."
|
|
66
70
|
},
|
|
67
71
|
{
|
|
68
72
|
"value": "intermediate",
|
|
@@ -80,8 +84,8 @@
|
|
|
80
84
|
"options": [
|
|
81
85
|
{
|
|
82
86
|
"value": "mtls",
|
|
83
|
-
"label": "mutual TLS in
|
|
84
|
-
"description": "Istio
|
|
87
|
+
"label": "mutual TLS in an Istio service mesh",
|
|
88
|
+
"description": "Istio gives every workload a certificate and encrypts and authenticates every hop, with no change to the code. Pick it on Kubernetes with many services, or when zero trust inside the cluster is required. The checks are written for Istio; Linkerd does the same with other resources, so with it the checks are rewritten."
|
|
85
89
|
},
|
|
86
90
|
{
|
|
87
91
|
"value": "tls",
|
|
@@ -99,13 +103,13 @@
|
|
|
99
103
|
"key": "AT_REST",
|
|
100
104
|
"title": "Keys at rest",
|
|
101
105
|
"label": "Who holds the keys for stored data?",
|
|
102
|
-
"hint": "Disk encryption with the provider's keys stops a stolen disk; it does not stop anyone who can query the database or call the storage API.",
|
|
106
|
+
"hint": "Disk encryption with the provider's keys stops a stolen disk; it does not stop anyone who can query the database or call the storage API. Answered for the stores themselves: on a database or queue for that store, on an application for the stores it writes to.",
|
|
103
107
|
"defaultValue": "cmk",
|
|
104
108
|
"options": [
|
|
105
109
|
{
|
|
106
110
|
"value": "provider",
|
|
107
111
|
"label": "provider-managed keys",
|
|
108
|
-
"description": "The default encryption of the managed database, object store and disks, with keys the provider creates and rotates. Pick it when no regulation or contract asks you to control the keys and the data is not highly sensitive."
|
|
112
|
+
"description": "The default encryption of the managed database, object store and disks, with keys the provider creates and rotates. Pick it when no regulation or contract asks you to control the keys and the data is not highly sensitive; the rotation question is then the provider's."
|
|
109
113
|
},
|
|
110
114
|
{
|
|
111
115
|
"value": "cmk",
|
|
@@ -123,7 +127,7 @@
|
|
|
123
127
|
"key": "ROTATION",
|
|
124
128
|
"title": "Key rotation",
|
|
125
129
|
"label": "How are our encryption keys rotated?",
|
|
126
|
-
"hint": "NIST bounds how long a key may protect new data; rotating only the key material is cheap, re-encrypting everything is not.
|
|
130
|
+
"hint": "Only when the keys at rest are customer-managed; with provider-managed keys the provider decides and this answer is not used. NIST bounds how long a key may protect new data; rotating only the key material is cheap, re-encrypting everything is not.",
|
|
127
131
|
"defaultValue": "automatic",
|
|
128
132
|
"options": [
|
|
129
133
|
{
|
|
@@ -134,7 +138,7 @@
|
|
|
134
138
|
{
|
|
135
139
|
"value": "reencrypt",
|
|
136
140
|
"label": "new keys with re-encryption of data",
|
|
137
|
-
"description": "A new key is created, data (or its data keys) is re-encrypted, and the old key is disabled. Pick it when a standard or contract sets a cryptoperiod for the data itself (PCI DSS 3.6, some government work)
|
|
141
|
+
"description": "A new key is created, data (or its data keys) is re-encrypted, and the old key is disabled. Pick it when a standard or contract sets a cryptoperiod for the data itself (PCI DSS 3.6, some government work). A suspected compromise is handled this way under either answer."
|
|
138
142
|
}
|
|
139
143
|
]
|
|
140
144
|
},
|
|
@@ -142,7 +146,7 @@
|
|
|
142
146
|
"key": "CERTS",
|
|
143
147
|
"title": "Certificates",
|
|
144
148
|
"label": "How are TLS certificates issued and renewed?",
|
|
145
|
-
"hint": "Expired certificates are one of the most common causes of outages; the cure is renewal nobody has to remember.",
|
|
149
|
+
"hint": "Expired certificates are one of the most common causes of outages; the cure is renewal nobody has to remember. About the certificates of the endpoints outside callers reach, as the TLS question.",
|
|
146
150
|
"defaultValue": "acme",
|
|
147
151
|
"options": [
|
|
148
152
|
{
|
|
@@ -215,7 +219,7 @@
|
|
|
215
219
|
"y": 260,
|
|
216
220
|
"ears_type": "unwanted-behaviour",
|
|
217
221
|
"unwanted_condition": "a client offers TLS 1.1 or older, or TLS 1.2 without an ECDHE key exchange and an AEAD cipher (AES-GCM or ChaCha20-Poly1305)",
|
|
218
|
-
"action": "refuse the handshake
|
|
222
|
+
"action": "refuse the handshake",
|
|
219
223
|
"rationale": "TLS 1.2 is safe only with forward-secret AEAD suites; CBC and static RSA suites are the ones attacks keep finding (NIST SP 800-52 Rev. 2, 3.3.1; Mozilla \"intermediate\" profile).",
|
|
220
224
|
"hubWhen": {
|
|
221
225
|
"TLS": [
|
|
@@ -278,7 +282,7 @@
|
|
|
278
282
|
"y": 780,
|
|
279
283
|
"ears_type": "ubiquitous",
|
|
280
284
|
"action": "encrypt stored data in databases, queues, object stores, disks, snapshots and backups with AES-256 under {{AT_REST}}",
|
|
281
|
-
"rationale": "Disks, snapshots and backups leave the system in ways nobody tracks; encryption at rest makes a lost copy unreadable (ASVS 6.
|
|
285
|
+
"rationale": "Disks, snapshots and backups leave the system in ways nobody tracks; encryption at rest makes a lost copy unreadable (ASVS 6.1.1 to 6.1.3; OWASP Cryptographic Storage Cheat Sheet)."
|
|
282
286
|
},
|
|
283
287
|
{
|
|
284
288
|
"id": "req-key-access",
|
|
@@ -287,7 +291,7 @@
|
|
|
287
291
|
"x": 260,
|
|
288
292
|
"y": 910,
|
|
289
293
|
"ears_type": "ubiquitous",
|
|
290
|
-
"action": "allow only the element's own identity and
|
|
294
|
+
"action": "allow only the element's own identity to use its keys and only key administrators to manage them, with nobody in both roles, and log every use of a key in the provider's audit trail",
|
|
291
295
|
"rationale": "Holding the keys means nothing if anyone can use them; separation of duties and a log of every decryption are what customer-managed keys buy (NIST SP 800-57 Pt 1, 5.3 and 6; OWASP Cryptographic Storage Cheat Sheet, key management).",
|
|
292
296
|
"hubWhen": {
|
|
293
297
|
"AT_REST": [
|
|
@@ -338,9 +342,9 @@
|
|
|
338
342
|
"x": 260,
|
|
339
343
|
"y": 1300,
|
|
340
344
|
"ears_type": "event-driven",
|
|
341
|
-
"trigger": "an encryption key is {{KEY_ROTATE_DAYS}} days old
|
|
342
|
-
"action": "create a new key, re-encrypt the data or its data keys under it within 30 days
|
|
343
|
-
"rationale": "Where a cryptoperiod applies to the data, the old key must stop protecting anything (NIST SP 800-57 Pt 1, 5.3; PCI DSS v4.0 3.6 and 3.7).",
|
|
345
|
+
"trigger": "an encryption key is {{KEY_ROTATE_DAYS}} days old",
|
|
346
|
+
"action": "create a new key, re-encrypt the data or its data keys under it within 30 days, and then disable the old key",
|
|
347
|
+
"rationale": "Where a cryptoperiod applies to the data, the old key must stop protecting anything (NIST SP 800-57 Pt 1, 5.3; PCI DSS v4.0.1 3.6 and 3.7).",
|
|
344
348
|
"hubWhen": {
|
|
345
349
|
"AT_REST": [
|
|
346
350
|
"cmk",
|
|
@@ -351,12 +355,30 @@
|
|
|
351
355
|
]
|
|
352
356
|
}
|
|
353
357
|
},
|
|
358
|
+
{
|
|
359
|
+
"id": "req-key-compromise",
|
|
360
|
+
"type": "requirement",
|
|
361
|
+
"label": "Compromised key replaced fast",
|
|
362
|
+
"x": 260,
|
|
363
|
+
"y": 1430,
|
|
364
|
+
"ears_type": "event-driven",
|
|
365
|
+
"trigger": "an encryption key is suspected to be compromised",
|
|
366
|
+
"action": "create a new key, re-encrypt the data or its data keys under it within 72 hours, and disable the old key",
|
|
367
|
+
"rationale": "A key that may be known to someone else protects nothing, and automatic rotation does not help: the old material stays usable for decryption. The drill is what makes 72 hours real (NIST SP 800-57 Pt 1, 5.3; PCI DSS v4.0.1 3.7.5).",
|
|
368
|
+
"unchecked": "a key-compromise drill the security owner runs twice a year on a copy of production data, timed against the 72 hours; no tool can run it.",
|
|
369
|
+
"hubWhen": {
|
|
370
|
+
"AT_REST": [
|
|
371
|
+
"cmk",
|
|
372
|
+
"field"
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
},
|
|
354
376
|
{
|
|
355
377
|
"id": "req-certs-acme",
|
|
356
378
|
"type": "requirement",
|
|
357
379
|
"label": "Certificates renewed automatically",
|
|
358
380
|
"x": 260,
|
|
359
|
-
"y":
|
|
381
|
+
"y": 1560,
|
|
360
382
|
"ears_type": "event-driven",
|
|
361
383
|
"trigger": "a certificate has 30 days of validity left",
|
|
362
384
|
"action": "renew it automatically and install it without downtime, and alert the owner if it still has fewer than 14 days left",
|
|
@@ -372,7 +394,7 @@
|
|
|
372
394
|
"type": "requirement",
|
|
373
395
|
"label": "Expiry alerted ahead",
|
|
374
396
|
"x": 260,
|
|
375
|
-
"y":
|
|
397
|
+
"y": 1690,
|
|
376
398
|
"ears_type": "state-driven",
|
|
377
399
|
"precondition": "a certificate on the inventory has fewer than 30 days of validity left",
|
|
378
400
|
"action": "alert its named owner every working day until it is replaced, and keep every certificate the element uses on the inventory with its owner and expiry",
|
|
@@ -444,9 +466,9 @@
|
|
|
444
466
|
"label": "Unverified backend refused",
|
|
445
467
|
"x": 520,
|
|
446
468
|
"y": 520,
|
|
447
|
-
"given": "the element configured for its database",
|
|
448
|
-
"when": "the database presents a certificate for another host name, and then plain text is offered",
|
|
449
|
-
"then": "the element refuses
|
|
469
|
+
"given": "the element configured for its database and for another element",
|
|
470
|
+
"when": "the database presents a certificate for another host name, and then plain text is offered to both",
|
|
471
|
+
"then": "the element refuses all three connections",
|
|
450
472
|
"hubWhen": {
|
|
451
473
|
"INTERNAL": [
|
|
452
474
|
"tls"
|
|
@@ -486,7 +508,7 @@
|
|
|
486
508
|
"y": 910,
|
|
487
509
|
"given": "the element's data key in the KMS",
|
|
488
510
|
"when": "another service's identity asks the KMS to decrypt with it, and a key administrator tries to decrypt",
|
|
489
|
-
"then": "both are refused and both attempts are in the
|
|
511
|
+
"then": "both are refused and both attempts are in the audit trail",
|
|
490
512
|
"hubWhen": {
|
|
491
513
|
"AT_REST": [
|
|
492
514
|
"cmk",
|
|
@@ -547,15 +569,31 @@
|
|
|
547
569
|
]
|
|
548
570
|
}
|
|
549
571
|
},
|
|
572
|
+
{
|
|
573
|
+
"id": "sc-key-compromise",
|
|
574
|
+
"type": "scenario",
|
|
575
|
+
"label": "Compromise drill",
|
|
576
|
+
"x": 520,
|
|
577
|
+
"y": 1430,
|
|
578
|
+
"given": "a key declared compromised in a drill",
|
|
579
|
+
"when": "the re-encryption runbook is followed",
|
|
580
|
+
"then": "within 72 hours every record decrypts under the new key and the old key is disabled, and the time taken is recorded",
|
|
581
|
+
"hubWhen": {
|
|
582
|
+
"AT_REST": [
|
|
583
|
+
"cmk",
|
|
584
|
+
"field"
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
},
|
|
550
588
|
{
|
|
551
589
|
"id": "sc-certs-acme",
|
|
552
590
|
"type": "scenario",
|
|
553
591
|
"label": "Renewal without anyone",
|
|
554
592
|
"x": 520,
|
|
555
|
-
"y":
|
|
593
|
+
"y": 1560,
|
|
556
594
|
"given": "a certificate with 30 days left",
|
|
557
|
-
"when": "the certificate manager runs",
|
|
558
|
-
"then": "a new certificate is in use the same day with no failed request",
|
|
595
|
+
"when": "the certificate manager runs, and once a renewal is made to fail",
|
|
596
|
+
"then": "a new certificate is in use the same day with no failed request; the failed one raises an alert at 14 days",
|
|
559
597
|
"hubWhen": {
|
|
560
598
|
"CERTS": [
|
|
561
599
|
"acme"
|
|
@@ -567,7 +605,7 @@
|
|
|
567
605
|
"type": "scenario",
|
|
568
606
|
"label": "Expiring certificate alerted",
|
|
569
607
|
"x": 520,
|
|
570
|
-
"y":
|
|
608
|
+
"y": 1690,
|
|
571
609
|
"given": "a partner-facing certificate expiring in 29 days",
|
|
572
610
|
"when": "the daily check runs",
|
|
573
611
|
"then": "its owner is alerted, and the alerts stop when the new certificate is installed",
|
|
@@ -586,10 +624,10 @@
|
|
|
586
624
|
"concern": "encryption",
|
|
587
625
|
"status": "accepted",
|
|
588
626
|
"date": "",
|
|
589
|
-
"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.",
|
|
590
|
-
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS); certificates are issued {{CERTS}}. Between our own elements,
|
|
591
|
-
"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.",
|
|
592
|
-
"alternatives": "1. TLS on every connection, configured per element: no mesh to run, but no caller identity and more places to get wrong.\
|
|
627
|
+
"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); certificates are issued {{CERTS}}. 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
|
+
"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
|
+
"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.",
|
|
593
631
|
"hubWhen": {
|
|
594
632
|
"INTERNAL": [
|
|
595
633
|
"mtls"
|
|
@@ -605,9 +643,9 @@
|
|
|
605
643
|
"concern": "encryption",
|
|
606
644
|
"status": "accepted",
|
|
607
645
|
"date": "",
|
|
608
|
-
"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.",
|
|
646
|
+
"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.",
|
|
609
647
|
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS); certificates are issued {{CERTS}}. 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).",
|
|
610
|
-
"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.",
|
|
648
|
+
"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.",
|
|
611
649
|
"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.",
|
|
612
650
|
"hubWhen": {
|
|
613
651
|
"INTERNAL": [
|
|
@@ -624,9 +662,9 @@
|
|
|
624
662
|
"concern": "encryption",
|
|
625
663
|
"status": "accepted",
|
|
626
664
|
"date": "",
|
|
627
|
-
"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.",
|
|
665
|
+
"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
666
|
"decision": "Outside callers get {{TLS}} at the edge (Mozilla profile, HSTS); certificates are issued {{CERTS}}. 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.",
|
|
629
|
-
"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.",
|
|
667
|
+
"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.",
|
|
630
668
|
"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.",
|
|
631
669
|
"hubWhen": {
|
|
632
670
|
"INTERNAL": [
|
|
@@ -643,7 +681,7 @@
|
|
|
643
681
|
"concern": "encryption",
|
|
644
682
|
"status": "accepted",
|
|
645
683
|
"date": "",
|
|
646
|
-
"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.",
|
|
684
|
+
"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
685
|
"decision": "Databases, queues, object stores, disks, snapshots and backups use the provider's default AES-256 encryption with provider-managed keys (Amazon RDS and S3 default encryption, Azure Storage Service Encryption, Google default encryption at rest); the provider creates, stores and rotates the keys. No resource may be created unencrypted, which the provider's policy service checks. Moving to customer-managed keys is a later decision, needed when a customer, auditor or regulation asks who can decrypt.",
|
|
648
686
|
"consequences": "• No keys to manage, no cost and no risk of locking ourselves out.\n• Protects lost disks and media, not data read through the database or the storage API.\n• We cannot prove, disable or audit the use of the keys ourselves.",
|
|
649
687
|
"alternatives": "1. Customer-managed keys in a KMS: our key policy and audit log, a little cost and care.\n2. Application-level field encryption: protects against administrators and backups too, at the cost of search and indexing on those fields.",
|
|
@@ -662,9 +700,9 @@
|
|
|
662
700
|
"concern": "encryption",
|
|
663
701
|
"status": "accepted",
|
|
664
702
|
"date": "",
|
|
665
|
-
"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.",
|
|
666
|
-
"decision": "Stored data is encrypted with AES-256 under customer-managed keys in the cloud's KMS (AWS KMS, Azure Key Vault or Managed HSM, Google Cloud KMS), one key per element and environment, with a key policy that lets only the element's identity use it and only key administrators manage it
|
|
667
|
-
"consequences": "• We decide and can prove who may decrypt, and can disable a key to make data unreadable.\n• A deleted or disabled key makes data unrecoverable: deletion has a waiting period and needs two people.\n• KMS calls cost money and add latency on every data key fetch; caching data keys keeps it small.",
|
|
703
|
+
"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.",
|
|
704
|
+
"decision": "Stored data is encrypted with AES-256 under customer-managed keys in the cloud's KMS (AWS KMS, Azure Key Vault or Managed HSM, Google Cloud KMS), one key per element and environment, with a key policy that lets only the element's identity use it and only key administrators manage it, the two sets of principals disjoint and the administrators' actions listed rather than kms:*; every use is logged by the provider's audit trail. On AWS the policy keeps the statement AWS documents for every key, which gives the account root kms:* so that the key can never become unmanageable; it lets IAM policies in the account grant use of the key, so those are reviewed with the key policy, and the key-policy check exempts that one principal. Key rotation: {{ROTATION}}, every {{KEY_ROTATE_DAYS}} days. A key suspected compromised is replaced whatever the rotation: a new key, the data or its data keys re-encrypted under it within 72 hours, the old key disabled. Choose an HSM-backed tier (CloudHSM, Managed HSM, Cloud HSM) when a standard requires FIPS 140-3 level 3, and an external key store only when a contract requires the keys outside the provider.",
|
|
705
|
+
"consequences": "• We decide and can prove who may decrypt, and can disable a key to make data unreadable.\n• On AWS the account-root statement means an IAM policy in the account can grant use of the key: the key policy alone does not prove who may decrypt.\n• A deleted or disabled key makes data unrecoverable: deletion has a waiting period and needs two people.\n• KMS calls cost money and add latency on every data key fetch; caching data keys keeps it small.",
|
|
668
706
|
"alternatives": "1. Provider-managed keys: no work, no control.\n2. Application-level field encryption on top: protects the most sensitive fields from anyone who can query the database.",
|
|
669
707
|
"hubWhen": {
|
|
670
708
|
"AT_REST": [
|
|
@@ -681,8 +719,8 @@
|
|
|
681
719
|
"concern": "encryption",
|
|
682
720
|
"status": "accepted",
|
|
683
721
|
"date": "",
|
|
684
|
-
"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.",
|
|
685
|
-
"decision": "The application encrypts {{SENSITIVE_FIELDS}} before writing them, with envelope encryption: AES-256-GCM data keys per record or tenant, wrapped by a customer-managed key in the KMS. Everything else is encrypted at rest under customer-managed keys. Key rotation: {{ROTATION}}, every {{KEY_ROTATE_DAYS}} days. Library: Google Tink or the AWS Encryption SDK in the element, or HashiCorp Vault Transit when several languages must share the keys; never cryptography written by hand. Fields that must be searched get a separate keyed hash (HMAC-SHA-256) for exact matches.",
|
|
722
|
+
"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.",
|
|
723
|
+
"decision": "The application encrypts {{SENSITIVE_FIELDS}} before writing them, with envelope encryption: AES-256-GCM data keys per record or tenant, wrapped by a customer-managed key in the KMS. Everything else is encrypted at rest under customer-managed keys, one key per element and environment, with a key policy that lets only the element's identity use it and only key administrators manage it, the two sets disjoint (on AWS apart from the account-root statement AWS documents for every key, which keeps the key manageable and lets IAM policies grant use, so those are reviewed with it); every use is logged by the provider's audit trail. Key rotation: {{ROTATION}}, every {{KEY_ROTATE_DAYS}} days. A key suspected compromised is replaced whatever the rotation: a new key, the data keys re-encrypted under it within 72 hours, the old key disabled. Library: Google Tink or the AWS Encryption SDK in the element, or HashiCorp Vault Transit when several languages must share the keys; never cryptography written by hand. Fields that must be searched get a separate keyed hash (HMAC-SHA-256) for exact matches.",
|
|
686
724
|
"consequences": "• Database administrators, backups, replicas and SQL injection see only ciphertext for those fields.\n• Those fields cannot be sorted, range-queried or full-text searched in the database.\n• Migrations and analytics must go through the application or the KMS to read them.\n• Losing the KMS key loses those fields, even in backups.",
|
|
687
725
|
"alternatives": "1. Customer-managed keys at rest only: transparent to the application, but visible to anyone who can query.\n2. Tokenisation by a vault service (for cards, a PCI provider): takes the data out of scope entirely, adds a dependency.\n3. Database column encryption (Always Encrypted, pgcrypto): less code, but keys or plaintext pass through the database.",
|
|
688
726
|
"hubWhen": {
|
|
@@ -694,22 +732,69 @@
|
|
|
694
732
|
{
|
|
695
733
|
"id": "ff-tls-scan",
|
|
696
734
|
"type": "fitness-fn",
|
|
697
|
-
"label": "Public TLS
|
|
735
|
+
"label": "Public TLS: 1.3 only",
|
|
698
736
|
"x": 1040,
|
|
699
737
|
"y": 0,
|
|
700
|
-
"
|
|
701
|
-
"
|
|
702
|
-
"
|
|
738
|
+
"characteristic": "security",
|
|
739
|
+
"scope": "atomic",
|
|
740
|
+
"cadence": "triggered",
|
|
741
|
+
"trigger": "nightly",
|
|
742
|
+
"invocation": "automated",
|
|
743
|
+
"description": "A scheduled job scans each public endpoint with testssl.sh and reads the protocol findings from its JSON (ids SSLv2, SSLv3, TLS1, TLS1_1, TLS1_2, TLS1_3), then checks the redirect, the HSTS header and the certificate's expiry with curl and openssl.\n\nThreshold: On every public endpoint: TLS 1.3 offered and SSLv2, SSLv3, TLS 1.0, 1.1 and 1.2 not offered; 0 findings of severity HIGH or CRITICAL; plain HTTP redirected; HSTS max-age at least 31536000; the certificate valid for at least 14 more days\n\nTool: testssl.sh 3.2 (docker), jq, curl and openssl\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nwhile read -r endpoint; do\n # testssl.sh exits non-zero on ambiguous results too, so the JSON decides; --ip one: one entry per check, not one per address\n docker run --rm -v \"$PWD\":/out drwetter/testssl.sh:3.2 --quiet --warnings off --ip one --jsonfile \"/out/$endpoint.json\" \"$endpoint\" || true\n [ -s \"$endpoint.json\" ] || { echo \"$endpoint: scan produced no result\"; exit 1; }\n jq -e '\n ([.[] | select(.severity == \"HIGH\" or .severity == \"CRITICAL\")] | length == 0)\n and ([.[] | select(.id == \"TLS1_3\")] | length == 1 and all(.finding | startswith(\"offered\")))\n and ([.[] | select(.id | IN(\"SSLv2\", \"SSLv3\", \"TLS1\", \"TLS1_1\", \"TLS1_2\"))] | length == 5 and all(.finding | startswith(\"not offered\")))\n ' \"$endpoint.json\" > /dev/null || { echo \"$endpoint: not TLS 1.3 only, or a HIGH/CRITICAL finding\"; exit 1; }\n curl -sI \"http://$endpoint/\" | grep -Eq '^HTTP/[0-9.]+ 30[1278]' || { echo \"$endpoint: plain HTTP not redirected\"; exit 1; }\n max_age=$(curl -sI \"https://$endpoint/\" | grep -i '^strict-transport-security:' | grep -Eo 'max-age=[0-9]+' | cut -d= -f2 || true)\n [ \"${max_age:-0}\" -ge 31536000 ] || { echo \"$endpoint: HSTS max-age under a year\"; exit 1; }\n echo | openssl s_client -connect \"$endpoint:443\" -servername \"$endpoint\" 2>/dev/null \\\n | openssl x509 -noout -checkend $(( 14 * 86400 )) || { echo \"$endpoint: certificate expires within 14 days\"; exit 1; }\ndone < endpoints.txt\n```",
|
|
744
|
+
"hubWhen": {
|
|
745
|
+
"TLS": [
|
|
746
|
+
"modern"
|
|
747
|
+
]
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"id": "ff-tls-scan-12",
|
|
752
|
+
"type": "fitness-fn",
|
|
753
|
+
"label": "Public TLS: 1.2 and 1.3, strong suites",
|
|
754
|
+
"x": 1040,
|
|
755
|
+
"y": 130,
|
|
756
|
+
"characteristic": "security",
|
|
757
|
+
"scope": "atomic",
|
|
758
|
+
"cadence": "triggered",
|
|
759
|
+
"trigger": "nightly",
|
|
760
|
+
"invocation": "automated",
|
|
761
|
+
"description": "A scheduled job scans each public endpoint with testssl.sh and reads the protocol and cipher-list findings from its JSON (ids TLS1_2, TLS1_3, SSLv2, SSLv3, TLS1, TLS1_1, cipherlist_3DES_IDEA, cipherlist_OBSOLETED, cipherlist_STRONG_NOFS), then checks the redirect, the HSTS header and the certificate's expiry with curl and openssl.\n\nThreshold: On every public endpoint: TLS 1.2 and 1.3 offered; SSLv2, SSLv3, TLS 1.0 and 1.1 not offered; the 3DES/IDEA, obsoleted (CBC, static RSA) and non-forward-secret cipher lists not offered; 0 findings of severity HIGH or CRITICAL; plain HTTP redirected; HSTS max-age at least 31536000; the certificate valid for at least 14 more days\n\nTool: testssl.sh 3.2 (docker), jq, curl and openssl\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nwhile read -r endpoint; do\n # testssl.sh exits non-zero on ambiguous results too, so the JSON decides; --ip one: one entry per check, not one per address\n docker run --rm -v \"$PWD\":/out drwetter/testssl.sh:3.2 --quiet --warnings off --ip one --jsonfile \"/out/$endpoint.json\" \"$endpoint\" || true\n [ -s \"$endpoint.json\" ] || { echo \"$endpoint: scan produced no result\"; exit 1; }\n jq -e '\n ([.[] | select(.severity == \"HIGH\" or .severity == \"CRITICAL\")] | length == 0)\n and ([.[] | select(.id | IN(\"TLS1_2\", \"TLS1_3\"))] | length == 2 and all(.finding | startswith(\"offered\")))\n and ([.[] | select(.id | IN(\"SSLv2\", \"SSLv3\", \"TLS1\", \"TLS1_1\"))] | length == 4 and all(.finding | startswith(\"not offered\")))\n and ([.[] | select(.id | IN(\"cipherlist_3DES_IDEA\", \"cipherlist_OBSOLETED\", \"cipherlist_STRONG_NOFS\"))] | length == 3 and all(.finding | startswith(\"not offered\")))\n ' \"$endpoint.json\" > /dev/null || { echo \"$endpoint: outside the intermediate profile, or a HIGH/CRITICAL finding\"; exit 1; }\n curl -sI \"http://$endpoint/\" | grep -Eq '^HTTP/[0-9.]+ 30[1278]' || { echo \"$endpoint: plain HTTP not redirected\"; exit 1; }\n max_age=$(curl -sI \"https://$endpoint/\" | grep -i '^strict-transport-security:' | grep -Eo 'max-age=[0-9]+' | cut -d= -f2 || true)\n [ \"${max_age:-0}\" -ge 31536000 ] || { echo \"$endpoint: HSTS max-age under a year\"; exit 1; }\n echo | openssl s_client -connect \"$endpoint:443\" -servername \"$endpoint\" 2>/dev/null \\\n | openssl x509 -noout -checkend $(( 14 * 86400 )) || { echo \"$endpoint: certificate expires within 14 days\"; exit 1; }\ndone < endpoints.txt\n```",
|
|
762
|
+
"hubWhen": {
|
|
763
|
+
"TLS": [
|
|
764
|
+
"intermediate"
|
|
765
|
+
]
|
|
766
|
+
}
|
|
703
767
|
},
|
|
704
768
|
{
|
|
705
769
|
"id": "ff-mesh-strict",
|
|
706
770
|
"type": "fitness-fn",
|
|
707
771
|
"label": "Mesh in strict mode",
|
|
708
772
|
"x": 1040,
|
|
709
|
-
"y":
|
|
710
|
-
"
|
|
711
|
-
"
|
|
712
|
-
"
|
|
773
|
+
"y": 260,
|
|
774
|
+
"characteristic": "security",
|
|
775
|
+
"scope": "atomic",
|
|
776
|
+
"cadence": "triggered",
|
|
777
|
+
"trigger": "pull-request",
|
|
778
|
+
"invocation": "automated",
|
|
779
|
+
"description": "A Conftest policy over all rendered manifests at once fails when the mesh-wide mutual TLS policy is missing, or when any PeerAuthentication leaves the mode unset (which inherits PERMISSIVE) or sets another one, on the workload or on a port.\n\nThreshold: A mesh-wide PeerAuthentication (istio-system, no selector) with mtls.mode STRICT exists, and 0 PeerAuthentications or port-level settings with any other mode or none\n\nTool: Conftest (Open Policy Agent) over Istio manifests\n\n```rego\n# conftest test --combine manifests/\npackage main\n\nimport rego.v1\n\ndocs contains d if { some f in input; is_array(f.contents); some d in f.contents }\ndocs contains d if { some f in input; not is_array(f.contents); d := f.contents }\n\nmesh_wide_strict if {\n some p in docs\n p.kind == \"PeerAuthentication\"\n p.metadata.namespace == \"istio-system\"\n not p.spec.selector\n p.spec.mtls.mode == \"STRICT\"\n}\n\ndeny contains msg if {\n not mesh_wide_strict\n msg := \"no mesh-wide PeerAuthentication in istio-system with mtls.mode STRICT\"\n}\n\ndeny contains msg if {\n some p in docs\n p.kind == \"PeerAuthentication\"\n not p.spec.mtls.mode == \"STRICT\" # unset inherits PERMISSIVE\n msg := sprintf(\"%s/%s weakens mutual TLS (mode %v)\", [p.metadata.namespace, p.metadata.name, object.get(p, [\"spec\", \"mtls\", \"mode\"], \"unset\")])\n}\n\ndeny contains msg if {\n some p in docs\n p.kind == \"PeerAuthentication\"\n some port, setting in p.spec.portLevelMtls\n not setting.mode == \"STRICT\"\n msg := sprintf(\"%s/%s turns off mutual TLS on port %v\", [p.metadata.namespace, p.metadata.name, port])\n}\n```",
|
|
780
|
+
"hubWhen": {
|
|
781
|
+
"INTERNAL": [
|
|
782
|
+
"mtls"
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"id": "ff-mesh-cert-ttl",
|
|
788
|
+
"type": "fitness-fn",
|
|
789
|
+
"label": "Mesh certificates short-lived",
|
|
790
|
+
"x": 1040,
|
|
791
|
+
"y": 390,
|
|
792
|
+
"characteristic": "security",
|
|
793
|
+
"scope": "atomic",
|
|
794
|
+
"cadence": "triggered",
|
|
795
|
+
"trigger": "nightly",
|
|
796
|
+
"invocation": "automated",
|
|
797
|
+
"description": "A scheduled job lists the pods with an istio-proxy sidecar (a container, or a native sidecar among the init containers), reads each one's workload certificate (the SDS secret named default) with istioctl, and fails on one that will still be valid in 24 hours, which means the mesh issues certificates that live longer than decided. Together with Mesh in strict mode (configuration) it checks the requirement.\n\nThreshold: 0 meshed pods whose workload certificate is valid for more than 24 more hours\n\nTool: istioctl proxy-config secret, kubectl, jq and openssl (sidecar mode; in ambient mode: istioctl ztunnel-config certificates)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nfail=0\npods=$(kubectl get pods -A -o json | jq -r '.items[]\n | select(any((.spec.containers + (.spec.initContainers // []))[]; .name == \"istio-proxy\"))\n | \"\\(.metadata.name).\\(.metadata.namespace)\"')\nfor pod in $pods; do\n istioctl proxy-config secret \"$pod\" -o json \\\n | jq -r '[.dynamicActiveSecrets[] | select(.name == \"default\")][0].secret.tlsCertificate.certificateChain.inlineBytes' \\\n | base64 --decode > leaf.pem\n # -checkend succeeds when the certificate is still valid after the given seconds\n if openssl x509 -in leaf.pem -noout -checkend 86400 > /dev/null; then\n echo \"$pod: workload certificate valid for more than 24 more hours\"; fail=1\n fi\ndone\nexit $fail\n```",
|
|
713
798
|
"hubWhen": {
|
|
714
799
|
"INTERNAL": [
|
|
715
800
|
"mtls"
|
|
@@ -721,10 +806,13 @@
|
|
|
721
806
|
"type": "fitness-fn",
|
|
722
807
|
"label": "Backends refuse clear text",
|
|
723
808
|
"x": 1040,
|
|
724
|
-
"y":
|
|
725
|
-
"
|
|
726
|
-
"
|
|
727
|
-
"
|
|
809
|
+
"y": 520,
|
|
810
|
+
"characteristic": "security",
|
|
811
|
+
"scope": "holistic",
|
|
812
|
+
"cadence": "triggered",
|
|
813
|
+
"trigger": "deploy",
|
|
814
|
+
"invocation": "automated",
|
|
815
|
+
"description": "A smoke test after each deployment tries each database without TLS and expects a refusal, checks every internal endpoint for a certificate that verifies against our CA and for a refusal of plain HTTP; a Semgrep rule set fails the build on settings that skip or downgrade verification.\n\nThreshold: 0 databases that accept a connection without TLS; every internal endpoint (queues, other elements) answers verifiable TLS and 0 answer plain HTTP; 0 client settings that skip or downgrade verification\n\nTool: psql, openssl, curl and Semgrep\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n# the database must refuse clear text (rds.force_ssl=1, hostssl-only pg_hba.conf)\nif psql \"host=$DB_HOST dbname=$DB_NAME user=$DB_USER sslmode=disable\" -c 'select 1' 2>/dev/null; then\n echo \"database $DB_HOST accepts connections without TLS\"; exit 1\nfi\n# queues and other elements: TLS that verifies against our CA, and no plain HTTP (host:port per line)\nwhile read -r ep; do\n echo | openssl s_client -connect \"$ep\" -servername \"${ep%%:*}\" -CAfile \"$INTERNAL_CA\" 2>/dev/null | grep -q 'Verify return code: 0' \\\n || { echo \"$ep: no TLS that verifies against our CA\"; exit 1; }\n if curl -sf --max-time 5 -o /dev/null \"http://$ep/\"; then echo \"$ep answers plain HTTP\"; exit 1; fi\ndone < internal-endpoints.txt\n# no client may skip or downgrade verification\ncat > /tmp/tls-verify.yml <<'RULES'\nrules:\n- id: tls-verification-off\n message: TLS verification turned off or downgraded (ADR TLS on every connection)\n severity: ERROR\n languages: [generic]\n pattern-either:\n - pattern: sslmode=require\n - pattern: sslmode=prefer\n - pattern: 'rejectUnauthorized: false'\n - pattern: 'InsecureSkipVerify: true'\n - pattern: verify=False\nRULES\nsemgrep --config /tmp/tls-verify.yml --error src/\n```",
|
|
728
816
|
"hubWhen": {
|
|
729
817
|
"INTERNAL": [
|
|
730
818
|
"tls"
|
|
@@ -736,10 +824,13 @@
|
|
|
736
824
|
"type": "fitness-fn",
|
|
737
825
|
"label": "Private network stays private",
|
|
738
826
|
"x": 1040,
|
|
739
|
-
"y":
|
|
740
|
-
"
|
|
741
|
-
"
|
|
742
|
-
"
|
|
827
|
+
"y": 650,
|
|
828
|
+
"characteristic": "security",
|
|
829
|
+
"scope": "atomic",
|
|
830
|
+
"cadence": "triggered",
|
|
831
|
+
"trigger": "pull-request",
|
|
832
|
+
"invocation": "automated",
|
|
833
|
+
"description": "A Conftest policy over the Terraform plan fails when the private network gains a peering, a public address or an open ingress rule, any of which breaks the conditions of the decision. The rules are for the AWS provider; the Azure and Google providers' peering, public IP and security rule resources are checked the same way.\n\nThreshold: 0 VPC peerings, 0 public addresses (elastic IPs, instances with a public address, subnets that assign one) and 0 0.0.0.0/0 or ::/0 ingress rules on the element's network in the Terraform plan\n\nTool: Conftest (Open Policy Agent) over terraform show -json (AWS provider; for Azure: azurerm_virtual_network_peering, azurerm_public_ip, azurerm_network_security_rule; for Google: google_compute_network_peering, google_compute_address, google_compute_firewall)\n\n```rego\npackage main\n\nimport rego.v1\n\nchanges contains rc if { some rc in input.resource_changes; rc.change.actions[_] != \"delete\" }\n\ndeny contains msg if {\n some rc in changes\n rc.type == \"aws_vpc_peering_connection\"\n msg := sprintf(\"%s: peering breaks the clear-text-inside decision\", [rc.address])\n}\n\ndeny contains msg if {\n some rc in changes\n rc.type in {\"aws_eip\", \"aws_eip_association\"}\n msg := sprintf(\"%s: a public address on the private network\", [rc.address])\n}\n\ndeny contains msg if {\n some rc in changes\n rc.type == \"aws_instance\"\n rc.change.after.associate_public_ip_address == true\n msg := sprintf(\"%s gets a public address\", [rc.address])\n}\n\ndeny contains msg if {\n some rc in changes\n rc.type == \"aws_subnet\"\n rc.change.after.map_public_ip_on_launch == true\n msg := sprintf(\"%s assigns public addresses\", [rc.address])\n}\n\nopen_cidr(c) if c in {\"0.0.0.0/0\", \"::/0\"}\n\ndeny contains msg if {\n some rc in changes\n rc.type == \"aws_security_group_rule\"\n rc.change.after.type == \"ingress\"\n some c in array.concat(object.get(rc.change.after, \"cidr_blocks\", []), object.get(rc.change.after, \"ipv6_cidr_blocks\", []))\n open_cidr(c)\n msg := sprintf(\"%s opens the private network to the internet\", [rc.address])\n}\n\ndeny contains msg if {\n some rc in changes\n rc.type == \"aws_vpc_security_group_ingress_rule\"\n some c in [rc.change.after.cidr_ipv4, rc.change.after.cidr_ipv6]\n open_cidr(c)\n msg := sprintf(\"%s opens the private network to the internet\", [rc.address])\n}\n```",
|
|
743
834
|
"hubWhen": {
|
|
744
835
|
"INTERNAL": [
|
|
745
836
|
"private"
|
|
@@ -751,20 +842,67 @@
|
|
|
751
842
|
"type": "fitness-fn",
|
|
752
843
|
"label": "Nothing stored unencrypted",
|
|
753
844
|
"x": 1040,
|
|
754
|
-
"y":
|
|
755
|
-
"
|
|
756
|
-
"
|
|
757
|
-
"
|
|
845
|
+
"y": 780,
|
|
846
|
+
"characteristic": "security",
|
|
847
|
+
"scope": "atomic",
|
|
848
|
+
"cadence": "continual",
|
|
849
|
+
"invocation": "automated",
|
|
850
|
+
"description": "AWS Config managed rules evaluate every database, snapshot, volume and bucket continuously and report one that is not encrypted at rest.\n\nThreshold: 0 non-compliant database instances, snapshots, volumes or buckets\n\nTool: AWS Config managed rules (for Azure: the built-in Azure Policy definitions for storage and SQL encryption; for Google: encryption at rest is always on, the Organization Policy only matters for customer-managed keys)\n\n```hcl\nlocals {\n encryption_rules = [\n \"RDS_STORAGE_ENCRYPTED\",\n \"RDS_SNAPSHOT_ENCRYPTED\",\n \"ENCRYPTED_VOLUMES\",\n \"S3_BUCKET_SERVER_SIDE_ENCRYPTION_ENABLED\",\n ]\n}\n\nresource \"aws_config_config_rule\" \"encrypted_at_rest\" {\n for_each = toset(local.encryption_rules)\n name = lower(replace(each.value, \"_\", \"-\"))\n source {\n owner = \"AWS\"\n source_identifier = each.value\n }\n}\n```",
|
|
851
|
+
"hubWhen": {
|
|
852
|
+
"AT_REST": [
|
|
853
|
+
"provider"
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"id": "ff-rest-cmk",
|
|
859
|
+
"type": "fitness-fn",
|
|
860
|
+
"label": "Stored under our key only",
|
|
861
|
+
"x": 1040,
|
|
862
|
+
"y": 910,
|
|
863
|
+
"characteristic": "security",
|
|
864
|
+
"scope": "atomic",
|
|
865
|
+
"cadence": "continual",
|
|
866
|
+
"invocation": "automated",
|
|
867
|
+
"description": "AWS Config managed rules evaluate every database, volume and bucket continuously with the element's key passed as the only allowed key, so a resource encrypted with a provider-managed key is reported too; snapshots are checked for encryption.\n\nThreshold: 0 database instances, volumes or buckets encrypted with any key but the element's customer-managed key; 0 unencrypted snapshots\n\nTool: AWS Config managed rules with key parameters (for Azure: Azure Policy \"should use customer-managed keys\" definitions; for Google: the Organization Policy constraint gcp.restrictNonCmekServices)\n\n```hcl\nlocals {\n key_arn = aws_kms_key.data.arn # one key per element and environment\n}\n\nresource \"aws_config_config_rule\" \"rds_our_key\" {\n name = \"rds-storage-encrypted-with-our-key\"\n source {\n owner = \"AWS\"\n source_identifier = \"RDS_STORAGE_ENCRYPTED\"\n }\n input_parameters = jsonencode({ kmsKeyId = local.key_arn })\n}\n\nresource \"aws_config_config_rule\" \"rds_snapshots\" {\n name = \"rds-snapshot-encrypted\"\n source {\n owner = \"AWS\"\n source_identifier = \"RDS_SNAPSHOT_ENCRYPTED\"\n }\n}\n\nresource \"aws_config_config_rule\" \"volumes_our_key\" {\n name = \"encrypted-volumes-with-our-key\"\n source {\n owner = \"AWS\"\n source_identifier = \"ENCRYPTED_VOLUMES\"\n }\n input_parameters = jsonencode({ kmsId = local.key_arn })\n}\n\nresource \"aws_config_config_rule\" \"buckets_our_key\" {\n name = \"s3-default-encryption-with-our-key\"\n source {\n owner = \"AWS\"\n source_identifier = \"S3_DEFAULT_ENCRYPTION_KMS\"\n }\n input_parameters = jsonencode({ kmsKeyArns = local.key_arn })\n}\n```",
|
|
868
|
+
"hubWhen": {
|
|
869
|
+
"AT_REST": [
|
|
870
|
+
"cmk",
|
|
871
|
+
"field"
|
|
872
|
+
]
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"id": "ff-key-policy",
|
|
877
|
+
"type": "fitness-fn",
|
|
878
|
+
"label": "Key use and administration apart",
|
|
879
|
+
"x": 1040,
|
|
880
|
+
"y": 1040,
|
|
881
|
+
"characteristic": "security",
|
|
882
|
+
"scope": "atomic",
|
|
883
|
+
"cadence": "triggered",
|
|
884
|
+
"trigger": "pull-request",
|
|
885
|
+
"invocation": "automated",
|
|
886
|
+
"description": "A Conftest policy over the Terraform plan parses each KMS key policy and fails when a principal outside the element's roles may encrypt or decrypt, when one principal appears in both a use and an administration statement (kms:* counts as both), or when use is open to everyone (Principal \"*\" or {\"AWS\": \"*\"}). The account root (arn:aws:iam::<account>:root, or the bare account id) is exempt: AWS documents the statement that gives it kms:* as the one that keeps a key manageable, and the IAM policies it lets grant use are reviewed with the key policy, as adr-cmk says. A policy the plan cannot know yet (computed from another resource) is not checked; write it as a literal or a data source known at plan time. Every KMS call is logged by CloudTrail by default.\n\nThreshold: In every KMS key policy of the plan (aws_kms_key and aws_kms_key_policy), apart from the account-root statement AWS documents: the principals allowed to use the key are a subset of the element's roles, 0 principals may both use and administer it, and 0 statements grant use to *\n\nTool: Conftest (Open Policy Agent, rego.v1) over terraform show -json (AWS; for Azure: Key Vault RBAC assignments, for Google: IAM bindings on the key ring, checked the same way)\n\n```rego\npackage main\n\nimport rego.v1\n\naccount := \"123456789012\" # the account the keys live in\nelement_roles := {\"arn:aws:iam::123456789012:role/order-api\"} # the element's own identities\n\n# AWS's documented statement \"Enable IAM User Permissions\" gives the account root kms:*;\n# it keeps the key manageable and is exempt (IAM policies are reviewed with the key policy)\naccount_root := {sprintf(\"arn:aws:iam::%s:root\", [account]), account}\n\nuse_actions := {\"kms:Encrypt\", \"kms:Decrypt\", \"kms:GenerateDataKey\", \"kms:GenerateDataKey*\", \"kms:GenerateDataKeyWithoutPlaintext\", \"kms:ReEncrypt*\", \"kms:ReEncryptFrom\", \"kms:ReEncryptTo\", \"kms:*\", \"*\"}\nadmin_actions := {\"kms:Create*\", \"kms:Put*\", \"kms:Update*\", \"kms:Enable*\", \"kms:Disable*\", \"kms:Revoke*\", \"kms:ScheduleKeyDeletion\", \"kms:CancelKeyDeletion\", \"kms:TagResource\", \"kms:UntagResource\", \"kms:*\", \"*\"}\n\nas_set(x) := {x} if is_string(x)\nas_set(x) := {v | some v in x} if is_array(x)\n\nstatements(policy) := s if { s := json.unmarshal(policy).Statement; is_array(s) }\nstatements(policy) := [s] if { s := json.unmarshal(policy).Statement; is_object(s) }\n\nprincipals(s) := {\"*\"} if s.Principal == \"*\"\nprincipals(s) := as_set(s.Principal.AWS) if is_object(s.Principal)\n\npolicies[rc.address] := rc.change.after.policy if {\n some rc in input.resource_changes\n rc.type in {\"aws_kms_key\", \"aws_kms_key_policy\"}\n is_string(rc.change.after.policy)\n}\n\nallows(policy, actions) := granted - account_root if {\n granted := {p |\n some s in statements(policy)\n s.Effect == \"Allow\"\n count(as_set(s.Action) & actions) > 0\n some p in principals(s)\n }\n}\n\ndeny contains msg if {\n some address, policy in policies\n some p in allows(policy, use_actions) - element_roles\n p != \"*\"\n msg := sprintf(\"%s: %s may use the key but is not the element's identity\", [address, p])\n}\n\ndeny contains msg if {\n some address, policy in policies\n some p in allows(policy, use_actions) & allows(policy, admin_actions)\n msg := sprintf(\"%s: %s may both use and administer the key\", [address, p])\n}\n\ndeny contains msg if {\n some address, policy in policies\n \"*\" in allows(policy, use_actions)\n msg := sprintf(\"%s: anyone may use the key\", [address])\n}\n```",
|
|
887
|
+
"hubWhen": {
|
|
888
|
+
"AT_REST": [
|
|
889
|
+
"cmk",
|
|
890
|
+
"field"
|
|
891
|
+
]
|
|
892
|
+
}
|
|
758
893
|
},
|
|
759
894
|
{
|
|
760
895
|
"id": "ff-key-rotation",
|
|
761
896
|
"type": "fitness-fn",
|
|
762
897
|
"label": "Key rotation on",
|
|
763
898
|
"x": 1040,
|
|
764
|
-
"y":
|
|
765
|
-
"
|
|
766
|
-
"
|
|
767
|
-
"
|
|
899
|
+
"y": 1170,
|
|
900
|
+
"characteristic": "security",
|
|
901
|
+
"scope": "atomic",
|
|
902
|
+
"cadence": "triggered",
|
|
903
|
+
"trigger": "nightly",
|
|
904
|
+
"invocation": "automated",
|
|
905
|
+
"description": "A scheduled job lists the customer-managed keys, skips the asymmetric and HMAC ones (which the KMS cannot rotate) and fails on a symmetric key whose rotation is off or whose period is longer than {{KEY_ROTATE_DAYS}} days.\n\nThreshold: 0 customer-managed symmetric keys without automatic rotation; every rotation period at most {{KEY_ROTATE_DAYS}} days\n\nTool: AWS CLI and jq (for Azure: az keyvault key rotation-policy show; for Google: gcloud kms keys describe, field rotationPeriod)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nfor key in $(aws kms list-keys --query 'Keys[].KeyId' --output text); do\n meta=$(aws kms describe-key --key-id \"$key\" --query 'KeyMetadata' --output json)\n echo \"$meta\" | jq -e '.KeyManager == \"CUSTOMER\" and .KeySpec == \"SYMMETRIC_DEFAULT\" and .KeyState == \"Enabled\"' > /dev/null || continue\n aws kms get-key-rotation-status --key-id \"$key\" --output json \\\n | jq -e --argjson max {{KEY_ROTATE_DAYS}} '.KeyRotationEnabled and (.RotationPeriodInDays <= $max)' > /dev/null \\\n || { echo \"key $key: rotation off or longer than {{KEY_ROTATE_DAYS}} days\"; exit 1; }\ndone\n```",
|
|
768
906
|
"hubWhen": {
|
|
769
907
|
"AT_REST": [
|
|
770
908
|
"cmk",
|
|
@@ -780,10 +918,13 @@
|
|
|
780
918
|
"type": "fitness-fn",
|
|
781
919
|
"label": "No key past its period",
|
|
782
920
|
"x": 1040,
|
|
783
|
-
"y":
|
|
784
|
-
"
|
|
785
|
-
"
|
|
786
|
-
"
|
|
921
|
+
"y": 1300,
|
|
922
|
+
"characteristic": "security",
|
|
923
|
+
"scope": "atomic",
|
|
924
|
+
"cadence": "triggered",
|
|
925
|
+
"trigger": "nightly",
|
|
926
|
+
"invocation": "automated",
|
|
927
|
+
"description": "A scheduled job lists the customer-managed keys and fails on an enabled key past its cryptoperiod and the 30 days allowed for re-encryption, which means the old key still protects data. The creation date is an ISO 8601 string in the CLI's JSON and is converted before comparing.\n\nThreshold: 0 enabled customer-managed keys older than {{KEY_ROTATE_DAYS}} + 30 days\n\nTool: AWS CLI and jq (for Azure: az keyvault key list, attributes.created; for Google: gcloud kms keys versions list, createTime)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nmax=$(( ({{KEY_ROTATE_DAYS}} + 30) * 86400 ))\nfor key in $(aws kms list-keys --query 'Keys[].KeyId' --output text); do\n if aws kms describe-key --key-id \"$key\" --output json | jq -e --argjson max \"$max\" '\n .KeyMetadata | select(.KeyManager == \"CUSTOMER\" and .KeyState == \"Enabled\")\n | (now - (.CreationDate | sub(\"\\\\.[0-9]+\"; \"\") | sub(\"\\\\+00:00$\"; \"Z\") | fromdateiso8601)) > $max' > /dev/null; then\n echo \"key $key is past its cryptoperiod\"; exit 1\n fi\ndone\n```",
|
|
787
928
|
"hubWhen": {
|
|
788
929
|
"AT_REST": [
|
|
789
930
|
"cmk",
|
|
@@ -799,15 +940,53 @@
|
|
|
799
940
|
"type": "fitness-fn",
|
|
800
941
|
"label": "Fields stored as ciphertext",
|
|
801
942
|
"x": 1040,
|
|
802
|
-
"y":
|
|
803
|
-
"
|
|
804
|
-
"
|
|
805
|
-
"
|
|
943
|
+
"y": 1430,
|
|
944
|
+
"characteristic": "security",
|
|
945
|
+
"scope": "atomic",
|
|
946
|
+
"cadence": "triggered",
|
|
947
|
+
"trigger": "pull-request",
|
|
948
|
+
"invocation": "automated",
|
|
949
|
+
"description": "An integration test starts PostgreSQL in a container, runs the element's migrations, saves a record through the element's repository for each sensitive field, reads the row directly from the database and fails if the column holds the original value, or if the element cannot read it back.\n\nThreshold: 0 of the listed sensitive fields readable as plaintext in the database\n\nTool: Vitest with Testcontainers (@testcontainers/postgresql) and node-postgres; for the JVM: JUnit 5 with Testcontainers' PostgreSQLContainer and JdbcTemplate\n\n```ts\nimport { PostgreSqlContainer, type StartedPostgreSqlContainer } from '@testcontainers/postgresql'\nimport pg from 'pg'\nimport { afterAll, beforeAll, expect, it } from 'vitest'\nimport { migrate } from '../src/db/migrate' // the element's schema migrations\nimport { customerStore } from '../src/customers' // the element's repository; encrypts through the KMS client it is given\nimport { localKms } from './fixtures/kms' // a KMS stand-in with a local key (Tink's fake KMS client, or LocalStack's KMS)\n\n// one entry per field of: {{SENSITIVE_FIELDS}}\nconst SENSITIVE = [\n { field: 'cardNumber', column: 'card_number', value: '4111111111111111' },\n { field: 'nationalId', column: 'national_id', value: '85010112345' },\n { field: 'healthNote', column: 'health_note', value: 'type 1 diabetes' },\n] as const\n\nlet container: StartedPostgreSqlContainer\nlet pool: pg.Pool\nbeforeAll(async () => {\n container = await new PostgreSqlContainer('postgres:17').start()\n pool = new pg.Pool({ connectionString: container.getConnectionUri() })\n await migrate(pool)\n}, 120_000)\nafterAll(async () => { await pool.end(); await container.stop() })\n\nit.each(SENSITIVE)('stores $field as ciphertext and reads it back', async ({ field, column, value }) => {\n const customers = customerStore(pool, localKms())\n const { id } = await customers.create({ name: 'Ada', [field]: value })\n const { rows } = await pool.query(`select ${column}::text as stored from customers where id = $1`, [id])\n expect(rows[0].stored).not.toContain(value)\n expect((await customers.get(id))[field]).toBe(value)\n})\n```",
|
|
806
950
|
"hubWhen": {
|
|
807
951
|
"AT_REST": [
|
|
808
952
|
"field"
|
|
809
953
|
]
|
|
810
954
|
}
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"id": "ff-cert-renewal",
|
|
958
|
+
"type": "fitness-fn",
|
|
959
|
+
"label": "Renewal watched",
|
|
960
|
+
"x": 1040,
|
|
961
|
+
"y": 1560,
|
|
962
|
+
"characteristic": "security",
|
|
963
|
+
"scope": "atomic",
|
|
964
|
+
"cadence": "continual",
|
|
965
|
+
"invocation": "automated",
|
|
966
|
+
"description": "Prometheus rules over cert-manager's metrics page the owner when a certificate the manager should have renewed at 30 days is still within 14 days of expiry, or has not been Ready for an hour; the public endpoints' expiry is also checked by the TLS scan.\n\nThreshold: An alert fires for every certificate with fewer than 14 days left or not Ready for an hour; 0 certificates expire\n\nTool: Prometheus alerting rules over cert-manager metrics (for AWS Certificate Manager: a CloudWatch alarm on AWS/CertificateManager DaysToExpiry below 14)\n\n```yaml\ngroups:\n- name: certificates\n rules:\n - alert: CertificateNotRenewed\n expr: certmanager_certificate_expiration_timestamp_seconds - time() < 14 * 86400\n for: 1h\n labels: { severity: page }\n annotations: { summary: \"{{ $labels.namespace }}/{{ $labels.name }} expires in under 14 days: automatic renewal failed\" }\n - alert: CertificateNotReady\n expr: certmanager_certificate_ready_status{condition=\"False\"} == 1\n for: 1h\n labels: { severity: page }\n annotations: { summary: \"{{ $labels.namespace }}/{{ $labels.name }} is not Ready\" }\n```",
|
|
967
|
+
"hubWhen": {
|
|
968
|
+
"CERTS": [
|
|
969
|
+
"acme"
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
"id": "ff-cert-inventory",
|
|
975
|
+
"type": "fitness-fn",
|
|
976
|
+
"label": "Inventory expiry check",
|
|
977
|
+
"x": 1040,
|
|
978
|
+
"y": 1690,
|
|
979
|
+
"characteristic": "security",
|
|
980
|
+
"scope": "atomic",
|
|
981
|
+
"cadence": "triggered",
|
|
982
|
+
"trigger": "nightly",
|
|
983
|
+
"invocation": "automated",
|
|
984
|
+
"description": "A scheduled job reads the inventory (endpoint and owner per line), checks each certificate's expiry with openssl and alerts the owner of each one within 30 days of expiry; the job keeps failing, and alerting, until the certificate is replaced.\n\nThreshold: Every working day, every certificate on the inventory with fewer than 30 days left raises an alert to its named owner; the job fails while one is on the list\n\nTool: openssl in a scheduled job (cron, a scheduled CI workflow) with your alerting hook\n\n```bash\n#!/usr/bin/env bash\n# cert-inventory.txt: \"<host:port> <owner>\" per line; notify: your paging or chat hook\nset -uo pipefail\nfail=0\nwhile read -r endpoint owner; do\n [ -n \"$endpoint\" ] || continue\n if ! echo | openssl s_client -connect \"$endpoint\" -servername \"${endpoint%%:*}\" 2>/dev/null | openssl x509 -noout -checkend $(( 30 * 86400 )); then\n echo \"$endpoint expires within 30 days (owner: $owner)\"\n notify \"$owner\" \"certificate $endpoint expires within 30 days; replace it\"\n fail=1\n fi\ndone < cert-inventory.txt\nexit $fail\n```",
|
|
985
|
+
"hubWhen": {
|
|
986
|
+
"CERTS": [
|
|
987
|
+
"managed-ca"
|
|
988
|
+
]
|
|
989
|
+
}
|
|
811
990
|
}
|
|
812
991
|
],
|
|
813
992
|
"relations": [
|
|
@@ -877,6 +1056,12 @@
|
|
|
877
1056
|
"targetId": "need",
|
|
878
1057
|
"relationType": "derives"
|
|
879
1058
|
},
|
|
1059
|
+
{
|
|
1060
|
+
"id": "req-key-compromise--derives--need",
|
|
1061
|
+
"sourceId": "req-key-compromise",
|
|
1062
|
+
"targetId": "need",
|
|
1063
|
+
"relationType": "derives"
|
|
1064
|
+
},
|
|
880
1065
|
{
|
|
881
1066
|
"id": "req-certs-acme--derives--need",
|
|
882
1067
|
"sourceId": "req-certs-acme",
|
|
@@ -955,6 +1140,12 @@
|
|
|
955
1140
|
"targetId": "req-rotate-reencrypt",
|
|
956
1141
|
"relationType": "verifies"
|
|
957
1142
|
},
|
|
1143
|
+
{
|
|
1144
|
+
"id": "sc-key-compromise--verifies--req-key-compromise",
|
|
1145
|
+
"sourceId": "sc-key-compromise",
|
|
1146
|
+
"targetId": "req-key-compromise",
|
|
1147
|
+
"relationType": "verifies"
|
|
1148
|
+
},
|
|
958
1149
|
{
|
|
959
1150
|
"id": "sc-certs-acme--verifies--req-certs-acme",
|
|
960
1151
|
"sourceId": "sc-certs-acme",
|
|
@@ -985,12 +1176,36 @@
|
|
|
985
1176
|
"targetId": "adr-private",
|
|
986
1177
|
"relationType": "implements"
|
|
987
1178
|
},
|
|
1179
|
+
{
|
|
1180
|
+
"id": "ff-tls-scan-12--implements--adr-mtls",
|
|
1181
|
+
"sourceId": "ff-tls-scan-12",
|
|
1182
|
+
"targetId": "adr-mtls",
|
|
1183
|
+
"relationType": "implements"
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"id": "ff-tls-scan-12--implements--adr-internal-tls",
|
|
1187
|
+
"sourceId": "ff-tls-scan-12",
|
|
1188
|
+
"targetId": "adr-internal-tls",
|
|
1189
|
+
"relationType": "implements"
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"id": "ff-tls-scan-12--implements--adr-private",
|
|
1193
|
+
"sourceId": "ff-tls-scan-12",
|
|
1194
|
+
"targetId": "adr-private",
|
|
1195
|
+
"relationType": "implements"
|
|
1196
|
+
},
|
|
988
1197
|
{
|
|
989
1198
|
"id": "ff-mesh-strict--implements--adr-mtls",
|
|
990
1199
|
"sourceId": "ff-mesh-strict",
|
|
991
1200
|
"targetId": "adr-mtls",
|
|
992
1201
|
"relationType": "implements"
|
|
993
1202
|
},
|
|
1203
|
+
{
|
|
1204
|
+
"id": "ff-mesh-cert-ttl--implements--adr-mtls",
|
|
1205
|
+
"sourceId": "ff-mesh-cert-ttl",
|
|
1206
|
+
"targetId": "adr-mtls",
|
|
1207
|
+
"relationType": "implements"
|
|
1208
|
+
},
|
|
994
1209
|
{
|
|
995
1210
|
"id": "ff-backend-tls--implements--adr-internal-tls",
|
|
996
1211
|
"sourceId": "ff-backend-tls",
|
|
@@ -1010,14 +1225,26 @@
|
|
|
1010
1225
|
"relationType": "implements"
|
|
1011
1226
|
},
|
|
1012
1227
|
{
|
|
1013
|
-
"id": "ff-rest--implements--adr-cmk",
|
|
1014
|
-
"sourceId": "ff-rest",
|
|
1228
|
+
"id": "ff-rest-cmk--implements--adr-cmk",
|
|
1229
|
+
"sourceId": "ff-rest-cmk",
|
|
1015
1230
|
"targetId": "adr-cmk",
|
|
1016
1231
|
"relationType": "implements"
|
|
1017
1232
|
},
|
|
1018
1233
|
{
|
|
1019
|
-
"id": "ff-rest--implements--adr-field",
|
|
1020
|
-
"sourceId": "ff-rest",
|
|
1234
|
+
"id": "ff-rest-cmk--implements--adr-field",
|
|
1235
|
+
"sourceId": "ff-rest-cmk",
|
|
1236
|
+
"targetId": "adr-field",
|
|
1237
|
+
"relationType": "implements"
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
"id": "ff-key-policy--implements--adr-cmk",
|
|
1241
|
+
"sourceId": "ff-key-policy",
|
|
1242
|
+
"targetId": "adr-cmk",
|
|
1243
|
+
"relationType": "implements"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"id": "ff-key-policy--implements--adr-field",
|
|
1247
|
+
"sourceId": "ff-key-policy",
|
|
1021
1248
|
"targetId": "adr-field",
|
|
1022
1249
|
"relationType": "implements"
|
|
1023
1250
|
},
|
|
@@ -1050,6 +1277,42 @@
|
|
|
1050
1277
|
"sourceId": "ff-field",
|
|
1051
1278
|
"targetId": "adr-field",
|
|
1052
1279
|
"relationType": "implements"
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
"id": "ff-cert-renewal--implements--adr-mtls",
|
|
1283
|
+
"sourceId": "ff-cert-renewal",
|
|
1284
|
+
"targetId": "adr-mtls",
|
|
1285
|
+
"relationType": "implements"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
"id": "ff-cert-renewal--implements--adr-internal-tls",
|
|
1289
|
+
"sourceId": "ff-cert-renewal",
|
|
1290
|
+
"targetId": "adr-internal-tls",
|
|
1291
|
+
"relationType": "implements"
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"id": "ff-cert-renewal--implements--adr-private",
|
|
1295
|
+
"sourceId": "ff-cert-renewal",
|
|
1296
|
+
"targetId": "adr-private",
|
|
1297
|
+
"relationType": "implements"
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
"id": "ff-cert-inventory--implements--adr-mtls",
|
|
1301
|
+
"sourceId": "ff-cert-inventory",
|
|
1302
|
+
"targetId": "adr-mtls",
|
|
1303
|
+
"relationType": "implements"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
"id": "ff-cert-inventory--implements--adr-internal-tls",
|
|
1307
|
+
"sourceId": "ff-cert-inventory",
|
|
1308
|
+
"targetId": "adr-internal-tls",
|
|
1309
|
+
"relationType": "implements"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"id": "ff-cert-inventory--implements--adr-private",
|
|
1313
|
+
"sourceId": "ff-cert-inventory",
|
|
1314
|
+
"targetId": "adr-private",
|
|
1315
|
+
"relationType": "implements"
|
|
1053
1316
|
}
|
|
1054
1317
|
]
|
|
1055
1318
|
}
|