@radicaltools/cli 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +353 -33
- 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 +1174 -0
- 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 +1268 -0
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +895 -0
- package/dist/hub-catalogue/concern/concern-authorization.radical +1686 -0
- package/dist/hub-catalogue/concern/concern-availability.radical +1028 -0
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +1037 -0
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1560 -0
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +915 -0
- 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 +1508 -0
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +1112 -0
- package/dist/hub-catalogue/concern/concern-data-store.radical +1282 -0
- package/dist/hub-catalogue/concern/concern-decomposition.radical +1318 -0
- 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 +1203 -0
- package/dist/hub-catalogue/concern/concern-encryption.radical +1318 -0
- 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 +1647 -0
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +2183 -0
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1116 -0
- package/dist/hub-catalogue/concern/concern-messaging.radical +973 -0
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +867 -0
- package/dist/hub-catalogue/concern/concern-observability.radical +997 -0
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +1949 -0
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1445 -0
- 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 +1284 -0
- 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 +1386 -0
- 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 +1440 -0
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +1212 -0
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +12712 -7144
- package/package.json +5 -3
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "concern-secrets",
|
|
4
|
+
"category": "concern",
|
|
5
|
+
"name": "Secrets",
|
|
6
|
+
"description": "Credentials for databases and outside systems: where they are kept, who can read them, how often they change, how leaks are caught and what happens when one leaks.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"security",
|
|
9
|
+
"secrets",
|
|
10
|
+
"credentials",
|
|
11
|
+
"rotation",
|
|
12
|
+
"secret-scanning"
|
|
13
|
+
],
|
|
14
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
15
|
+
"concern": {
|
|
16
|
+
"id": "secrets",
|
|
17
|
+
"trigger": "LIST RELATIONS WHERE source.external != true AND (target.type = \"database\" OR target.type = \"queue\" OR target.external = true) AND (source.type = \"system\" OR source.type = \"container\" OR source.type = \"webapp\" OR source.type = \"component\")",
|
|
18
|
+
"applyTo": "source",
|
|
19
|
+
"why": "these elements use credentials for databases, queues or outside systems, so where those are kept, who sees them and how they change has to be decided.",
|
|
20
|
+
"group": "security"
|
|
21
|
+
},
|
|
22
|
+
"sources": [
|
|
23
|
+
{
|
|
24
|
+
"title": "OWASP Secrets Management Cheat Sheet",
|
|
25
|
+
"url": "https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"title": "OWASP ASVS 4.0.3, V2.10 Service Authentication, V6.4 Secret Management, V7.1 Log Content",
|
|
29
|
+
"url": "https://owasp.org/www-project-application-security-verification-standard/"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"title": "NIST SP 800-57 Part 1 Rev. 5, Recommendation for Key Management (cryptoperiods)",
|
|
33
|
+
"url": "https://csrc.nist.gov/pubs/sp/800/57/pt1/r5/final"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": "Gitleaks",
|
|
37
|
+
"url": "https://github.com/gitleaks/gitleaks"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"title": "GitHub Docs: Secret scanning and push protection",
|
|
41
|
+
"url": "https://docs.github.com/en/code-security/secret-scanning"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"templateParams": [
|
|
45
|
+
{
|
|
46
|
+
"key": "STORE",
|
|
47
|
+
"title": "Where kept",
|
|
48
|
+
"label": "Where are the credentials kept?",
|
|
49
|
+
"hint": "The best credential is one that does not exist; the next best is one kept in a single place that logs every read.",
|
|
50
|
+
"defaultValue": "manager",
|
|
51
|
+
"options": [
|
|
52
|
+
{
|
|
53
|
+
"value": "manager",
|
|
54
|
+
"label": "a secrets manager",
|
|
55
|
+
"description": "HashiCorp Vault, AWS Secrets Manager, Azure Key Vault or Google Secret Manager: read at run time with the element's own identity, every read logged, rotation built in. Pick it when the element needs passwords or API keys that the platform cannot replace with an identity."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"value": "identity",
|
|
59
|
+
"label": "the platform's workload identity",
|
|
60
|
+
"description": "AWS IAM roles for service accounts, Azure managed identities, GCP workload identity, SPIFFE: short-lived tokens issued to the running element, nothing stored. Pick it when the databases and services it calls accept those identities (RDS/Aurora IAM auth, Azure SQL with Entra ID, Cloud SQL IAM); static keys of outside systems still go in a secrets manager."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"value": "env",
|
|
64
|
+
"label": "environment variables set by the deployment",
|
|
65
|
+
"description": "Values kept encrypted in the deployment's own store (Kubernetes Secrets with encryption at rest, Sealed Secrets, SOPS, the CI system's encrypted variables) and set at start. Pick it for a small system on a platform without a secrets manager; values show in process listings and crash dumps, and rotation is a redeploy by a person following a runbook, not by the store."
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "ROTATION",
|
|
71
|
+
"title": "Rotation",
|
|
72
|
+
"label": "How are stored credentials rotated?",
|
|
73
|
+
"hint": "A credential nobody can rotate without an outage is never rotated; the same goes for the leak response, which is a rotation under pressure.",
|
|
74
|
+
"defaultValue": "automatic",
|
|
75
|
+
"options": [
|
|
76
|
+
{
|
|
77
|
+
"value": "automatic",
|
|
78
|
+
"label": "automatically, by the store, with two valid versions during the switch",
|
|
79
|
+
"description": "The store creates the new credential, the element picks it up, and the old one is revoked only when nothing uses it (AWS Secrets Manager rotation, Vault database secrets engine, Key Vault rotation policies). Pick it when the store and the target (database, cloud API) support it, which most do. Not with environment variables set by the deployment: that store rotates nothing."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"value": "runbook",
|
|
83
|
+
"label": "by a person following a runbook",
|
|
84
|
+
"description": "An owner rotates on a schedule, reminded by an alert, following written steps. Pick it for keys an outside system issues by hand (a partner portal, a payment provider), for credentials set by the deployment, or when the store cannot rotate them."
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"key": "ACCESS",
|
|
90
|
+
"title": "Who may read",
|
|
91
|
+
"label": "Who may read production secrets?",
|
|
92
|
+
"hint": "Every person who can read a secret is a way to leak it; the fewer standing readers, the less a stolen laptop or a departure costs.",
|
|
93
|
+
"defaultValue": "breakglass",
|
|
94
|
+
"options": [
|
|
95
|
+
{
|
|
96
|
+
"value": "breakglass",
|
|
97
|
+
"label": "only the workloads; people through break-glass",
|
|
98
|
+
"description": "No person has standing read access; in an emergency a person reads one secret after a second person approves, and that secret is rotated afterwards. Pick it for production with payment, health or personal data, or any regulated system."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"value": "jit",
|
|
102
|
+
"label": "on-call engineers, just in time",
|
|
103
|
+
"description": "Engineers request read access to one secret for a few hours, approved by a second person (Vault control groups, AWS IAM Identity Center temporary elevation, Entra PIM). Pick it when the team debugs production often enough that break-glass would become routine."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"value": "team",
|
|
107
|
+
"label": "the owning team",
|
|
108
|
+
"description": "Members of the team that owns the element can read its secrets, every read logged. Pick it for a small team without a second approver at hand, and accept rotating on every departure."
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"key": "SCANNING",
|
|
114
|
+
"title": "Leak scanning",
|
|
115
|
+
"label": "Where are leaked credentials caught?",
|
|
116
|
+
"hint": "A secret pushed to a shared repository has leaked, even if the commit is reverted: catching it before the push is cheaper than revoking it after.",
|
|
117
|
+
"defaultValue": "push",
|
|
118
|
+
"options": [
|
|
119
|
+
{
|
|
120
|
+
"value": "push",
|
|
121
|
+
"label": "before the push, at the code host",
|
|
122
|
+
"description": "The code host refuses a push that contains a secret (GitHub push protection, GitLab secret push protection), and CI scans as well. Pick it when your code host offers it; it stops the leak before anyone else has a copy."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"value": "ci",
|
|
126
|
+
"label": "in CI, blocking the merge",
|
|
127
|
+
"description": "Gitleaks or TruffleHog run on every pull request and the merge is blocked on a finding; developers may add the same scanner as a pre-commit hook. Pick it when the code host has no push protection; the secret has reached the server and must be rotated."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"value": "scheduled",
|
|
131
|
+
"label": "in a scheduled scan of history and images",
|
|
132
|
+
"description": "A nightly job scans the whole history, built images and CI logs and opens a finding for the owner. Pick it for an old repository with many findings to work through first; move to blocking once it is clean."
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"key": "ROTATE_DAYS",
|
|
138
|
+
"label": "How often are stored credentials rotated (days)?",
|
|
139
|
+
"defaultValue": "90",
|
|
140
|
+
"type": "number"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"key": "REVOKE_MINUTES",
|
|
144
|
+
"label": "How fast must an exposed credential stop working (minutes)?",
|
|
145
|
+
"defaultValue": "60",
|
|
146
|
+
"type": "number"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"nodes": [
|
|
151
|
+
{
|
|
152
|
+
"id": "need",
|
|
153
|
+
"type": "need",
|
|
154
|
+
"label": "Credentials stay secret",
|
|
155
|
+
"x": 0,
|
|
156
|
+
"y": 0,
|
|
157
|
+
"kind": "brief",
|
|
158
|
+
"source": "Hub concern pack: Secrets",
|
|
159
|
+
"description": "The system uses passwords, keys and tokens to reach its databases, queues and outside systems. They end up in code, images, logs, tickets and laptops; they are shared between elements and never changed; people who left can still read them; and when one leaks, nobody knows where else it was used or how to change it without an outage."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "req-no-repo",
|
|
163
|
+
"type": "requirement",
|
|
164
|
+
"label": "No credential in code",
|
|
165
|
+
"x": 260,
|
|
166
|
+
"y": 0,
|
|
167
|
+
"ears_type": "ubiquitous",
|
|
168
|
+
"action": "keep no credential in source code, its git history, container images, infrastructure state, CI output or application logs, and obtain each one at run time through {{STORE}}",
|
|
169
|
+
"rationale": "Repositories, images and logs are copied far more widely than anyone tracks, and history keeps a secret after it is deleted (ASVS 2.10.4, 7.1.1; OWASP Secrets Management Cheat Sheet: Centralize and Standardize, CI/CD)."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "req-own",
|
|
173
|
+
"type": "requirement",
|
|
174
|
+
"label": "Own credentials per element",
|
|
175
|
+
"x": 260,
|
|
176
|
+
"y": 130,
|
|
177
|
+
"ears_type": "ubiquitous",
|
|
178
|
+
"action": "use credentials of its own in each environment, with only the rights it needs, shared with no other element and no person",
|
|
179
|
+
"rationale": "A leak then reaches one element in one environment, with only what it may do; a shared credential cannot be revoked without stopping everyone who uses it (ASVS 1.2.1, 2.10.1; OWASP Secrets Management Cheat Sheet: Access Control)."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "req-leak",
|
|
183
|
+
"type": "requirement",
|
|
184
|
+
"label": "Leaks revoked fast",
|
|
185
|
+
"x": 260,
|
|
186
|
+
"y": 260,
|
|
187
|
+
"ears_type": "event-driven",
|
|
188
|
+
"trigger": "a credential is found exposed (a scanner finding, a provider's leak notice, a report or a lost device)",
|
|
189
|
+
"action": "revoke it within {{REVOKE_MINUTES}} minutes, put a new one in place without downtime, rotate the credentials kept beside it, and review every use of it since the exposure in the store's and the target's logs",
|
|
190
|
+
"rationale": "Exposed credentials are found and used by automated scanners soon after they appear; a practised revocation is the only bound on the damage (OWASP Secrets Management Cheat Sheet: Incident Response, Revocation).",
|
|
191
|
+
"unchecked": "a leak drill the element's owner runs once a quarter on a staging credential, timed against {{REVOKE_MINUTES}} minutes and recorded; no tool can run it."
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "req-audit",
|
|
195
|
+
"type": "requirement",
|
|
196
|
+
"label": "Secret access audited",
|
|
197
|
+
"x": 260,
|
|
198
|
+
"y": 390,
|
|
199
|
+
"ears_type": "ubiquitous",
|
|
200
|
+
"action": "record every read and change of a production secret by a person, with who, when, which secret and the approval, keep the records for at least 12 months, and never record the secret's value",
|
|
201
|
+
"rationale": "After a leak, the record of who could and did read the secret decides what has to be rotated and who has to be asked (ASVS 6.4.1, 7.1.1)."
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "req-manager",
|
|
205
|
+
"type": "requirement",
|
|
206
|
+
"label": "Read from the manager",
|
|
207
|
+
"x": 260,
|
|
208
|
+
"y": 520,
|
|
209
|
+
"ears_type": "event-driven",
|
|
210
|
+
"trigger": "the element starts or its credential lease is about to expire",
|
|
211
|
+
"action": "fetch the credential from the secrets manager with the element's own platform identity, keep it only in memory, and refresh it before it expires without a restart",
|
|
212
|
+
"rationale": "The manager is the one place to audit, rotate and revoke only if the element reads from it rather than copying values into files or variables (OWASP Secrets Management Cheat Sheet: Centralize and Standardize, Handling Secrets in Memory).",
|
|
213
|
+
"hubWhen": {
|
|
214
|
+
"STORE": [
|
|
215
|
+
"manager"
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "req-workload",
|
|
221
|
+
"type": "requirement",
|
|
222
|
+
"label": "Short-lived credentials",
|
|
223
|
+
"x": 260,
|
|
224
|
+
"y": 650,
|
|
225
|
+
"ears_type": "ubiquitous",
|
|
226
|
+
"action": "authenticate to databases and cloud services with the platform's workload identity, using tokens that expire within 1 hour, and keep static keys only for outside systems that accept nothing else, in a secrets manager",
|
|
227
|
+
"rationale": "A credential that expires within the hour is worth little when stolen and needs no rotation (OWASP Secrets Management Cheat Sheet: Secret Lifecycle, Expiration).",
|
|
228
|
+
"hubWhen": {
|
|
229
|
+
"STORE": [
|
|
230
|
+
"identity"
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"id": "req-env",
|
|
236
|
+
"type": "requirement",
|
|
237
|
+
"label": "Variables never shown",
|
|
238
|
+
"x": 260,
|
|
239
|
+
"y": 780,
|
|
240
|
+
"ears_type": "unwanted-behaviour",
|
|
241
|
+
"unwanted_condition": "the element logs its configuration, fails with a crash report or serves a diagnostic endpoint",
|
|
242
|
+
"action": "leave out or mask every variable that holds a credential",
|
|
243
|
+
"rationale": "Environment variables travel into crash dumps, debug pages and support bundles; masking is what keeps them from being logged (ASVS 7.1.1, 14.3.2; OWASP Secrets Management Cheat Sheet: Environment Variables).",
|
|
244
|
+
"hubWhen": {
|
|
245
|
+
"STORE": [
|
|
246
|
+
"env"
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"id": "req-env-store",
|
|
252
|
+
"type": "requirement",
|
|
253
|
+
"label": "Deployment store encrypted",
|
|
254
|
+
"x": 260,
|
|
255
|
+
"y": 910,
|
|
256
|
+
"ears_type": "ubiquitous",
|
|
257
|
+
"action": "keep the values encrypted at rest in the deployment's store, so that the cluster's or the CI system's backing store never holds them in clear",
|
|
258
|
+
"rationale": "A Kubernetes Secret is base64, not encryption; without envelope encryption anyone with the etcd backup has every credential (OWASP Secrets Management Cheat Sheet: Kubernetes).",
|
|
259
|
+
"hubWhen": {
|
|
260
|
+
"STORE": [
|
|
261
|
+
"env"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"id": "req-rotate-auto",
|
|
267
|
+
"type": "requirement",
|
|
268
|
+
"label": "Rotation is automatic",
|
|
269
|
+
"x": 260,
|
|
270
|
+
"y": 1040,
|
|
271
|
+
"ears_type": "event-driven",
|
|
272
|
+
"trigger": "a stored credential is {{ROTATE_DAYS}} days old",
|
|
273
|
+
"action": "create its successor, switch every instance to it, and revoke the old one only when nothing uses it, with 0 failed requests",
|
|
274
|
+
"rationale": "A rotation nobody has to do gets done; two valid versions during the switch avoid the outage that makes teams postpone it (NIST SP 800-57 Pt 1, 5.3 Cryptoperiods; OWASP Secrets Management Cheat Sheet: Automate Secrets Management, Rotation).",
|
|
275
|
+
"hubWhen": {
|
|
276
|
+
"ROTATION": [
|
|
277
|
+
"automatic"
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"id": "req-rotate-runbook",
|
|
283
|
+
"type": "requirement",
|
|
284
|
+
"label": "Overdue rotation alerted",
|
|
285
|
+
"x": 260,
|
|
286
|
+
"y": 1170,
|
|
287
|
+
"ears_type": "state-driven",
|
|
288
|
+
"precondition": "a stored credential is older than {{ROTATE_DAYS}} days",
|
|
289
|
+
"action": "alert its named owner every working day until it is rotated by the runbook, which states the steps, the order and how to roll back",
|
|
290
|
+
"rationale": "Rotation by hand happens only when someone is reminded and has written steps; the alert makes an overdue credential visible (NIST SP 800-57 Pt 1, 5.3).",
|
|
291
|
+
"hubWhen": {
|
|
292
|
+
"ROTATION": [
|
|
293
|
+
"runbook"
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"id": "req-breakglass",
|
|
299
|
+
"type": "requirement",
|
|
300
|
+
"label": "People read via break-glass",
|
|
301
|
+
"x": 260,
|
|
302
|
+
"y": 1300,
|
|
303
|
+
"ears_type": "event-driven",
|
|
304
|
+
"trigger": "a person requests to read a production secret",
|
|
305
|
+
"action": "allow it only through the break-glass procedure, after a second person approves, alert the security channel within 5 minutes of the read, and rotate the secret within 24 hours",
|
|
306
|
+
"rationale": "With no standing human readers, a stolen laptop or a departure exposes nothing; the rotation afterwards makes the emergency read harmless (OWASP Secrets Management Cheat Sheet: Access Control).",
|
|
307
|
+
"hubWhen": {
|
|
308
|
+
"ACCESS": [
|
|
309
|
+
"breakglass"
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "req-jit",
|
|
315
|
+
"type": "requirement",
|
|
316
|
+
"label": "Access granted just in time",
|
|
317
|
+
"x": 260,
|
|
318
|
+
"y": 1430,
|
|
319
|
+
"ears_type": "event-driven",
|
|
320
|
+
"trigger": "an on-call engineer requests read access to a production secret",
|
|
321
|
+
"action": "grant access to that one secret for at most 4 hours after a second person approves, withdraw it automatically when the time is up, and alert the security channel within 5 minutes of each read",
|
|
322
|
+
"rationale": "Access that ends by itself does not pile up; the approval puts a second pair of eyes on every read (OWASP Secrets Management Cheat Sheet: Access Control).",
|
|
323
|
+
"hubWhen": {
|
|
324
|
+
"ACCESS": [
|
|
325
|
+
"jit"
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"id": "req-team",
|
|
331
|
+
"type": "requirement",
|
|
332
|
+
"label": "Rotated when people leave",
|
|
333
|
+
"x": 260,
|
|
334
|
+
"y": 1560,
|
|
335
|
+
"ears_type": "event-driven",
|
|
336
|
+
"trigger": "a person who could read the element's production secrets leaves the team",
|
|
337
|
+
"action": "withdraw their access the same day and rotate every secret they could read within 7 days",
|
|
338
|
+
"rationale": "Standing access means every former member still knows the secrets; rotating on departure is the price of that access (OWASP Secrets Management Cheat Sheet: Rotation, Access Control).",
|
|
339
|
+
"unchecked": "the leaver checklist the team lead runs on the day of each departure (access withdrawn, secrets rotated within 7 days), confirmed by the quarterly access review; departures are known to people, not to a tool.",
|
|
340
|
+
"hubWhen": {
|
|
341
|
+
"ACCESS": [
|
|
342
|
+
"team"
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"id": "req-scan-push",
|
|
348
|
+
"type": "requirement",
|
|
349
|
+
"label": "Secrets refused at push",
|
|
350
|
+
"x": 260,
|
|
351
|
+
"y": 1690,
|
|
352
|
+
"ears_type": "unwanted-behaviour",
|
|
353
|
+
"unwanted_condition": "a push to the code host contains a credential",
|
|
354
|
+
"action": "refuse the push and name the file and line, and record any bypass with its reason for review within 1 day",
|
|
355
|
+
"rationale": "A secret refused before the push never reaches a shared copy and needs no rotation (GitHub Docs, push protection; OWASP Secrets Management Cheat Sheet: Detection).",
|
|
356
|
+
"hubWhen": {
|
|
357
|
+
"SCANNING": [
|
|
358
|
+
"push"
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"id": "req-scan-ci",
|
|
364
|
+
"type": "requirement",
|
|
365
|
+
"label": "Secrets block the merge",
|
|
366
|
+
"x": 260,
|
|
367
|
+
"y": 1820,
|
|
368
|
+
"ears_type": "unwanted-behaviour",
|
|
369
|
+
"unwanted_condition": "a pull request adds a credential in any of its commits",
|
|
370
|
+
"action": "fail its required check so that it cannot merge, and treat the credential as exposed",
|
|
371
|
+
"rationale": "Without push protection the secret has reached the server, so the merge gate keeps it out of the main line and the leak runbook revokes it (OWASP Secrets Management Cheat Sheet: Detection; Gitleaks).",
|
|
372
|
+
"hubWhen": {
|
|
373
|
+
"SCANNING": [
|
|
374
|
+
"ci"
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"id": "req-scan-scheduled",
|
|
380
|
+
"type": "requirement",
|
|
381
|
+
"label": "Leaks found within a day",
|
|
382
|
+
"x": 260,
|
|
383
|
+
"y": 1950,
|
|
384
|
+
"ears_type": "event-driven",
|
|
385
|
+
"trigger": "a credential is committed, built into an image or written to a CI log",
|
|
386
|
+
"action": "report it to the element's owner by the next nightly scan, and have it revoked or recorded as a false positive before the scan after that",
|
|
387
|
+
"rationale": "A scheduled scan over the whole history finds what was there before scanning began; the deadline turns findings into revocations (OWASP Secrets Management Cheat Sheet: Detection).",
|
|
388
|
+
"hubWhen": {
|
|
389
|
+
"SCANNING": [
|
|
390
|
+
"scheduled"
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"id": "sc-no-repo",
|
|
396
|
+
"type": "scenario",
|
|
397
|
+
"label": "Repository clean",
|
|
398
|
+
"x": 520,
|
|
399
|
+
"y": 0,
|
|
400
|
+
"given": "the repository with its full history, the built images and the last day of CI logs",
|
|
401
|
+
"when": "they are scanned with the secret scanner",
|
|
402
|
+
"then": "0 secrets are found outside the scanner's allow-list of test fixtures"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"id": "sc-own",
|
|
406
|
+
"type": "scenario",
|
|
407
|
+
"label": "Nothing shared",
|
|
408
|
+
"x": 520,
|
|
409
|
+
"y": 130,
|
|
410
|
+
"given": "the secrets every workload of the system may read",
|
|
411
|
+
"when": "they are listed per workload",
|
|
412
|
+
"then": "no secret is readable by two workloads, and none by a wildcard"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"id": "sc-leak",
|
|
416
|
+
"type": "scenario",
|
|
417
|
+
"label": "Leaked key revoked",
|
|
418
|
+
"x": 520,
|
|
419
|
+
"y": 260,
|
|
420
|
+
"given": "a production credential reported as pasted in a public place",
|
|
421
|
+
"when": "the leak runbook is followed",
|
|
422
|
+
"then": "within {{REVOKE_MINUTES}} minutes the credential no longer works, the element runs on its replacement with no failed requests, and its uses since the exposure are listed"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"id": "sc-audit",
|
|
426
|
+
"type": "scenario",
|
|
427
|
+
"label": "Read leaves a record",
|
|
428
|
+
"x": 520,
|
|
429
|
+
"y": 390,
|
|
430
|
+
"given": "a production secret",
|
|
431
|
+
"when": "a person reads it and changes it",
|
|
432
|
+
"then": "the audit log holds both events with person, time, secret name and approval, and not the value"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"id": "sc-manager",
|
|
436
|
+
"type": "scenario",
|
|
437
|
+
"label": "Credential refreshed",
|
|
438
|
+
"x": 520,
|
|
439
|
+
"y": 520,
|
|
440
|
+
"given": "a running element whose database credential is replaced in the secrets manager",
|
|
441
|
+
"when": "its lease expires",
|
|
442
|
+
"then": "the element uses the new credential with no restart and no failed request, and nothing on its disk holds either value",
|
|
443
|
+
"hubWhen": {
|
|
444
|
+
"STORE": [
|
|
445
|
+
"manager"
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"id": "sc-workload",
|
|
451
|
+
"type": "scenario",
|
|
452
|
+
"label": "No stored secret",
|
|
453
|
+
"x": 520,
|
|
454
|
+
"y": 650,
|
|
455
|
+
"given": "the element's deployment manifests",
|
|
456
|
+
"when": "every reference to a Secret is listed",
|
|
457
|
+
"then": "only the allow-listed keys of outside systems appear; databases and cloud services are reached by the identity alone",
|
|
458
|
+
"hubWhen": {
|
|
459
|
+
"STORE": [
|
|
460
|
+
"identity"
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"id": "sc-env",
|
|
466
|
+
"type": "scenario",
|
|
467
|
+
"label": "Crash hides secrets",
|
|
468
|
+
"x": 520,
|
|
469
|
+
"y": 780,
|
|
470
|
+
"given": "the element running with its database password in an environment variable",
|
|
471
|
+
"when": "it crashes and its configuration endpoint is called",
|
|
472
|
+
"then": "neither the crash report nor the endpoint shows the password",
|
|
473
|
+
"hubWhen": {
|
|
474
|
+
"STORE": [
|
|
475
|
+
"env"
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"id": "sc-env-store",
|
|
481
|
+
"type": "scenario",
|
|
482
|
+
"label": "Store encrypted",
|
|
483
|
+
"x": 520,
|
|
484
|
+
"y": 910,
|
|
485
|
+
"given": "the production cluster",
|
|
486
|
+
"when": "its encryption configuration is read",
|
|
487
|
+
"then": "Secrets are listed among the resources encrypted with a KMS key",
|
|
488
|
+
"hubWhen": {
|
|
489
|
+
"STORE": [
|
|
490
|
+
"env"
|
|
491
|
+
]
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"id": "sc-rotate-auto",
|
|
496
|
+
"type": "scenario",
|
|
497
|
+
"label": "Rotation without downtime",
|
|
498
|
+
"x": 520,
|
|
499
|
+
"y": 1040,
|
|
500
|
+
"given": "a credential {{ROTATE_DAYS}} days old and traffic flowing",
|
|
501
|
+
"when": "the store rotates it",
|
|
502
|
+
"then": "no request fails and the old credential is refused afterwards",
|
|
503
|
+
"hubWhen": {
|
|
504
|
+
"ROTATION": [
|
|
505
|
+
"automatic"
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"id": "sc-rotate-runbook",
|
|
511
|
+
"type": "scenario",
|
|
512
|
+
"label": "Overdue key alerted",
|
|
513
|
+
"x": 520,
|
|
514
|
+
"y": 1170,
|
|
515
|
+
"given": "a partner API key created {{ROTATE_DAYS}} days ago",
|
|
516
|
+
"when": "the daily check runs",
|
|
517
|
+
"then": "the owner is alerted, and the alert stops once the key is replaced by following the runbook",
|
|
518
|
+
"hubWhen": {
|
|
519
|
+
"ROTATION": [
|
|
520
|
+
"runbook"
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"id": "sc-breakglass",
|
|
526
|
+
"type": "scenario",
|
|
527
|
+
"label": "Emergency read",
|
|
528
|
+
"x": 520,
|
|
529
|
+
"y": 1300,
|
|
530
|
+
"given": "an engineer without access to production secrets",
|
|
531
|
+
"when": "they read one through break-glass with a second person's approval",
|
|
532
|
+
"then": "the security channel is alerted within 5 minutes and the secret is rotated within 24 hours",
|
|
533
|
+
"hubWhen": {
|
|
534
|
+
"ACCESS": [
|
|
535
|
+
"breakglass"
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"id": "sc-jit",
|
|
541
|
+
"type": "scenario",
|
|
542
|
+
"label": "Access expires",
|
|
543
|
+
"x": 520,
|
|
544
|
+
"y": 1430,
|
|
545
|
+
"given": "an on-call engineer granted read access to one secret",
|
|
546
|
+
"when": "they read it, and 4 hours pass",
|
|
547
|
+
"then": "the read is alerted within 5 minutes, and afterwards the engineer can no longer read it, and could never read any other secret",
|
|
548
|
+
"hubWhen": {
|
|
549
|
+
"ACCESS": [
|
|
550
|
+
"jit"
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"id": "sc-team",
|
|
556
|
+
"type": "scenario",
|
|
557
|
+
"label": "Departure rotates",
|
|
558
|
+
"x": 520,
|
|
559
|
+
"y": 1560,
|
|
560
|
+
"given": "a team member who could read three production secrets",
|
|
561
|
+
"when": "they leave the team",
|
|
562
|
+
"then": "their access is gone that day and all three secrets are replaced within 7 days",
|
|
563
|
+
"hubWhen": {
|
|
564
|
+
"ACCESS": [
|
|
565
|
+
"team"
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"id": "sc-scan-push",
|
|
571
|
+
"type": "scenario",
|
|
572
|
+
"label": "Push refused",
|
|
573
|
+
"x": 520,
|
|
574
|
+
"y": 1690,
|
|
575
|
+
"given": "a commit that adds a cloud access key to a configuration file",
|
|
576
|
+
"when": "it is pushed, and once pushed with a bypass",
|
|
577
|
+
"then": "the code host refuses it and names the file and line; the bypass is an alert that is reviewed within 1 day",
|
|
578
|
+
"hubWhen": {
|
|
579
|
+
"SCANNING": [
|
|
580
|
+
"push"
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"id": "sc-scan-ci",
|
|
586
|
+
"type": "scenario",
|
|
587
|
+
"label": "Merge blocked",
|
|
588
|
+
"x": 520,
|
|
589
|
+
"y": 1820,
|
|
590
|
+
"given": "a pull request whose second commit adds a database password and whose third removes it",
|
|
591
|
+
"when": "its checks run",
|
|
592
|
+
"then": "the secret check fails and the pull request cannot merge",
|
|
593
|
+
"hubWhen": {
|
|
594
|
+
"SCANNING": [
|
|
595
|
+
"ci"
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"id": "sc-scan-scheduled",
|
|
601
|
+
"type": "scenario",
|
|
602
|
+
"label": "Nightly scan reports",
|
|
603
|
+
"x": 520,
|
|
604
|
+
"y": 1950,
|
|
605
|
+
"given": "a credential committed to a branch during the day",
|
|
606
|
+
"when": "the nightly scan runs, and the next one",
|
|
607
|
+
"then": "the owner has a finding by the morning naming the commit and file, and the second scan fails while it is not revoked or recorded",
|
|
608
|
+
"hubWhen": {
|
|
609
|
+
"SCANNING": [
|
|
610
|
+
"scheduled"
|
|
611
|
+
]
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"id": "adr-manager",
|
|
616
|
+
"type": "adr",
|
|
617
|
+
"label": "Credentials in a secrets manager",
|
|
618
|
+
"x": 780,
|
|
619
|
+
"y": 0,
|
|
620
|
+
"concern": "secrets",
|
|
621
|
+
"status": "accepted",
|
|
622
|
+
"date": "",
|
|
623
|
+
"context": "This element uses credentials (passwords, API keys, tokens, certificates) to reach databases and outside systems. The forces: credentials put in code, images, build logs or tickets are copied far more widely than anyone tracks, and git history keeps them after they are deleted; a credential shared between elements widens every leak; one that is never changed stays valid after the people who saw it have left; a person who can read every production secret is a target in their own right; and when one leaks it has to be revoked in minutes, without stopping the system and without guessing where else it was used. Snippets assume Kubernetes manifests rendered under manifests/ (workloads labelled app.kubernetes.io/part-of=shop in the production namespace), Terraform under infra/ read with terraform show -json, AWS as the platform where one is named, and GitHub as the code host.",
|
|
624
|
+
"decision": "Credentials are kept in a secrets manager and read at run time with the element's own platform identity; each element has its own in each environment, with only the rights it needs. Rotation: {{ROTATION}}, at least every {{ROTATE_DAYS}} days; an exposed credential stops working within {{REVOKE_MINUTES}} minutes. Production secrets may be read by {{ACCESS}}. Leaked credentials are caught {{SCANNING}}. Choosing the manager: the one the platform offers (AWS Secrets Manager, Azure Key Vault, Google Secret Manager) when the system runs on one cloud; HashiCorp Vault or OpenBao when it spans clouds or on-premises, or needs dynamic database credentials; judge by rotation support for the databases used, audit log export and cost per secret and per call.",
|
|
625
|
+
"consequences": "• One place to audit reads, rotate and revoke.\n• The secrets manager is on the start path: elements cache credentials in memory and survive its short outages.\n• Rotation needs elements that pick up a new credential without restarting, or rolling restarts.\n• Local development needs its own secrets, never copies of production ones.",
|
|
626
|
+
"alternatives": "1. Workload identity: nothing stored at all, but every database and service used must accept it.\n2. Environment variables from the deployment: no extra service, but values leak into dumps and change only with a redeploy.\n3. Encrypted files in the repository (SOPS, git-crypt): versioned with the code, but every reader of the key reads every secret and history keeps old values.",
|
|
627
|
+
"hubWhen": {
|
|
628
|
+
"STORE": [
|
|
629
|
+
"manager"
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"id": "adr-identity",
|
|
635
|
+
"type": "adr",
|
|
636
|
+
"label": "Workload identity, no stored secrets",
|
|
637
|
+
"x": 780,
|
|
638
|
+
"y": 130,
|
|
639
|
+
"concern": "secrets",
|
|
640
|
+
"status": "accepted",
|
|
641
|
+
"date": "",
|
|
642
|
+
"context": "This element uses credentials (passwords, API keys, tokens, certificates) to reach databases and outside systems. The forces: credentials put in code, images, build logs or tickets are copied far more widely than anyone tracks, and git history keeps them after they are deleted; a credential shared between elements widens every leak; one that is never changed stays valid after the people who saw it have left; a person who can read every production secret is a target in their own right; and when one leaks it has to be revoked in minutes, without stopping the system and without guessing where else it was used. Snippets assume Kubernetes manifests rendered under manifests/ (workloads labelled app.kubernetes.io/part-of=shop in the production namespace), Terraform under infra/ read with terraform show -json, AWS as the platform where one is named, and GitHub as the code host.",
|
|
643
|
+
"decision": "Elements authenticate with the platform's workload identity (IAM roles for service accounts, Azure managed identities, GCP workload identity federation, or SPIFFE/SPIRE across platforms) and get tokens that expire within an hour; no password or key is stored for databases and cloud services. Each identity has only the rights its element needs. Outside systems that need a static key are the exception: those keys live in the platform's secrets manager, on an allow-list, rotated at least every {{ROTATE_DAYS}} days ({{ROTATION}}, where the issuer allows it; a key a partner issues by hand follows its runbook). Exposed keys stop working within {{REVOKE_MINUTES}} minutes. Production secrets may be read by {{ACCESS}}. Leaked credentials are caught {{SCANNING}}.",
|
|
644
|
+
"consequences": "• Nothing long-lived to leak or rotate for databases and cloud services.\n• Needs support in the platform and in every database and service used; some (older drivers, third-party SaaS) do not have it.\n• Local development needs identities of its own, for example per developer through the cloud CLI.\n• Rights are reviewed in the platform's policies, which become as important as the code.",
|
|
645
|
+
"alternatives": "1. A secrets manager for every credential: works with anything, but every credential is a stored secret to rotate.\n2. Environment variables from the deployment: simplest, and the weakest.",
|
|
646
|
+
"hubWhen": {
|
|
647
|
+
"STORE": [
|
|
648
|
+
"identity"
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"id": "adr-env",
|
|
654
|
+
"type": "adr",
|
|
655
|
+
"label": "Credentials in the deployment",
|
|
656
|
+
"x": 780,
|
|
657
|
+
"y": 260,
|
|
658
|
+
"concern": "secrets",
|
|
659
|
+
"status": "accepted",
|
|
660
|
+
"date": "",
|
|
661
|
+
"context": "This element uses credentials (passwords, API keys, tokens, certificates) to reach databases and outside systems. The forces: credentials put in code, images, build logs or tickets are copied far more widely than anyone tracks, and git history keeps them after they are deleted; a credential shared between elements widens every leak; one that is never changed stays valid after the people who saw it have left; a person who can read every production secret is a target in their own right; and when one leaks it has to be revoked in minutes, without stopping the system and without guessing where else it was used. Snippets assume Kubernetes manifests rendered under manifests/ (workloads labelled app.kubernetes.io/part-of=shop in the production namespace), Terraform under infra/ read with terraform show -json, AWS as the platform where one is named, and GitHub as the code host.",
|
|
662
|
+
"decision": "Credentials are kept encrypted in the deployment's store (Kubernetes Secrets with encryption at rest, Sealed Secrets or SOPS-encrypted manifests, or the CI system's encrypted variables) and set as environment variables at start; each element has its own, with only the rights it needs, and masks them in logs, crash reports and diagnostics. Rotation: {{ROTATION}}, at least every {{ROTATE_DAYS}} days, with a rolling redeploy that records the rotation on the Secret; an exposed credential stops working within {{REVOKE_MINUTES}} minutes. Production secrets may be read by {{ACCESS}}. Leaked credentials are caught {{SCANNING}}. Move to a secrets manager when there are more than a handful of credentials or rotation by redeploy becomes a burden.",
|
|
663
|
+
"consequences": "• No extra service to run or pay for.\n• Values show in process listings, crash dumps and to anyone who can describe the deployment.\n• Rotation means a redeploy, and there is no central log of who read what beyond the platform's audit log.",
|
|
664
|
+
"alternatives": "1. A secrets manager: central audit and rotation, one more service on the start path.\n2. Workload identity: nothing stored, needs platform and database support.",
|
|
665
|
+
"hubWhen": {
|
|
666
|
+
"STORE": [
|
|
667
|
+
"env"
|
|
668
|
+
]
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"id": "ff-scan-push",
|
|
673
|
+
"type": "fitness-fn",
|
|
674
|
+
"label": "Push protection on",
|
|
675
|
+
"x": 1040,
|
|
676
|
+
"y": 0,
|
|
677
|
+
"characteristic": "security",
|
|
678
|
+
"scope": "atomic",
|
|
679
|
+
"cadence": "triggered",
|
|
680
|
+
"trigger": "nightly",
|
|
681
|
+
"invocation": "automated",
|
|
682
|
+
"description": "A scheduled job lists the organisation's repositories through the GitHub API and fails when one has secret scanning or push protection turned off; it then lists the open secret scanning alerts that came from a bypass and fails on one older than a day, which is a bypass nobody has reviewed and resolved.\n\nThreshold: 100 % of the organisation's repositories have secret scanning and push protection enabled; 0 open alerts created by a bypass more than 1 day ago\n\nTool: GitHub CLI against the GitHub REST API (for GitLab: the secret push protection setting and its audit events, read from its API the same way)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\ngh api --paginate \"/orgs/$ORG/repos?per_page=100\" \\\n --jq '.[] | select(.archived | not)\n | select(.security_and_analysis.secret_scanning.status != \"enabled\"\n or .security_and_analysis.secret_scanning_push_protection.status != \"enabled\")\n | .full_name' > unprotected.txt\ntest ! -s unprotected.txt || { echo \"repositories without secret scanning or push protection:\"; cat unprotected.txt; exit 1; }\n\ngh api --paginate \"/orgs/$ORG/secret-scanning/alerts?state=open&is_bypassed=true&per_page=100\" \\\n --jq '.[] | select((.push_protection_bypassed_at | fromdateiso8601) < (now - 86400))\n | \"\\(.repository.full_name) #\\(.number) bypassed by \\(.push_protection_bypassed_by.login) at \\(.push_protection_bypassed_at)\"' > unreviewed.txt\ntest ! -s unreviewed.txt || { echo \"bypasses older than a day, not reviewed:\"; cat unreviewed.txt; exit 1; }\n```",
|
|
683
|
+
"hubWhen": {
|
|
684
|
+
"SCANNING": [
|
|
685
|
+
"push"
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"id": "ff-scan-ci",
|
|
691
|
+
"type": "fitness-fn",
|
|
692
|
+
"label": "Secret scan in CI",
|
|
693
|
+
"x": 1040,
|
|
694
|
+
"y": 130,
|
|
695
|
+
"characteristic": "security",
|
|
696
|
+
"scope": "atomic",
|
|
697
|
+
"cadence": "triggered",
|
|
698
|
+
"trigger": "pull-request",
|
|
699
|
+
"invocation": "automated",
|
|
700
|
+
"description": "Gitleaks scans every commit of each pull request and is a required status check, so a pull request that adds a secret, even one removed in a later commit, cannot merge.\n\nThreshold: 0 secrets found in the commits of a pull request; the check is required for merging\n\nTool: Gitleaks\n\n```yaml\n# .github/workflows/secrets.yml\nname: secrets\non: [pull_request]\njobs:\n gitleaks:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n with: { fetch-depth: 0 }\n - name: Scan the pull request's commits\n run: |\n docker run --rm -v \"$PWD:/repo\" zricethezav/gitleaks:v8.27.2 \\\n git /repo --log-opts=\"origin/${{ github.base_ref }}..HEAD\" --redact --exit-code 1\n```",
|
|
701
|
+
"hubWhen": {
|
|
702
|
+
"SCANNING": [
|
|
703
|
+
"push",
|
|
704
|
+
"ci"
|
|
705
|
+
]
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"id": "ff-scan-history",
|
|
710
|
+
"type": "fitness-fn",
|
|
711
|
+
"label": "Nightly history, logs and images",
|
|
712
|
+
"x": 1040,
|
|
713
|
+
"y": 260,
|
|
714
|
+
"characteristic": "security",
|
|
715
|
+
"scope": "atomic",
|
|
716
|
+
"cadence": "triggered",
|
|
717
|
+
"trigger": "nightly",
|
|
718
|
+
"invocation": "automated",
|
|
719
|
+
"description": "A nightly job scans the full git history and the previous day's CI logs with Gitleaks and the latest built images with TruffleHog; a finding is closed by revoking the credential and adding its fingerprint to .gitleaksignore (a false positive, likewise), so the job keeps failing, and the owner keeps being told, until that happens.\n\nThreshold: The nightly job fails on every finding in the git history, the previous day's CI logs or the built images that is not yet closed; a finding is closed by revoking the secret and recording its fingerprint with the review, so none stays open past the next run\n\nTool: Gitleaks and TruffleHog with the GitHub CLI\n\n```yaml\n# .github/workflows/secrets-nightly.yml\nname: secrets-nightly\non:\n schedule: [{ cron: '0 2 * * *' }]\njobs:\n scan:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n with: { fetch-depth: 0 }\n - name: Git history (closed findings are in .gitleaksignore with their review)\n run: docker run --rm -v \"$PWD:/repo\" zricethezav/gitleaks:v8.27.2 git /repo --redact --exit-code 1\n - name: Yesterday's CI logs\n env: { GH_TOKEN: \"${{ github.token }}\" }\n run: |\n mkdir -p ci-logs\n for id in $(gh run list --created \"$(date -u -d yesterday +%F)\" --limit 200 --json databaseId --jq '.[].databaseId'); do\n gh run view \"$id\" --log > \"ci-logs/$id.txt\" || true\n done\n docker run --rm -v \"$PWD/ci-logs:/logs\" zricethezav/gitleaks:v8.27.2 dir /logs --redact --exit-code 1\n - name: Built images\n run: docker run --rm trufflesecurity/trufflehog:3.99.7 docker --image \"$IMAGE\" --only-verified --fail\n```",
|
|
720
|
+
"hubWhen": {
|
|
721
|
+
"SCANNING": [
|
|
722
|
+
"scheduled"
|
|
723
|
+
]
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"id": "ff-age-manager",
|
|
728
|
+
"type": "fitness-fn",
|
|
729
|
+
"label": "No secret past its rotation period",
|
|
730
|
+
"x": 1040,
|
|
731
|
+
"y": 390,
|
|
732
|
+
"characteristic": "security",
|
|
733
|
+
"scope": "atomic",
|
|
734
|
+
"cadence": "continual",
|
|
735
|
+
"invocation": "automated",
|
|
736
|
+
"description": "AWS Config evaluates every secret in AWS Secrets Manager and reports one not rotated within {{ROTATE_DAYS}} days, whether the store or a person rotates it; the non-compliant list is the daily alert to the owners.\n\nThreshold: 0 secrets in the secrets manager last rotated more than {{ROTATE_DAYS}} days ago\n\nTool: AWS Config managed rule SECRETSMANAGER_SECRET_PERIODIC_ROTATION (for Vault: a scheduled job over the secrets' metadata updated_time; for Key Vault: the secrets' attributes.updated)\n\n```hcl\nresource \"aws_config_config_rule\" \"secret_rotated\" {\n name = \"secret-rotated-within-{{ROTATE_DAYS}}-days\"\n source {\n owner = \"AWS\"\n source_identifier = \"SECRETSMANAGER_SECRET_PERIODIC_ROTATION\"\n }\n input_parameters = jsonencode({ maxDaysSinceRotation = \"{{ROTATE_DAYS}}\" })\n}\n```",
|
|
737
|
+
"hubWhen": {
|
|
738
|
+
"STORE": [
|
|
739
|
+
"manager",
|
|
740
|
+
"identity"
|
|
741
|
+
]
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"id": "ff-rotation-enabled",
|
|
746
|
+
"type": "fitness-fn",
|
|
747
|
+
"label": "Rotation is on",
|
|
748
|
+
"x": 1040,
|
|
749
|
+
"y": 520,
|
|
750
|
+
"characteristic": "security",
|
|
751
|
+
"scope": "atomic",
|
|
752
|
+
"cadence": "continual",
|
|
753
|
+
"invocation": "automated",
|
|
754
|
+
"description": "AWS Config reports every secret in AWS Secrets Manager that has no rotation configured, which with automatic rotation decided means a secret that will never be rotated.\n\nThreshold: 0 secrets in the secrets manager without automatic rotation configured\n\nTool: AWS Config managed rule SECRETSMANAGER_ROTATION_ENABLED_CHECK (for Vault: a scheduled job over the database secrets engine roles; for Key Vault: az keyvault secret show, the rotation policy)\n\n```hcl\nresource \"aws_config_config_rule\" \"secret_rotation_enabled\" {\n name = \"secret-rotation-enabled\"\n source {\n owner = \"AWS\"\n source_identifier = \"SECRETSMANAGER_ROTATION_ENABLED_CHECK\"\n }\n}\n```",
|
|
755
|
+
"hubWhen": {
|
|
756
|
+
"STORE": [
|
|
757
|
+
"manager",
|
|
758
|
+
"identity"
|
|
759
|
+
],
|
|
760
|
+
"ROTATION": [
|
|
761
|
+
"automatic"
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"id": "ff-refresh",
|
|
767
|
+
"type": "fitness-fn",
|
|
768
|
+
"label": "Rotation without a restart",
|
|
769
|
+
"x": 1040,
|
|
770
|
+
"y": 650,
|
|
771
|
+
"characteristic": "security",
|
|
772
|
+
"scope": "atomic",
|
|
773
|
+
"cadence": "triggered",
|
|
774
|
+
"trigger": "pull-request",
|
|
775
|
+
"invocation": "automated",
|
|
776
|
+
"description": "An integration test runs the element against a database and a secrets manager in containers, keeps requests flowing, puts a new credential version (the alternate database user, as a rotation does), waits one lease, revokes the old credential and counts failures; it then searches the container's file system for both values.\n\nThreshold: With traffic flowing, a new secret version put in the manager is in use before the old credential is revoked; 0 failed requests and 0 restarts; nothing on the element's disk holds either value\n\nTool: Vitest with Testcontainers (PostgreSQL, LocalStack Secrets Manager) (or the test runner of your stack)\n\n```ts\nimport { SecretsManagerClient, PutSecretValueCommand } from '@aws-sdk/client-secrets-manager'\n\nit('picks up a rotated credential without a restart or a failed request', async () => {\n const sm = new SecretsManagerClient({ endpoint: localstack.getConnectionUri() }) // the element reads shop/db from here\n const traffic = keepCalling(element, '/orders', { seconds: 3 * LEASE_SECONDS }) // continuous requests, counts failures\n await sm.send(new PutSecretValueCommand({ SecretId: 'shop/db', SecretString: JSON.stringify({ user: 'shop_b', password: 'rotated' }) }))\n await sleep((LEASE_SECONDS + 1) * 1000)\n await db.query(\"alter user shop_a with password 'revoked'\") // the old credential stops working\n const { failed, restarts } = await traffic\n expect(failed).toBe(0)\n expect(restarts).toBe(0)\n const disk = await element.exec(['grep', '-rl', '-e', 'rotated', '-e', 'revoked', '/'])\n expect(disk.output.trim()).toBe('')\n})\n```",
|
|
777
|
+
"hubWhen": {
|
|
778
|
+
"STORE": [
|
|
779
|
+
"manager"
|
|
780
|
+
]
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"id": "ff-no-static",
|
|
785
|
+
"type": "fitness-fn",
|
|
786
|
+
"label": "No stored database secrets",
|
|
787
|
+
"x": 1040,
|
|
788
|
+
"y": 780,
|
|
789
|
+
"characteristic": "security",
|
|
790
|
+
"scope": "atomic",
|
|
791
|
+
"cadence": "triggered",
|
|
792
|
+
"trigger": "pull-request",
|
|
793
|
+
"invocation": "automated",
|
|
794
|
+
"description": "A Conftest policy over the rendered manifests fails when a workload reads an environment variable, an environment block or a volume from a Secret that is not on the allow-list, which would mean a stored credential came back.\n\nThreshold: 0 workloads (Deployments, StatefulSets, DaemonSets, Jobs, CronJobs) that take a credential from a Kubernetes Secret through env, envFrom or a volume, outside the allow-list of outside-system keys\n\nTool: Conftest (Open Policy Agent)\n\n```rego\n# conftest test --combine manifests/\npackage main\n\nimport rego.v1\n\nallowed := {\"partner-api-key\"} # keys of outside systems that accept nothing else\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\npodspec(d) := d.spec.template.spec if d.kind in {\"Deployment\", \"StatefulSet\", \"DaemonSet\", \"Job\"}\npodspec(d) := d.spec.jobTemplate.spec.template.spec if d.kind == \"CronJob\"\n\nsecrets_of(d) := union({\n {s | some c in podspec(d).containers; some e in c.env; s := e.valueFrom.secretKeyRef.name},\n {s | some c in podspec(d).containers; some e in c.envFrom; s := e.secretRef.name},\n {s | some v in podspec(d).volumes; s := v.secret.secretName},\n})\n\ndeny contains msg if {\n some d in docs\n some s in secrets_of(d)\n not allowed[s]\n msg := sprintf(\"%s %s reads secret %s: use the workload identity\", [d.kind, d.metadata.name, s])\n}\n```",
|
|
795
|
+
"hubWhen": {
|
|
796
|
+
"STORE": [
|
|
797
|
+
"identity"
|
|
798
|
+
]
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"id": "ff-age-env",
|
|
803
|
+
"type": "fitness-fn",
|
|
804
|
+
"label": "Deployment secrets rotated",
|
|
805
|
+
"x": 1040,
|
|
806
|
+
"y": 910,
|
|
807
|
+
"characteristic": "security",
|
|
808
|
+
"scope": "atomic",
|
|
809
|
+
"cadence": "triggered",
|
|
810
|
+
"trigger": "nightly",
|
|
811
|
+
"invocation": "automated",
|
|
812
|
+
"description": "A scheduled job lists the Kubernetes Secrets the elements read and fails on any whose rotation annotation (written by the rotation runbook or pipeline on every rotation; the creation time counts when there is none) is older than {{ROTATE_DAYS}} days; the list is the daily alert to the owners.\n\nThreshold: 0 Secrets in the production namespace rotated (or, never rotated, created) more than {{ROTATE_DAYS}} days ago\n\nTool: kubectl and jq\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nmax_age=$(( {{ROTATE_DAYS}} * 86400 ))\n# the rotation writes the annotation secrets.acme.io/rotated-at (RFC 3339) on the Secret it replaces in place\nkubectl get secrets -n production -l app.kubernetes.io/part-of=shop -o json \\\n | jq -r --argjson max \"$max_age\" '.items[]\n | ((.metadata.annotations[\"secrets.acme.io/rotated-at\"] // .metadata.creationTimestamp) | fromdateiso8601) as $rotated\n | select((now - $rotated) > $max)\n | .metadata.name' > stale.txt\ntest ! -s stale.txt || { echo \"Secrets past rotation:\"; cat stale.txt; exit 1; }\n```",
|
|
813
|
+
"hubWhen": {
|
|
814
|
+
"STORE": [
|
|
815
|
+
"env"
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"id": "ff-human-reads",
|
|
821
|
+
"type": "fitness-fn",
|
|
822
|
+
"label": "Human reads alerted",
|
|
823
|
+
"x": 1040,
|
|
824
|
+
"y": 1040,
|
|
825
|
+
"characteristic": "security",
|
|
826
|
+
"scope": "atomic",
|
|
827
|
+
"cadence": "continual",
|
|
828
|
+
"invocation": "automated",
|
|
829
|
+
"description": "A CloudWatch Logs metric filter on the CloudTrail log group counts GetSecretValue calls by anything but the workloads' roles (an IAM user, or an assumed role not named workload-*; read-only events never reach EventBridge, so the log group is the source) and an alarm with a one-minute period pages the security channel; the log group keeps 400 days. On Vault, the audit device feeds the same alert.\n\nThreshold: 100 % of reads of a production secret by a person raise an alert within 5 minutes to the security channel, where each is matched with its approval; the trail that records them is kept for 400 days\n\nTool: AWS CloudTrail delivered to CloudWatch Logs, a metric filter and an alarm (Terraform); for Vault: the audit device and the same alert in your log system\n\n```hcl\nresource \"aws_cloudwatch_log_group\" \"cloudtrail\" {\n name = \"cloudtrail\"\n retention_in_days = 400\n}\n\nresource \"aws_cloudwatch_log_metric_filter\" \"human_secret_reads\" {\n name = \"human-secret-reads\"\n log_group_name = aws_cloudwatch_log_group.cloudtrail.name # the trail delivers management events here\n pattern = \"{ ($.eventSource = \\\"secretsmanager.amazonaws.com\\\") && ($.eventName = \\\"GetSecretValue\\\") && (($.userIdentity.type = \\\"IAMUser\\\") || (($.userIdentity.type = \\\"AssumedRole\\\") && ($.userIdentity.sessionContext.sessionIssuer.userName != \\\"workload-*\\\"))) }\"\n metric_transformation {\n name = \"HumanSecretReads\"\n namespace = \"Secrets\"\n value = \"1\"\n }\n}\n\nresource \"aws_cloudwatch_metric_alarm\" \"human_secret_read\" {\n alarm_name = \"human-secret-read\"\n namespace = \"Secrets\"\n metric_name = \"HumanSecretReads\"\n statistic = \"Sum\"\n period = 60\n evaluation_periods = 1\n threshold = 0\n comparison_operator = \"GreaterThanThreshold\"\n treat_missing_data = \"notBreaching\"\n alarm_actions = [aws_sns_topic.security_channel.arn] # each alert is matched with its approval\n}\n```",
|
|
830
|
+
"hubWhen": {
|
|
831
|
+
"ACCESS": [
|
|
832
|
+
"breakglass",
|
|
833
|
+
"jit"
|
|
834
|
+
]
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"id": "ff-read-log",
|
|
839
|
+
"type": "fitness-fn",
|
|
840
|
+
"label": "Team reads logged and reported",
|
|
841
|
+
"x": 1040,
|
|
842
|
+
"y": 1170,
|
|
843
|
+
"characteristic": "security",
|
|
844
|
+
"scope": "atomic",
|
|
845
|
+
"cadence": "continual",
|
|
846
|
+
"invocation": "automated",
|
|
847
|
+
"description": "A CloudWatch Logs metric filter on the CloudTrail log group counts GetSecretValue calls by people (an IAM user, or an assumed role not named workload-*), a daily alarm reports them to the team's channel, and the log group keeps 400 days. On Vault, the audit device feeds the same report.\n\nThreshold: Every read of a production secret by a person is in the trail with who, when and which secret; the trail is kept for 400 days; the owning team gets the day's reads every morning\n\nTool: AWS CloudTrail delivered to CloudWatch Logs, a metric filter and a daily alarm (Terraform); for Vault: the audit device and a daily query in your log system\n\n```hcl\nresource \"aws_cloudwatch_log_group\" \"cloudtrail\" {\n name = \"cloudtrail\"\n retention_in_days = 400\n}\n\nresource \"aws_cloudwatch_log_metric_filter\" \"human_secret_reads\" {\n name = \"human-secret-reads\"\n log_group_name = aws_cloudwatch_log_group.cloudtrail.name\n pattern = \"{ ($.eventSource = \\\"secretsmanager.amazonaws.com\\\") && ($.eventName = \\\"GetSecretValue\\\") && (($.userIdentity.type = \\\"IAMUser\\\") || (($.userIdentity.type = \\\"AssumedRole\\\") && ($.userIdentity.sessionContext.sessionIssuer.userName != \\\"workload-*\\\"))) }\"\n metric_transformation {\n name = \"HumanSecretReads\"\n namespace = \"Secrets\"\n value = \"1\"\n }\n}\n\nresource \"aws_cloudwatch_metric_alarm\" \"daily_secret_reads\" {\n alarm_name = \"secret-reads-yesterday\"\n namespace = \"Secrets\"\n metric_name = \"HumanSecretReads\"\n statistic = \"Sum\"\n period = 86400\n evaluation_periods = 1\n threshold = 0\n comparison_operator = \"GreaterThanThreshold\"\n treat_missing_data = \"notBreaching\"\n alarm_actions = [aws_sns_topic.team_channel.arn] # the team reads the list each morning\n}\n```",
|
|
848
|
+
"hubWhen": {
|
|
849
|
+
"ACCESS": [
|
|
850
|
+
"team"
|
|
851
|
+
]
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"id": "ff-own-manager",
|
|
856
|
+
"type": "fitness-fn",
|
|
857
|
+
"label": "No secret shared between workloads",
|
|
858
|
+
"x": 1040,
|
|
859
|
+
"y": 1300,
|
|
860
|
+
"characteristic": "security",
|
|
861
|
+
"scope": "atomic",
|
|
862
|
+
"cadence": "triggered",
|
|
863
|
+
"trigger": "pull-request",
|
|
864
|
+
"invocation": "automated",
|
|
865
|
+
"description": "A Conftest policy over the Terraform plan parses every IAM policy document, collects the secret ARNs each may GetSecretValue on, and fails when one ARN appears in two policies (two workloads sharing a credential) or when a policy reads by wildcard.\n\nThreshold: 0 secrets readable by two IAM policies in the plan; 0 policies that may read secrets by wildcard\n\nTool: Conftest (Open Policy Agent) over terraform show -json (AWS; for Vault: the policies' path grants, for Key Vault: RBAC assignments, checked the same way)\n\n```rego\npackage main\n\nimport rego.v1\n\nas_set(x) := {x} if is_string(x)\nas_set(x) := {v | some v in x} if is_array(x)\n\npolicies contains rc if {\n some rc in input.resource_changes\n rc.type in {\"aws_iam_role_policy\", \"aws_iam_policy\"}\n is_string(rc.change.after.policy)\n}\n\nreads(rc) := {r |\n some s in json.unmarshal(rc.change.after.policy).Statement\n s.Effect == \"Allow\"\n some a in as_set(s.Action)\n a in {\"secretsmanager:GetSecretValue\", \"secretsmanager:*\"}\n some r in as_set(s.Resource)\n}\n\ndeny contains msg if {\n some rc in policies\n some r in reads(rc)\n contains(r, \"*\")\n msg := sprintf(\"%s may read secrets by wildcard %s\", [rc.address, r])\n}\n\ndeny contains msg if {\n some a in policies\n some b in policies\n a.address < b.address\n some r in reads(a) & reads(b)\n msg := sprintf(\"secret %s is readable by both %s and %s\", [r, a.address, b.address])\n}\n```",
|
|
866
|
+
"hubWhen": {
|
|
867
|
+
"STORE": [
|
|
868
|
+
"manager",
|
|
869
|
+
"identity"
|
|
870
|
+
]
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"id": "ff-own-env",
|
|
875
|
+
"type": "fitness-fn",
|
|
876
|
+
"label": "No Secret shared between workloads",
|
|
877
|
+
"x": 1040,
|
|
878
|
+
"y": 1430,
|
|
879
|
+
"characteristic": "security",
|
|
880
|
+
"scope": "atomic",
|
|
881
|
+
"cadence": "triggered",
|
|
882
|
+
"trigger": "pull-request",
|
|
883
|
+
"invocation": "automated",
|
|
884
|
+
"description": "A Conftest policy over all rendered manifests at once collects the Secrets each workload references and fails when two workloads reference the same one, which is a credential shared between elements.\n\nThreshold: 0 Kubernetes Secrets referenced (env, envFrom or volume) by two workloads in the rendered manifests\n\nTool: Conftest (Open Policy Agent)\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\npodspec(d) := d.spec.template.spec if d.kind in {\"Deployment\", \"StatefulSet\", \"DaemonSet\", \"Job\"}\npodspec(d) := d.spec.jobTemplate.spec.template.spec if d.kind == \"CronJob\"\n\nsecrets_of(d) := union({\n {s | some c in podspec(d).containers; some e in c.env; s := e.valueFrom.secretKeyRef.name},\n {s | some c in podspec(d).containers; some e in c.envFrom; s := e.secretRef.name},\n {s | some v in podspec(d).volumes; s := v.secret.secretName},\n})\n\nname(d) := sprintf(\"%s/%s/%s\", [object.get(d.metadata, \"namespace\", \"default\"), d.kind, d.metadata.name])\n\ndeny contains msg if {\n some a in docs\n some b in docs\n name(a) < name(b)\n some s in secrets_of(a) & secrets_of(b)\n msg := sprintf(\"secret %s is used by both %s and %s\", [s, name(a), name(b)])\n}\n```",
|
|
885
|
+
"hubWhen": {
|
|
886
|
+
"STORE": [
|
|
887
|
+
"env"
|
|
888
|
+
]
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"id": "ff-env-masked",
|
|
893
|
+
"type": "fitness-fn",
|
|
894
|
+
"label": "Variables masked",
|
|
895
|
+
"x": 1040,
|
|
896
|
+
"y": 1560,
|
|
897
|
+
"characteristic": "security",
|
|
898
|
+
"scope": "atomic",
|
|
899
|
+
"cadence": "triggered",
|
|
900
|
+
"trigger": "pull-request",
|
|
901
|
+
"invocation": "automated",
|
|
902
|
+
"description": "A test runs the element with a known password in its environment, reads the configuration endpoint, provokes a crash report and searches both and the captured logs for the value.\n\nThreshold: The configuration endpoint, a crash report and the captured logs contain 0 occurrences of a credential's value\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app } from '../src/app'\n\nit('shows no credential in the configuration endpoint, crash reports or logs', async () => {\n const password = process.env.DB_PASSWORD!\n const res = await request(app).get('/internal/config').expect(200)\n expect(JSON.stringify(res.body)).not.toContain(password)\n const report = await crashReportOf(() => { throw new Error('simulated crash') }) // the element's crash report handler\n expect(report).not.toContain(password)\n expect(capturedLogs()).not.toContain(password)\n})\n```",
|
|
903
|
+
"hubWhen": {
|
|
904
|
+
"STORE": [
|
|
905
|
+
"env"
|
|
906
|
+
]
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"id": "ff-env-encrypted",
|
|
911
|
+
"type": "fitness-fn",
|
|
912
|
+
"label": "Deployment store encrypted",
|
|
913
|
+
"x": 1040,
|
|
914
|
+
"y": 1690,
|
|
915
|
+
"characteristic": "security",
|
|
916
|
+
"scope": "atomic",
|
|
917
|
+
"cadence": "triggered",
|
|
918
|
+
"trigger": "nightly",
|
|
919
|
+
"invocation": "automated",
|
|
920
|
+
"description": "A scheduled job reads the cluster's encryption configuration and fails when Kubernetes Secrets are not envelope-encrypted with a KMS key.\n\nThreshold: The production cluster lists secrets among the resources encrypted with a KMS key; the check fails otherwise\n\nTool: AWS CLI for EKS (for GKE: gcloud container clusters describe, databaseEncryption.state must be ENCRYPTED; for AKS: az aks show, securityProfile.azureKeyVaultKms.enabled; for Sealed Secrets or SOPS: the plain Secret never exists in git, which the secret scan checks)\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\naws eks describe-cluster --name \"$CLUSTER\" --query 'cluster.encryptionConfig[].resources[]' --output text | grep -qw secrets \\\n || { echo \"cluster $CLUSTER does not encrypt Secrets at rest with a KMS key\"; exit 1; }\n```",
|
|
921
|
+
"hubWhen": {
|
|
922
|
+
"STORE": [
|
|
923
|
+
"env"
|
|
924
|
+
]
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
],
|
|
928
|
+
"relations": [
|
|
929
|
+
{
|
|
930
|
+
"id": "req-no-repo--derives--need",
|
|
931
|
+
"sourceId": "req-no-repo",
|
|
932
|
+
"targetId": "need",
|
|
933
|
+
"relationType": "derives"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"id": "req-own--derives--need",
|
|
937
|
+
"sourceId": "req-own",
|
|
938
|
+
"targetId": "need",
|
|
939
|
+
"relationType": "derives"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"id": "req-leak--derives--need",
|
|
943
|
+
"sourceId": "req-leak",
|
|
944
|
+
"targetId": "need",
|
|
945
|
+
"relationType": "derives"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
"id": "req-audit--derives--need",
|
|
949
|
+
"sourceId": "req-audit",
|
|
950
|
+
"targetId": "need",
|
|
951
|
+
"relationType": "derives"
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"id": "req-manager--derives--need",
|
|
955
|
+
"sourceId": "req-manager",
|
|
956
|
+
"targetId": "need",
|
|
957
|
+
"relationType": "derives"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"id": "req-workload--derives--need",
|
|
961
|
+
"sourceId": "req-workload",
|
|
962
|
+
"targetId": "need",
|
|
963
|
+
"relationType": "derives"
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"id": "req-env--derives--need",
|
|
967
|
+
"sourceId": "req-env",
|
|
968
|
+
"targetId": "need",
|
|
969
|
+
"relationType": "derives"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"id": "req-env-store--derives--need",
|
|
973
|
+
"sourceId": "req-env-store",
|
|
974
|
+
"targetId": "need",
|
|
975
|
+
"relationType": "derives"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"id": "req-rotate-auto--derives--need",
|
|
979
|
+
"sourceId": "req-rotate-auto",
|
|
980
|
+
"targetId": "need",
|
|
981
|
+
"relationType": "derives"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"id": "req-rotate-runbook--derives--need",
|
|
985
|
+
"sourceId": "req-rotate-runbook",
|
|
986
|
+
"targetId": "need",
|
|
987
|
+
"relationType": "derives"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"id": "req-breakglass--derives--need",
|
|
991
|
+
"sourceId": "req-breakglass",
|
|
992
|
+
"targetId": "need",
|
|
993
|
+
"relationType": "derives"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"id": "req-jit--derives--need",
|
|
997
|
+
"sourceId": "req-jit",
|
|
998
|
+
"targetId": "need",
|
|
999
|
+
"relationType": "derives"
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"id": "req-team--derives--need",
|
|
1003
|
+
"sourceId": "req-team",
|
|
1004
|
+
"targetId": "need",
|
|
1005
|
+
"relationType": "derives"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"id": "req-scan-push--derives--need",
|
|
1009
|
+
"sourceId": "req-scan-push",
|
|
1010
|
+
"targetId": "need",
|
|
1011
|
+
"relationType": "derives"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"id": "req-scan-ci--derives--need",
|
|
1015
|
+
"sourceId": "req-scan-ci",
|
|
1016
|
+
"targetId": "need",
|
|
1017
|
+
"relationType": "derives"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"id": "req-scan-scheduled--derives--need",
|
|
1021
|
+
"sourceId": "req-scan-scheduled",
|
|
1022
|
+
"targetId": "need",
|
|
1023
|
+
"relationType": "derives"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
"id": "sc-no-repo--verifies--req-no-repo",
|
|
1027
|
+
"sourceId": "sc-no-repo",
|
|
1028
|
+
"targetId": "req-no-repo",
|
|
1029
|
+
"relationType": "verifies"
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"id": "sc-own--verifies--req-own",
|
|
1033
|
+
"sourceId": "sc-own",
|
|
1034
|
+
"targetId": "req-own",
|
|
1035
|
+
"relationType": "verifies"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"id": "sc-leak--verifies--req-leak",
|
|
1039
|
+
"sourceId": "sc-leak",
|
|
1040
|
+
"targetId": "req-leak",
|
|
1041
|
+
"relationType": "verifies"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"id": "sc-audit--verifies--req-audit",
|
|
1045
|
+
"sourceId": "sc-audit",
|
|
1046
|
+
"targetId": "req-audit",
|
|
1047
|
+
"relationType": "verifies"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"id": "sc-manager--verifies--req-manager",
|
|
1051
|
+
"sourceId": "sc-manager",
|
|
1052
|
+
"targetId": "req-manager",
|
|
1053
|
+
"relationType": "verifies"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"id": "sc-workload--verifies--req-workload",
|
|
1057
|
+
"sourceId": "sc-workload",
|
|
1058
|
+
"targetId": "req-workload",
|
|
1059
|
+
"relationType": "verifies"
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"id": "sc-env--verifies--req-env",
|
|
1063
|
+
"sourceId": "sc-env",
|
|
1064
|
+
"targetId": "req-env",
|
|
1065
|
+
"relationType": "verifies"
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"id": "sc-env-store--verifies--req-env-store",
|
|
1069
|
+
"sourceId": "sc-env-store",
|
|
1070
|
+
"targetId": "req-env-store",
|
|
1071
|
+
"relationType": "verifies"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"id": "sc-rotate-auto--verifies--req-rotate-auto",
|
|
1075
|
+
"sourceId": "sc-rotate-auto",
|
|
1076
|
+
"targetId": "req-rotate-auto",
|
|
1077
|
+
"relationType": "verifies"
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"id": "sc-rotate-runbook--verifies--req-rotate-runbook",
|
|
1081
|
+
"sourceId": "sc-rotate-runbook",
|
|
1082
|
+
"targetId": "req-rotate-runbook",
|
|
1083
|
+
"relationType": "verifies"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"id": "sc-breakglass--verifies--req-breakglass",
|
|
1087
|
+
"sourceId": "sc-breakglass",
|
|
1088
|
+
"targetId": "req-breakglass",
|
|
1089
|
+
"relationType": "verifies"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"id": "sc-jit--verifies--req-jit",
|
|
1093
|
+
"sourceId": "sc-jit",
|
|
1094
|
+
"targetId": "req-jit",
|
|
1095
|
+
"relationType": "verifies"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"id": "sc-team--verifies--req-team",
|
|
1099
|
+
"sourceId": "sc-team",
|
|
1100
|
+
"targetId": "req-team",
|
|
1101
|
+
"relationType": "verifies"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"id": "sc-scan-push--verifies--req-scan-push",
|
|
1105
|
+
"sourceId": "sc-scan-push",
|
|
1106
|
+
"targetId": "req-scan-push",
|
|
1107
|
+
"relationType": "verifies"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
"id": "sc-scan-ci--verifies--req-scan-ci",
|
|
1111
|
+
"sourceId": "sc-scan-ci",
|
|
1112
|
+
"targetId": "req-scan-ci",
|
|
1113
|
+
"relationType": "verifies"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"id": "sc-scan-scheduled--verifies--req-scan-scheduled",
|
|
1117
|
+
"sourceId": "sc-scan-scheduled",
|
|
1118
|
+
"targetId": "req-scan-scheduled",
|
|
1119
|
+
"relationType": "verifies"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"id": "ff-scan-push--implements--adr-manager",
|
|
1123
|
+
"sourceId": "ff-scan-push",
|
|
1124
|
+
"targetId": "adr-manager",
|
|
1125
|
+
"relationType": "implements"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
"id": "ff-scan-push--implements--adr-identity",
|
|
1129
|
+
"sourceId": "ff-scan-push",
|
|
1130
|
+
"targetId": "adr-identity",
|
|
1131
|
+
"relationType": "implements"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"id": "ff-scan-push--implements--adr-env",
|
|
1135
|
+
"sourceId": "ff-scan-push",
|
|
1136
|
+
"targetId": "adr-env",
|
|
1137
|
+
"relationType": "implements"
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"id": "ff-scan-ci--implements--adr-manager",
|
|
1141
|
+
"sourceId": "ff-scan-ci",
|
|
1142
|
+
"targetId": "adr-manager",
|
|
1143
|
+
"relationType": "implements"
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
"id": "ff-scan-ci--implements--adr-identity",
|
|
1147
|
+
"sourceId": "ff-scan-ci",
|
|
1148
|
+
"targetId": "adr-identity",
|
|
1149
|
+
"relationType": "implements"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"id": "ff-scan-ci--implements--adr-env",
|
|
1153
|
+
"sourceId": "ff-scan-ci",
|
|
1154
|
+
"targetId": "adr-env",
|
|
1155
|
+
"relationType": "implements"
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"id": "ff-scan-history--implements--adr-manager",
|
|
1159
|
+
"sourceId": "ff-scan-history",
|
|
1160
|
+
"targetId": "adr-manager",
|
|
1161
|
+
"relationType": "implements"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"id": "ff-scan-history--implements--adr-identity",
|
|
1165
|
+
"sourceId": "ff-scan-history",
|
|
1166
|
+
"targetId": "adr-identity",
|
|
1167
|
+
"relationType": "implements"
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"id": "ff-scan-history--implements--adr-env",
|
|
1171
|
+
"sourceId": "ff-scan-history",
|
|
1172
|
+
"targetId": "adr-env",
|
|
1173
|
+
"relationType": "implements"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"id": "ff-age-manager--implements--adr-manager",
|
|
1177
|
+
"sourceId": "ff-age-manager",
|
|
1178
|
+
"targetId": "adr-manager",
|
|
1179
|
+
"relationType": "implements"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"id": "ff-age-manager--implements--adr-identity",
|
|
1183
|
+
"sourceId": "ff-age-manager",
|
|
1184
|
+
"targetId": "adr-identity",
|
|
1185
|
+
"relationType": "implements"
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"id": "ff-rotation-enabled--implements--adr-manager",
|
|
1189
|
+
"sourceId": "ff-rotation-enabled",
|
|
1190
|
+
"targetId": "adr-manager",
|
|
1191
|
+
"relationType": "implements"
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
"id": "ff-rotation-enabled--implements--adr-identity",
|
|
1195
|
+
"sourceId": "ff-rotation-enabled",
|
|
1196
|
+
"targetId": "adr-identity",
|
|
1197
|
+
"relationType": "implements"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"id": "ff-refresh--implements--adr-manager",
|
|
1201
|
+
"sourceId": "ff-refresh",
|
|
1202
|
+
"targetId": "adr-manager",
|
|
1203
|
+
"relationType": "implements"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
"id": "ff-no-static--implements--adr-identity",
|
|
1207
|
+
"sourceId": "ff-no-static",
|
|
1208
|
+
"targetId": "adr-identity",
|
|
1209
|
+
"relationType": "implements"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"id": "ff-age-env--implements--adr-env",
|
|
1213
|
+
"sourceId": "ff-age-env",
|
|
1214
|
+
"targetId": "adr-env",
|
|
1215
|
+
"relationType": "implements"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
"id": "ff-human-reads--implements--adr-manager",
|
|
1219
|
+
"sourceId": "ff-human-reads",
|
|
1220
|
+
"targetId": "adr-manager",
|
|
1221
|
+
"relationType": "implements"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
"id": "ff-human-reads--implements--adr-identity",
|
|
1225
|
+
"sourceId": "ff-human-reads",
|
|
1226
|
+
"targetId": "adr-identity",
|
|
1227
|
+
"relationType": "implements"
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"id": "ff-human-reads--implements--adr-env",
|
|
1231
|
+
"sourceId": "ff-human-reads",
|
|
1232
|
+
"targetId": "adr-env",
|
|
1233
|
+
"relationType": "implements"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"id": "ff-read-log--implements--adr-manager",
|
|
1237
|
+
"sourceId": "ff-read-log",
|
|
1238
|
+
"targetId": "adr-manager",
|
|
1239
|
+
"relationType": "implements"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
"id": "ff-read-log--implements--adr-identity",
|
|
1243
|
+
"sourceId": "ff-read-log",
|
|
1244
|
+
"targetId": "adr-identity",
|
|
1245
|
+
"relationType": "implements"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"id": "ff-read-log--implements--adr-env",
|
|
1249
|
+
"sourceId": "ff-read-log",
|
|
1250
|
+
"targetId": "adr-env",
|
|
1251
|
+
"relationType": "implements"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"id": "ff-own-manager--implements--adr-manager",
|
|
1255
|
+
"sourceId": "ff-own-manager",
|
|
1256
|
+
"targetId": "adr-manager",
|
|
1257
|
+
"relationType": "implements"
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
"id": "ff-own-manager--implements--adr-identity",
|
|
1261
|
+
"sourceId": "ff-own-manager",
|
|
1262
|
+
"targetId": "adr-identity",
|
|
1263
|
+
"relationType": "implements"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
"id": "ff-own-env--implements--adr-env",
|
|
1267
|
+
"sourceId": "ff-own-env",
|
|
1268
|
+
"targetId": "adr-env",
|
|
1269
|
+
"relationType": "implements"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"id": "ff-env-masked--implements--adr-env",
|
|
1273
|
+
"sourceId": "ff-env-masked",
|
|
1274
|
+
"targetId": "adr-env",
|
|
1275
|
+
"relationType": "implements"
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
"id": "ff-env-encrypted--implements--adr-env",
|
|
1279
|
+
"sourceId": "ff-env-encrypted",
|
|
1280
|
+
"targetId": "adr-env",
|
|
1281
|
+
"relationType": "implements"
|
|
1282
|
+
}
|
|
1283
|
+
]
|
|
1284
|
+
}
|