@radicaltools/cli 0.1.0 → 0.3.0
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 +335 -25
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +935 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +1112 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +685 -0
- package/dist/hub-catalogue/concern/concern-authorization.radical +1464 -0
- package/dist/hub-catalogue/concern/concern-availability.radical +804 -0
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +1118 -0
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1304 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +802 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +1202 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +1081 -0
- package/dist/hub-catalogue/concern/concern-data-store.radical +960 -0
- package/dist/hub-catalogue/concern/concern-decomposition.radical +1143 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +952 -0
- package/dist/hub-catalogue/concern/concern-encryption.radical +1055 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1340 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1151 -0
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1079 -0
- package/dist/hub-catalogue/concern/concern-messaging.radical +940 -0
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +864 -0
- package/dist/hub-catalogue/concern/concern-observability.radical +1048 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +1434 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +1026 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +1312 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1306 -0
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +1193 -0
- package/dist/index.js +9643 -1332
- package/package.json +6 -3
|
@@ -0,0 +1,1055 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "concern-encryption",
|
|
4
|
+
"category": "concern",
|
|
5
|
+
"name": "Encryption in transit and at rest",
|
|
6
|
+
"description": "How data is protected on the wire and on disk: TLS versions and where it ends, encryption between our own elements, who holds the keys for stored data, and how keys and certificates are rotated.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"security",
|
|
9
|
+
"encryption",
|
|
10
|
+
"tls",
|
|
11
|
+
"mtls",
|
|
12
|
+
"kms",
|
|
13
|
+
"key-management",
|
|
14
|
+
"certificates"
|
|
15
|
+
],
|
|
16
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
17
|
+
"concern": {
|
|
18
|
+
"id": "encryption",
|
|
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
|
+
"applyTo": "target",
|
|
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"
|
|
23
|
+
},
|
|
24
|
+
"sources": [
|
|
25
|
+
{
|
|
26
|
+
"title": "OWASP Transport Layer Security Cheat Sheet",
|
|
27
|
+
"url": "https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "OWASP Cryptographic Storage Cheat Sheet",
|
|
31
|
+
"url": "https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"title": "OWASP ASVS 4.0.3, V6 Stored Cryptography and V9 Communication",
|
|
35
|
+
"url": "https://owasp.org/www-project-application-security-verification-standard/"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"title": "NIST SP 800-57 Part 1 Rev. 5, Recommendation for Key Management",
|
|
39
|
+
"url": "https://csrc.nist.gov/pubs/sp/800/57/pt1/r5/final"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"title": "NIST SP 800-52 Rev. 2, Guidelines for TLS Implementations",
|
|
43
|
+
"url": "https://csrc.nist.gov/pubs/sp/800/52/r2/final"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"title": "Mozilla Server Side TLS recommended configurations",
|
|
47
|
+
"url": "https://wiki.mozilla.org/Security/Server_Side_TLS"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"title": "RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3",
|
|
51
|
+
"url": "https://www.rfc-editor.org/rfc/rfc8446"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"templateParams": [
|
|
55
|
+
{
|
|
56
|
+
"key": "TLS",
|
|
57
|
+
"title": "TLS from outside",
|
|
58
|
+
"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.",
|
|
60
|
+
"defaultValue": "intermediate",
|
|
61
|
+
"options": [
|
|
62
|
+
{
|
|
63
|
+
"value": "modern",
|
|
64
|
+
"label": "TLS 1.3 only",
|
|
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+)."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"value": "intermediate",
|
|
69
|
+
"label": "TLS 1.2 and 1.3 with forward-secret AEAD suites",
|
|
70
|
+
"description": "Mozilla's \"intermediate\" profile: ECDHE key exchange with AES-GCM or ChaCha20-Poly1305 only. Pick it when partners, older devices or legacy runtimes still need TLS 1.2, which is the common case."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"key": "INTERNAL",
|
|
76
|
+
"title": "Inside the system",
|
|
77
|
+
"label": "How is traffic between our own elements encrypted?",
|
|
78
|
+
"hint": "TLS that ends at the load balancer leaves everything behind it in clear text; whether that is acceptable depends on who else can see that network.",
|
|
79
|
+
"defaultValue": "mtls",
|
|
80
|
+
"options": [
|
|
81
|
+
{
|
|
82
|
+
"value": "mtls",
|
|
83
|
+
"label": "mutual TLS in a service mesh",
|
|
84
|
+
"description": "Istio, Linkerd or Cilium give every workload a certificate and encrypt and authenticate every hop, with no change to the code. Pick it on Kubernetes with many services, or when zero trust inside the cluster is required."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"value": "tls",
|
|
88
|
+
"label": "TLS on every connection, server certificates only",
|
|
89
|
+
"description": "The load balancer re-encrypts to the element; the element connects to databases and queues with TLS and verifies their certificates. Pick it without a mesh, or for a handful of elements; callers are not authenticated by the connection."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"value": "private",
|
|
93
|
+
"label": "clear text inside a private network",
|
|
94
|
+
"description": "TLS ends at the edge; traffic inside stays on a private network the cloud provider encrypts at the physical layer. Pick it only for a single VPC or VNet with no peering, no shared tenants, and no card or health data."
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"key": "AT_REST",
|
|
100
|
+
"title": "Keys at rest",
|
|
101
|
+
"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.",
|
|
103
|
+
"defaultValue": "cmk",
|
|
104
|
+
"options": [
|
|
105
|
+
{
|
|
106
|
+
"value": "provider",
|
|
107
|
+
"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."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"value": "cmk",
|
|
112
|
+
"label": "customer-managed keys in a KMS",
|
|
113
|
+
"description": "Keys you create in AWS KMS, Azure Key Vault or Google Cloud KMS, with your key policy, your audit log and the power to disable them. Pick it for personal, financial or contract data, or when customers or auditors ask who can decrypt."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"value": "field",
|
|
117
|
+
"label": "customer-managed keys plus application-level field encryption",
|
|
118
|
+
"description": "The application encrypts the listed fields before writing them (envelope encryption with Google Tink, the AWS Encryption SDK or Vault Transit), on top of customer-managed keys at rest. Pick it for card numbers, national ids, health or secret data that database administrators and backups must not see."
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"key": "ROTATION",
|
|
124
|
+
"title": "Key rotation",
|
|
125
|
+
"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. With provider-managed keys the provider decides.",
|
|
127
|
+
"defaultValue": "automatic",
|
|
128
|
+
"options": [
|
|
129
|
+
{
|
|
130
|
+
"value": "automatic",
|
|
131
|
+
"label": "automatic rotation of the key material",
|
|
132
|
+
"description": "The KMS creates new key material on schedule and keeps old versions for decryption only (AWS KMS automatic rotation, Key Vault rotation policy, Cloud KMS rotation period). Pick it unless a standard requires re-encryption; data stays as it is."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"value": "reencrypt",
|
|
136
|
+
"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), or after a suspected key compromise."
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"key": "CERTS",
|
|
143
|
+
"title": "Certificates",
|
|
144
|
+
"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.",
|
|
146
|
+
"defaultValue": "acme",
|
|
147
|
+
"options": [
|
|
148
|
+
{
|
|
149
|
+
"value": "acme",
|
|
150
|
+
"label": "automatically, with ACME or the cloud's certificate manager",
|
|
151
|
+
"description": "Let's Encrypt through cert-manager or Caddy, or AWS Certificate Manager, Azure or Google managed certificates, renewed by software. Pick it for public endpoints and anything the platform can terminate."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"value": "managed-ca",
|
|
155
|
+
"label": "from our own or a commercial CA, renewed by a tracked process",
|
|
156
|
+
"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."
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"key": "KEY_ROTATE_DAYS",
|
|
162
|
+
"label": "How often are our encryption keys rotated (days)?",
|
|
163
|
+
"defaultValue": "365",
|
|
164
|
+
"type": "number"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"key": "SENSITIVE_FIELDS",
|
|
168
|
+
"label": "Which fields are encrypted by the application?",
|
|
169
|
+
"defaultValue": "card numbers, national id numbers, health data"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"nodes": [
|
|
174
|
+
{
|
|
175
|
+
"id": "need",
|
|
176
|
+
"type": "need",
|
|
177
|
+
"label": "Data unreadable to others",
|
|
178
|
+
"x": 0,
|
|
179
|
+
"y": 0,
|
|
180
|
+
"kind": "brief",
|
|
181
|
+
"source": "Hub concern pack: Encryption in transit and at rest",
|
|
182
|
+
"description": "Data reaches the element from people and other systems and is kept in its databases, queues, files and backups. Nobody between the caller and the element, nobody on the network inside, and nobody who gets a disk, a snapshot or a backup may read or change it; the people who can decrypt it are known and few; and the certificates and keys that protect it neither expire unnoticed nor stay in use for years."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "req-tls-outside",
|
|
186
|
+
"type": "requirement",
|
|
187
|
+
"label": "Only TLS from outside",
|
|
188
|
+
"x": 260,
|
|
189
|
+
"y": 0,
|
|
190
|
+
"ears_type": "ubiquitous",
|
|
191
|
+
"action": "accept connections from people and other systems only over {{TLS}}, redirect plain HTTP to HTTPS, and send Strict-Transport-Security with a max-age of at least 31536000 seconds",
|
|
192
|
+
"rationale": "Anything outside crosses networks we do not control; HSTS stops the first request being downgraded (ASVS 9.1.1, 9.1.2; OWASP TLS Cheat Sheet; Mozilla Server Side TLS)."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "req-tls13",
|
|
196
|
+
"type": "requirement",
|
|
197
|
+
"label": "Older protocols refused",
|
|
198
|
+
"x": 260,
|
|
199
|
+
"y": 130,
|
|
200
|
+
"ears_type": "unwanted-behaviour",
|
|
201
|
+
"unwanted_condition": "a client offers only TLS 1.2 or older",
|
|
202
|
+
"action": "refuse the handshake",
|
|
203
|
+
"rationale": "TLS 1.3 removes static RSA key exchange, CBC suites and renegotiation; accepting nothing older leaves nothing to downgrade to (RFC 8446; Mozilla \"modern\" profile).",
|
|
204
|
+
"hubWhen": {
|
|
205
|
+
"TLS": [
|
|
206
|
+
"modern"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "req-tls12",
|
|
212
|
+
"type": "requirement",
|
|
213
|
+
"label": "Weak suites refused",
|
|
214
|
+
"x": 260,
|
|
215
|
+
"y": 260,
|
|
216
|
+
"ears_type": "unwanted-behaviour",
|
|
217
|
+
"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, and review once a year whether TLS 1.2 can be dropped",
|
|
219
|
+
"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
|
+
"hubWhen": {
|
|
221
|
+
"TLS": [
|
|
222
|
+
"intermediate"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "req-mtls",
|
|
228
|
+
"type": "requirement",
|
|
229
|
+
"label": "Every hop mutually authenticated",
|
|
230
|
+
"x": 260,
|
|
231
|
+
"y": 390,
|
|
232
|
+
"ears_type": "event-driven",
|
|
233
|
+
"trigger": "one of our elements connects to another",
|
|
234
|
+
"action": "encrypt the connection with mutual TLS, both sides presenting certificates from the mesh's CA that expire within 24 hours, and refuse a peer without one",
|
|
235
|
+
"rationale": "Encryption and caller identity on every hop, so that a foothold on the network reads nothing and cannot impersonate a service (OWASP TLS Cheat Sheet, client certificates; ASVS 9.2.2).",
|
|
236
|
+
"hubWhen": {
|
|
237
|
+
"INTERNAL": [
|
|
238
|
+
"mtls"
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"id": "req-internal-tls",
|
|
244
|
+
"type": "requirement",
|
|
245
|
+
"label": "TLS to every backend",
|
|
246
|
+
"x": 260,
|
|
247
|
+
"y": 520,
|
|
248
|
+
"ears_type": "ubiquitous",
|
|
249
|
+
"action": "connect to databases, queues and other elements only over TLS 1.2 or newer, verifying the server's certificate and host name (for PostgreSQL sslmode=verify-full), and never with verification turned off",
|
|
250
|
+
"rationale": "TLS without verification is encryption to whoever answers; the backend has to be proved, not just reached (ASVS 9.2.1, 9.2.2).",
|
|
251
|
+
"hubWhen": {
|
|
252
|
+
"INTERNAL": [
|
|
253
|
+
"tls"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "req-private",
|
|
259
|
+
"type": "requirement",
|
|
260
|
+
"label": "Clear text stays private",
|
|
261
|
+
"x": 260,
|
|
262
|
+
"y": 650,
|
|
263
|
+
"ears_type": "state-driven",
|
|
264
|
+
"precondition": "traffic between our elements is not encrypted",
|
|
265
|
+
"action": "keep that traffic inside one private network with no peering, no public addresses and no shared tenants, and encrypt any connection that leaves it",
|
|
266
|
+
"rationale": "Clear text inside is acceptable only while the network itself is ours alone; the decision states the conditions, so breaking one shows (OWASP TLS Cheat Sheet, use TLS for all connections).",
|
|
267
|
+
"hubWhen": {
|
|
268
|
+
"INTERNAL": [
|
|
269
|
+
"private"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "req-rest",
|
|
275
|
+
"type": "requirement",
|
|
276
|
+
"label": "Stored data encrypted",
|
|
277
|
+
"x": 260,
|
|
278
|
+
"y": 780,
|
|
279
|
+
"ears_type": "ubiquitous",
|
|
280
|
+
"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.2.1; OWASP Cryptographic Storage Cheat Sheet)."
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"id": "req-key-access",
|
|
285
|
+
"type": "requirement",
|
|
286
|
+
"label": "Key use limited and logged",
|
|
287
|
+
"x": 260,
|
|
288
|
+
"y": 910,
|
|
289
|
+
"ears_type": "ubiquitous",
|
|
290
|
+
"action": "allow only the element's own identity and the key administrators to use its keys, keep administration and use apart, and log every use of a key for at least 12 months",
|
|
291
|
+
"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
|
+
"hubWhen": {
|
|
293
|
+
"AT_REST": [
|
|
294
|
+
"cmk",
|
|
295
|
+
"field"
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "req-field",
|
|
301
|
+
"type": "requirement",
|
|
302
|
+
"label": "Sensitive fields encrypted",
|
|
303
|
+
"x": 260,
|
|
304
|
+
"y": 1040,
|
|
305
|
+
"ears_type": "ubiquitous",
|
|
306
|
+
"action": "encrypt {{SENSITIVE_FIELDS}} in the application before writing them, with AES-256-GCM under a data key per record or tenant wrapped by the KMS, so that the database, its logs and its backups hold only ciphertext",
|
|
307
|
+
"rationale": "Disk encryption is transparent to anyone who can query the database; field encryption keeps the most sensitive data from administrators, backups and SQL injection (OWASP Cryptographic Storage Cheat Sheet, application-level encryption; ASVS 6.1.1).",
|
|
308
|
+
"hubWhen": {
|
|
309
|
+
"AT_REST": [
|
|
310
|
+
"field"
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"id": "req-rotate-auto",
|
|
316
|
+
"type": "requirement",
|
|
317
|
+
"label": "Key material rotated",
|
|
318
|
+
"x": 260,
|
|
319
|
+
"y": 1170,
|
|
320
|
+
"ears_type": "event-driven",
|
|
321
|
+
"trigger": "an encryption key's current material is {{KEY_ROTATE_DAYS}} days old",
|
|
322
|
+
"action": "create new key material automatically, encrypt new data only with it, and keep the older versions for decryption only",
|
|
323
|
+
"rationale": "A cryptoperiod bounds how much data one key protects and how long a leaked key is useful (NIST SP 800-57 Pt 1, 5.3).",
|
|
324
|
+
"hubWhen": {
|
|
325
|
+
"AT_REST": [
|
|
326
|
+
"cmk",
|
|
327
|
+
"field"
|
|
328
|
+
],
|
|
329
|
+
"ROTATION": [
|
|
330
|
+
"automatic"
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"id": "req-rotate-reencrypt",
|
|
336
|
+
"type": "requirement",
|
|
337
|
+
"label": "Data re-encrypted on rotation",
|
|
338
|
+
"x": 260,
|
|
339
|
+
"y": 1300,
|
|
340
|
+
"ears_type": "event-driven",
|
|
341
|
+
"trigger": "an encryption key is {{KEY_ROTATE_DAYS}} days old, or is suspected to be compromised",
|
|
342
|
+
"action": "create a new key, re-encrypt the data or its data keys under it within 30 days (within 72 hours after a suspected compromise), and then disable the old key",
|
|
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).",
|
|
344
|
+
"hubWhen": {
|
|
345
|
+
"AT_REST": [
|
|
346
|
+
"cmk",
|
|
347
|
+
"field"
|
|
348
|
+
],
|
|
349
|
+
"ROTATION": [
|
|
350
|
+
"reencrypt"
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"id": "req-certs-acme",
|
|
356
|
+
"type": "requirement",
|
|
357
|
+
"label": "Certificates renewed automatically",
|
|
358
|
+
"x": 260,
|
|
359
|
+
"y": 1430,
|
|
360
|
+
"ears_type": "event-driven",
|
|
361
|
+
"trigger": "a certificate has 30 days of validity left",
|
|
362
|
+
"action": "renew it automatically and install it without downtime, and alert the owner if it still has fewer than 14 days left",
|
|
363
|
+
"rationale": "Automated renewal removes the most common cause of certificate outages; the alert covers the renewal that fails (OWASP TLS Cheat Sheet, certificates).",
|
|
364
|
+
"hubWhen": {
|
|
365
|
+
"CERTS": [
|
|
366
|
+
"acme"
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"id": "req-certs-ca",
|
|
372
|
+
"type": "requirement",
|
|
373
|
+
"label": "Expiry alerted ahead",
|
|
374
|
+
"x": 260,
|
|
375
|
+
"y": 1560,
|
|
376
|
+
"ears_type": "state-driven",
|
|
377
|
+
"precondition": "a certificate on the inventory has fewer than 30 days of validity left",
|
|
378
|
+
"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",
|
|
379
|
+
"rationale": "Certificates renewed by hand expire when the person who knew left; an inventory and daily alerts are what make the process hold (OWASP TLS Cheat Sheet; NIST SP 800-57 Pt 1, 8.1.5).",
|
|
380
|
+
"hubWhen": {
|
|
381
|
+
"CERTS": [
|
|
382
|
+
"managed-ca"
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"id": "sc-tls-outside",
|
|
388
|
+
"type": "scenario",
|
|
389
|
+
"label": "Plain HTTP upgraded",
|
|
390
|
+
"x": 520,
|
|
391
|
+
"y": 0,
|
|
392
|
+
"given": "the element's public endpoint",
|
|
393
|
+
"when": "it is called over plain HTTP, and its TLS configuration is scanned",
|
|
394
|
+
"then": "the call is redirected to HTTPS with HSTS max-age of at least 31536000, and the scan finds only {{TLS}}"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"id": "sc-tls13",
|
|
398
|
+
"type": "scenario",
|
|
399
|
+
"label": "TLS 1.2 refused",
|
|
400
|
+
"x": 520,
|
|
401
|
+
"y": 130,
|
|
402
|
+
"given": "the public endpoint",
|
|
403
|
+
"when": "a client connects with TLS 1.2 at most, and then with TLS 1.3",
|
|
404
|
+
"then": "the first handshake fails and the second succeeds",
|
|
405
|
+
"hubWhen": {
|
|
406
|
+
"TLS": [
|
|
407
|
+
"modern"
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"id": "sc-tls12",
|
|
413
|
+
"type": "scenario",
|
|
414
|
+
"label": "CBC suite refused",
|
|
415
|
+
"x": 520,
|
|
416
|
+
"y": 260,
|
|
417
|
+
"given": "the public endpoint",
|
|
418
|
+
"when": "a client offers TLS 1.1, then TLS 1.2 with only TLS_RSA_WITH_AES_128_CBC_SHA, then TLS 1.2 with ECDHE-RSA-AES128-GCM-SHA256",
|
|
419
|
+
"then": "only the last handshake succeeds",
|
|
420
|
+
"hubWhen": {
|
|
421
|
+
"TLS": [
|
|
422
|
+
"intermediate"
|
|
423
|
+
]
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"id": "sc-mtls",
|
|
428
|
+
"type": "scenario",
|
|
429
|
+
"label": "Plain-text peer refused",
|
|
430
|
+
"x": 520,
|
|
431
|
+
"y": 390,
|
|
432
|
+
"given": "two services in the mesh in strict mode",
|
|
433
|
+
"when": "a pod outside the mesh calls one of them in plain text, and the other calls it through the mesh",
|
|
434
|
+
"then": "the first is refused and the second succeeds with certificates valid for no more than 24 hours",
|
|
435
|
+
"hubWhen": {
|
|
436
|
+
"INTERNAL": [
|
|
437
|
+
"mtls"
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"id": "sc-internal-tls",
|
|
443
|
+
"type": "scenario",
|
|
444
|
+
"label": "Unverified backend refused",
|
|
445
|
+
"x": 520,
|
|
446
|
+
"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 both connections",
|
|
450
|
+
"hubWhen": {
|
|
451
|
+
"INTERNAL": [
|
|
452
|
+
"tls"
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"id": "sc-private",
|
|
458
|
+
"type": "scenario",
|
|
459
|
+
"label": "Leaving the network",
|
|
460
|
+
"x": 520,
|
|
461
|
+
"y": 650,
|
|
462
|
+
"given": "two elements talking in clear text inside the VPC",
|
|
463
|
+
"when": "one of them is given a connection to a peered network",
|
|
464
|
+
"then": "that connection uses TLS 1.2 or newer and the review of the change names this decision",
|
|
465
|
+
"hubWhen": {
|
|
466
|
+
"INTERNAL": [
|
|
467
|
+
"private"
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"id": "sc-rest",
|
|
473
|
+
"type": "scenario",
|
|
474
|
+
"label": "Snapshot unreadable",
|
|
475
|
+
"x": 520,
|
|
476
|
+
"y": 780,
|
|
477
|
+
"given": "a snapshot of the element's database and a backup",
|
|
478
|
+
"when": "their storage settings are listed",
|
|
479
|
+
"then": "both are encrypted with AES-256 under {{AT_REST}}"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"id": "sc-key-access",
|
|
483
|
+
"type": "scenario",
|
|
484
|
+
"label": "Other identity refused",
|
|
485
|
+
"x": 520,
|
|
486
|
+
"y": 910,
|
|
487
|
+
"given": "the element's data key in the KMS",
|
|
488
|
+
"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 KMS log",
|
|
490
|
+
"hubWhen": {
|
|
491
|
+
"AT_REST": [
|
|
492
|
+
"cmk",
|
|
493
|
+
"field"
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"id": "sc-field",
|
|
499
|
+
"type": "scenario",
|
|
500
|
+
"label": "Database shows ciphertext",
|
|
501
|
+
"x": 520,
|
|
502
|
+
"y": 1040,
|
|
503
|
+
"given": "a record with {{SENSITIVE_FIELDS}} saved through the element",
|
|
504
|
+
"when": "a database administrator selects it directly",
|
|
505
|
+
"then": "those fields are ciphertext, and the element still reads them as the original values",
|
|
506
|
+
"hubWhen": {
|
|
507
|
+
"AT_REST": [
|
|
508
|
+
"field"
|
|
509
|
+
]
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"id": "sc-rotate-auto",
|
|
514
|
+
"type": "scenario",
|
|
515
|
+
"label": "Rotation keeps data readable",
|
|
516
|
+
"x": 520,
|
|
517
|
+
"y": 1170,
|
|
518
|
+
"given": "a key whose material is {{KEY_ROTATE_DAYS}} days old and data encrypted under it",
|
|
519
|
+
"when": "the KMS rotates it",
|
|
520
|
+
"then": "new data is encrypted with the new material and the old data still decrypts",
|
|
521
|
+
"hubWhen": {
|
|
522
|
+
"AT_REST": [
|
|
523
|
+
"cmk",
|
|
524
|
+
"field"
|
|
525
|
+
],
|
|
526
|
+
"ROTATION": [
|
|
527
|
+
"automatic"
|
|
528
|
+
]
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"id": "sc-rotate-reencrypt",
|
|
533
|
+
"type": "scenario",
|
|
534
|
+
"label": "Old key disabled",
|
|
535
|
+
"x": 520,
|
|
536
|
+
"y": 1300,
|
|
537
|
+
"given": "data encrypted under a key {{KEY_ROTATE_DAYS}} days old",
|
|
538
|
+
"when": "the rotation runs",
|
|
539
|
+
"then": "within 30 days every record decrypts under the new key and the old key is disabled",
|
|
540
|
+
"hubWhen": {
|
|
541
|
+
"AT_REST": [
|
|
542
|
+
"cmk",
|
|
543
|
+
"field"
|
|
544
|
+
],
|
|
545
|
+
"ROTATION": [
|
|
546
|
+
"reencrypt"
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"id": "sc-certs-acme",
|
|
552
|
+
"type": "scenario",
|
|
553
|
+
"label": "Renewal without anyone",
|
|
554
|
+
"x": 520,
|
|
555
|
+
"y": 1430,
|
|
556
|
+
"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",
|
|
559
|
+
"hubWhen": {
|
|
560
|
+
"CERTS": [
|
|
561
|
+
"acme"
|
|
562
|
+
]
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"id": "sc-certs-ca",
|
|
567
|
+
"type": "scenario",
|
|
568
|
+
"label": "Expiring certificate alerted",
|
|
569
|
+
"x": 520,
|
|
570
|
+
"y": 1560,
|
|
571
|
+
"given": "a partner-facing certificate expiring in 29 days",
|
|
572
|
+
"when": "the daily check runs",
|
|
573
|
+
"then": "its owner is alerted, and the alerts stop when the new certificate is installed",
|
|
574
|
+
"hubWhen": {
|
|
575
|
+
"CERTS": [
|
|
576
|
+
"managed-ca"
|
|
577
|
+
]
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"id": "adr-mtls",
|
|
582
|
+
"type": "adr",
|
|
583
|
+
"label": "Mutual TLS in a service mesh",
|
|
584
|
+
"x": 780,
|
|
585
|
+
"y": 0,
|
|
586
|
+
"concern": "encryption",
|
|
587
|
+
"status": "accepted",
|
|
588
|
+
"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, a service mesh in strict mode encrypts and authenticates every hop with mutual TLS and certificates that expire within 24 hours; databases and managed queues outside the mesh are reached with TLS and certificate verification. Choosing the mesh: Linkerd for the least to run and automatic mTLS by default; Istio when you also need fine-grained traffic and authorisation policies; Cilium when it already runs as the network plugin. Judge by the operational load, the sidecar or sidecar-less model and the certificate authority it can chain to.",
|
|
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.\n2. Clear text inside a private network: simplest, and safe only while the network is ours alone.",
|
|
593
|
+
"hubWhen": {
|
|
594
|
+
"INTERNAL": [
|
|
595
|
+
"mtls"
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"id": "adr-internal-tls",
|
|
601
|
+
"type": "adr",
|
|
602
|
+
"label": "TLS on every connection",
|
|
603
|
+
"x": 780,
|
|
604
|
+
"y": 130,
|
|
605
|
+
"concern": "encryption",
|
|
606
|
+
"status": "accepted",
|
|
607
|
+
"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.",
|
|
609
|
+
"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.",
|
|
611
|
+
"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
|
+
"hubWhen": {
|
|
613
|
+
"INTERNAL": [
|
|
614
|
+
"tls"
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"id": "adr-private",
|
|
620
|
+
"type": "adr",
|
|
621
|
+
"label": "TLS ends at the edge",
|
|
622
|
+
"x": 780,
|
|
623
|
+
"y": 260,
|
|
624
|
+
"concern": "encryption",
|
|
625
|
+
"status": "accepted",
|
|
626
|
+
"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.",
|
|
628
|
+
"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.",
|
|
630
|
+
"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
|
+
"hubWhen": {
|
|
632
|
+
"INTERNAL": [
|
|
633
|
+
"private"
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"id": "adr-provider-keys",
|
|
639
|
+
"type": "adr",
|
|
640
|
+
"label": "Provider-managed keys at rest",
|
|
641
|
+
"x": 780,
|
|
642
|
+
"y": 390,
|
|
643
|
+
"concern": "encryption",
|
|
644
|
+
"status": "accepted",
|
|
645
|
+
"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.",
|
|
647
|
+
"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
|
+
"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
|
+
"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.",
|
|
650
|
+
"hubWhen": {
|
|
651
|
+
"AT_REST": [
|
|
652
|
+
"provider"
|
|
653
|
+
]
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"id": "adr-cmk",
|
|
658
|
+
"type": "adr",
|
|
659
|
+
"label": "Customer-managed keys at rest",
|
|
660
|
+
"x": 780,
|
|
661
|
+
"y": 520,
|
|
662
|
+
"concern": "encryption",
|
|
663
|
+
"status": "accepted",
|
|
664
|
+
"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; every use is logged. Key rotation: {{ROTATION}}, every {{KEY_ROTATE_DAYS}} days. 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.",
|
|
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.",
|
|
668
|
+
"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
|
+
"hubWhen": {
|
|
670
|
+
"AT_REST": [
|
|
671
|
+
"cmk"
|
|
672
|
+
]
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"id": "adr-field",
|
|
677
|
+
"type": "adr",
|
|
678
|
+
"label": "Sensitive fields encrypted by the application",
|
|
679
|
+
"x": 780,
|
|
680
|
+
"y": 650,
|
|
681
|
+
"concern": "encryption",
|
|
682
|
+
"status": "accepted",
|
|
683
|
+
"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.",
|
|
686
|
+
"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
|
+
"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
|
+
"hubWhen": {
|
|
689
|
+
"AT_REST": [
|
|
690
|
+
"field"
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"id": "ff-tls-scan",
|
|
696
|
+
"type": "fitness-fn",
|
|
697
|
+
"label": "Public TLS configuration",
|
|
698
|
+
"x": 1040,
|
|
699
|
+
"y": 0,
|
|
700
|
+
"category": "operational",
|
|
701
|
+
"threshold": "0 findings of severity HIGH or CRITICAL; only {{TLS}} offered; certificates valid for at least 14 more days",
|
|
702
|
+
"description": "A scheduled job scans each public endpoint of the element with testssl.sh and fails on a protocol or cipher suite outside the chosen profile, a weak finding or a certificate close to expiry.\n\nTool: testssl.sh\n\n```bash\ntestssl.sh --quiet --warnings off --severity HIGH --jsonfile tls.json \"$ENDPOINT\"\n# fails on HIGH/CRITICAL findings, e.g. TLS 1.0/1.1, CBC suites, weak keys\njq -e '[.[] | select(.severity == \"HIGH\" or .severity == \"CRITICAL\")] | length == 0' tls.json\n# certificate must stay valid for at least 14 more days\necho | openssl s_client -connect \"$ENDPOINT:443\" -servername \"$ENDPOINT\" 2>/dev/null \\\n | openssl x509 -noout -checkend $(( 14 * 86400 ))\n```"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"id": "ff-mesh-strict",
|
|
706
|
+
"type": "fitness-fn",
|
|
707
|
+
"label": "Mesh in strict mode",
|
|
708
|
+
"x": 1040,
|
|
709
|
+
"y": 130,
|
|
710
|
+
"category": "structural",
|
|
711
|
+
"threshold": "A mesh-wide PeerAuthentication in STRICT mode exists, and 0 workloads or namespaces override it to PERMISSIVE or DISABLE",
|
|
712
|
+
"description": "A Conftest policy over the rendered manifests fails when the mesh-wide mutual TLS policy is missing or anything weakens it.\n\nTool: Conftest (Open Policy Agent) over Istio manifests\n\n```rego\npackage main\n\nimport rego.v1\n\ndeny contains msg if {\n input.kind == \"PeerAuthentication\"\n input.spec.mtls.mode != \"STRICT\"\n msg := sprintf(\"%s/%s weakens mutual TLS to %s\", [input.metadata.namespace, input.metadata.name, input.spec.mtls.mode])\n}\n\ndeny contains msg if {\n input.kind == \"PeerAuthentication\"\n some port, setting in input.spec.portLevelMtls\n setting.mode != \"STRICT\"\n msg := sprintf(\"%s/%s turns off mutual TLS on port %v\", [input.metadata.namespace, input.metadata.name, port])\n}\n```",
|
|
713
|
+
"hubWhen": {
|
|
714
|
+
"INTERNAL": [
|
|
715
|
+
"mtls"
|
|
716
|
+
]
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"id": "ff-backend-tls",
|
|
721
|
+
"type": "fitness-fn",
|
|
722
|
+
"label": "Backends refuse clear text",
|
|
723
|
+
"x": 1040,
|
|
724
|
+
"y": 260,
|
|
725
|
+
"category": "structural",
|
|
726
|
+
"threshold": "0 backends (databases, queues) that accept a connection without TLS; 0 client configurations with certificate verification turned off",
|
|
727
|
+
"description": "A smoke test after each deployment tries to connect to each database without TLS and expects a refusal; a code search fails the build on settings that skip verification.\n\nTool: psql and Semgrep\n\n```bash\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 accepts connections without TLS\"; exit 1\nfi\n# no client may skip verification\nsemgrep --error --lang generic -e 'sslmode=require' -e 'rejectUnauthorized: false' -e 'InsecureSkipVerify: true' -e 'verify=False' src/\n```",
|
|
728
|
+
"hubWhen": {
|
|
729
|
+
"INTERNAL": [
|
|
730
|
+
"tls"
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"id": "ff-private",
|
|
736
|
+
"type": "fitness-fn",
|
|
737
|
+
"label": "Private network stays private",
|
|
738
|
+
"x": 1040,
|
|
739
|
+
"y": 390,
|
|
740
|
+
"category": "structural",
|
|
741
|
+
"threshold": "0 VPC peerings, public addresses or 0.0.0.0/0 ingress rules on the element's network in the Terraform plan",
|
|
742
|
+
"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.\n\nTool: Conftest (Open Policy Agent) over terraform show -json\n\n```rego\npackage main\n\nimport rego.v1\n\ndeny contains msg if {\n some rc in input.resource_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 input.resource_changes\n rc.type == \"aws_security_group_rule\"\n rc.change.after.type == \"ingress\"\n \"0.0.0.0/0\" in rc.change.after.cidr_blocks\n msg := sprintf(\"%s opens the private network to the internet\", [rc.address])\n}\n```",
|
|
743
|
+
"hubWhen": {
|
|
744
|
+
"INTERNAL": [
|
|
745
|
+
"private"
|
|
746
|
+
]
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"id": "ff-rest",
|
|
751
|
+
"type": "fitness-fn",
|
|
752
|
+
"label": "Nothing stored unencrypted",
|
|
753
|
+
"x": 1040,
|
|
754
|
+
"y": 520,
|
|
755
|
+
"category": "operational",
|
|
756
|
+
"threshold": "0 non-compliant database instances, snapshots, volumes or buckets",
|
|
757
|
+
"description": "AWS Config managed rules evaluate every database, snapshot, volume and bucket continuously and report one that is not encrypted at rest. Azure Policy and Google Organization Policy have equivalent built-in rules.\n\nTool: AWS Config managed rules\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```"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"id": "ff-key-rotation",
|
|
761
|
+
"type": "fitness-fn",
|
|
762
|
+
"label": "Key rotation on",
|
|
763
|
+
"x": 1040,
|
|
764
|
+
"y": 650,
|
|
765
|
+
"category": "operational",
|
|
766
|
+
"threshold": "0 customer-managed keys without automatic rotation; rotation period at most {{KEY_ROTATE_DAYS}} days",
|
|
767
|
+
"description": "AWS Config reports every customer-managed KMS key whose automatic rotation is off; a scheduled job checks the rotation period of each.\n\nTool: AWS Config managed rule CMK_BACKING_KEY_ROTATION_ENABLED and the AWS CLI\n\n```bash\nfor key in $(aws kms list-keys --query 'Keys[].KeyId' --output text); do\n [ \"$(aws kms describe-key --key-id \"$key\" --query 'KeyMetadata.KeyManager' --output text)\" = CUSTOMER ] || continue\n status=$(aws kms get-key-rotation-status --key-id \"$key\" --output json)\n echo \"$status\" | jq -e --argjson max {{KEY_ROTATE_DAYS}} \\\n '.KeyRotationEnabled and (.RotationPeriodInDays <= $max)' >/dev/null \\\n || { echo \"key $key: rotation off or longer than {{KEY_ROTATE_DAYS}} days\"; exit 1; }\ndone\n```",
|
|
768
|
+
"hubWhen": {
|
|
769
|
+
"AT_REST": [
|
|
770
|
+
"cmk",
|
|
771
|
+
"field"
|
|
772
|
+
],
|
|
773
|
+
"ROTATION": [
|
|
774
|
+
"automatic"
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"id": "ff-key-age",
|
|
780
|
+
"type": "fitness-fn",
|
|
781
|
+
"label": "No key past its period",
|
|
782
|
+
"x": 1040,
|
|
783
|
+
"y": 780,
|
|
784
|
+
"category": "operational",
|
|
785
|
+
"threshold": "0 enabled customer-managed keys older than {{KEY_ROTATE_DAYS}} + 30 days",
|
|
786
|
+
"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.\n\nTool: AWS CLI and jq\n\n```bash\nmax=$(( ({{KEY_ROTATE_DAYS}} + 30) * 86400 ))\nfor key in $(aws kms list-keys --query 'Keys[].KeyId' --output text); do\n 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) > $max' >/dev/null && { echo \"key $key is past its cryptoperiod\"; exit 1; }\ndone\nexit 0\n```",
|
|
787
|
+
"hubWhen": {
|
|
788
|
+
"AT_REST": [
|
|
789
|
+
"cmk",
|
|
790
|
+
"field"
|
|
791
|
+
],
|
|
792
|
+
"ROTATION": [
|
|
793
|
+
"reencrypt"
|
|
794
|
+
]
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"id": "ff-field",
|
|
799
|
+
"type": "fitness-fn",
|
|
800
|
+
"label": "Fields stored as ciphertext",
|
|
801
|
+
"x": 1040,
|
|
802
|
+
"y": 910,
|
|
803
|
+
"category": "structural",
|
|
804
|
+
"threshold": "0 of the listed sensitive fields readable as plaintext in the database",
|
|
805
|
+
"description": "An integration test saves a record through the element, reads the row directly from the database and fails if any of the sensitive fields holds the original value.\n\nTool: Vitest with Testcontainers (PostgreSQL)\n\n```ts\nit('stores sensitive fields as ciphertext', async () => {\n const card = '4111111111111111'\n const { id } = await customers.create({ name: 'Ada', cardNumber: card })\n const { rows } = await pg.query('select card_number from customers where id = $1', [id])\n expect(rows[0].card_number).not.toContain(card)\n expect((await customers.get(id)).cardNumber).toBe(card)\n})\n```",
|
|
806
|
+
"hubWhen": {
|
|
807
|
+
"AT_REST": [
|
|
808
|
+
"field"
|
|
809
|
+
]
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
],
|
|
813
|
+
"relations": [
|
|
814
|
+
{
|
|
815
|
+
"id": "req-tls-outside--derives--need",
|
|
816
|
+
"sourceId": "req-tls-outside",
|
|
817
|
+
"targetId": "need",
|
|
818
|
+
"relationType": "derives"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"id": "req-tls13--derives--need",
|
|
822
|
+
"sourceId": "req-tls13",
|
|
823
|
+
"targetId": "need",
|
|
824
|
+
"relationType": "derives"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"id": "req-tls12--derives--need",
|
|
828
|
+
"sourceId": "req-tls12",
|
|
829
|
+
"targetId": "need",
|
|
830
|
+
"relationType": "derives"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"id": "req-mtls--derives--need",
|
|
834
|
+
"sourceId": "req-mtls",
|
|
835
|
+
"targetId": "need",
|
|
836
|
+
"relationType": "derives"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"id": "req-internal-tls--derives--need",
|
|
840
|
+
"sourceId": "req-internal-tls",
|
|
841
|
+
"targetId": "need",
|
|
842
|
+
"relationType": "derives"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"id": "req-private--derives--need",
|
|
846
|
+
"sourceId": "req-private",
|
|
847
|
+
"targetId": "need",
|
|
848
|
+
"relationType": "derives"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"id": "req-rest--derives--need",
|
|
852
|
+
"sourceId": "req-rest",
|
|
853
|
+
"targetId": "need",
|
|
854
|
+
"relationType": "derives"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"id": "req-key-access--derives--need",
|
|
858
|
+
"sourceId": "req-key-access",
|
|
859
|
+
"targetId": "need",
|
|
860
|
+
"relationType": "derives"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"id": "req-field--derives--need",
|
|
864
|
+
"sourceId": "req-field",
|
|
865
|
+
"targetId": "need",
|
|
866
|
+
"relationType": "derives"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"id": "req-rotate-auto--derives--need",
|
|
870
|
+
"sourceId": "req-rotate-auto",
|
|
871
|
+
"targetId": "need",
|
|
872
|
+
"relationType": "derives"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"id": "req-rotate-reencrypt--derives--need",
|
|
876
|
+
"sourceId": "req-rotate-reencrypt",
|
|
877
|
+
"targetId": "need",
|
|
878
|
+
"relationType": "derives"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"id": "req-certs-acme--derives--need",
|
|
882
|
+
"sourceId": "req-certs-acme",
|
|
883
|
+
"targetId": "need",
|
|
884
|
+
"relationType": "derives"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"id": "req-certs-ca--derives--need",
|
|
888
|
+
"sourceId": "req-certs-ca",
|
|
889
|
+
"targetId": "need",
|
|
890
|
+
"relationType": "derives"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
"id": "sc-tls-outside--verifies--req-tls-outside",
|
|
894
|
+
"sourceId": "sc-tls-outside",
|
|
895
|
+
"targetId": "req-tls-outside",
|
|
896
|
+
"relationType": "verifies"
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
"id": "sc-tls13--verifies--req-tls13",
|
|
900
|
+
"sourceId": "sc-tls13",
|
|
901
|
+
"targetId": "req-tls13",
|
|
902
|
+
"relationType": "verifies"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"id": "sc-tls12--verifies--req-tls12",
|
|
906
|
+
"sourceId": "sc-tls12",
|
|
907
|
+
"targetId": "req-tls12",
|
|
908
|
+
"relationType": "verifies"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"id": "sc-mtls--verifies--req-mtls",
|
|
912
|
+
"sourceId": "sc-mtls",
|
|
913
|
+
"targetId": "req-mtls",
|
|
914
|
+
"relationType": "verifies"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"id": "sc-internal-tls--verifies--req-internal-tls",
|
|
918
|
+
"sourceId": "sc-internal-tls",
|
|
919
|
+
"targetId": "req-internal-tls",
|
|
920
|
+
"relationType": "verifies"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"id": "sc-private--verifies--req-private",
|
|
924
|
+
"sourceId": "sc-private",
|
|
925
|
+
"targetId": "req-private",
|
|
926
|
+
"relationType": "verifies"
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
"id": "sc-rest--verifies--req-rest",
|
|
930
|
+
"sourceId": "sc-rest",
|
|
931
|
+
"targetId": "req-rest",
|
|
932
|
+
"relationType": "verifies"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
"id": "sc-key-access--verifies--req-key-access",
|
|
936
|
+
"sourceId": "sc-key-access",
|
|
937
|
+
"targetId": "req-key-access",
|
|
938
|
+
"relationType": "verifies"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"id": "sc-field--verifies--req-field",
|
|
942
|
+
"sourceId": "sc-field",
|
|
943
|
+
"targetId": "req-field",
|
|
944
|
+
"relationType": "verifies"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"id": "sc-rotate-auto--verifies--req-rotate-auto",
|
|
948
|
+
"sourceId": "sc-rotate-auto",
|
|
949
|
+
"targetId": "req-rotate-auto",
|
|
950
|
+
"relationType": "verifies"
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
"id": "sc-rotate-reencrypt--verifies--req-rotate-reencrypt",
|
|
954
|
+
"sourceId": "sc-rotate-reencrypt",
|
|
955
|
+
"targetId": "req-rotate-reencrypt",
|
|
956
|
+
"relationType": "verifies"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"id": "sc-certs-acme--verifies--req-certs-acme",
|
|
960
|
+
"sourceId": "sc-certs-acme",
|
|
961
|
+
"targetId": "req-certs-acme",
|
|
962
|
+
"relationType": "verifies"
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
"id": "sc-certs-ca--verifies--req-certs-ca",
|
|
966
|
+
"sourceId": "sc-certs-ca",
|
|
967
|
+
"targetId": "req-certs-ca",
|
|
968
|
+
"relationType": "verifies"
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"id": "ff-tls-scan--implements--adr-mtls",
|
|
972
|
+
"sourceId": "ff-tls-scan",
|
|
973
|
+
"targetId": "adr-mtls",
|
|
974
|
+
"relationType": "implements"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"id": "ff-tls-scan--implements--adr-internal-tls",
|
|
978
|
+
"sourceId": "ff-tls-scan",
|
|
979
|
+
"targetId": "adr-internal-tls",
|
|
980
|
+
"relationType": "implements"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"id": "ff-tls-scan--implements--adr-private",
|
|
984
|
+
"sourceId": "ff-tls-scan",
|
|
985
|
+
"targetId": "adr-private",
|
|
986
|
+
"relationType": "implements"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"id": "ff-mesh-strict--implements--adr-mtls",
|
|
990
|
+
"sourceId": "ff-mesh-strict",
|
|
991
|
+
"targetId": "adr-mtls",
|
|
992
|
+
"relationType": "implements"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"id": "ff-backend-tls--implements--adr-internal-tls",
|
|
996
|
+
"sourceId": "ff-backend-tls",
|
|
997
|
+
"targetId": "adr-internal-tls",
|
|
998
|
+
"relationType": "implements"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
"id": "ff-private--implements--adr-private",
|
|
1002
|
+
"sourceId": "ff-private",
|
|
1003
|
+
"targetId": "adr-private",
|
|
1004
|
+
"relationType": "implements"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"id": "ff-rest--implements--adr-provider-keys",
|
|
1008
|
+
"sourceId": "ff-rest",
|
|
1009
|
+
"targetId": "adr-provider-keys",
|
|
1010
|
+
"relationType": "implements"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"id": "ff-rest--implements--adr-cmk",
|
|
1014
|
+
"sourceId": "ff-rest",
|
|
1015
|
+
"targetId": "adr-cmk",
|
|
1016
|
+
"relationType": "implements"
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
"id": "ff-rest--implements--adr-field",
|
|
1020
|
+
"sourceId": "ff-rest",
|
|
1021
|
+
"targetId": "adr-field",
|
|
1022
|
+
"relationType": "implements"
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"id": "ff-key-rotation--implements--adr-cmk",
|
|
1026
|
+
"sourceId": "ff-key-rotation",
|
|
1027
|
+
"targetId": "adr-cmk",
|
|
1028
|
+
"relationType": "implements"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"id": "ff-key-rotation--implements--adr-field",
|
|
1032
|
+
"sourceId": "ff-key-rotation",
|
|
1033
|
+
"targetId": "adr-field",
|
|
1034
|
+
"relationType": "implements"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
"id": "ff-key-age--implements--adr-cmk",
|
|
1038
|
+
"sourceId": "ff-key-age",
|
|
1039
|
+
"targetId": "adr-cmk",
|
|
1040
|
+
"relationType": "implements"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"id": "ff-key-age--implements--adr-field",
|
|
1044
|
+
"sourceId": "ff-key-age",
|
|
1045
|
+
"targetId": "adr-field",
|
|
1046
|
+
"relationType": "implements"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"id": "ff-field--implements--adr-field",
|
|
1050
|
+
"sourceId": "ff-field",
|
|
1051
|
+
"targetId": "adr-field",
|
|
1052
|
+
"relationType": "implements"
|
|
1053
|
+
}
|
|
1054
|
+
]
|
|
1055
|
+
}
|