@radicaltools/mcp 0.2.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.
Files changed (159) hide show
  1. package/README.md +41 -23
  2. package/dist/{chunk-OGN3UW2D.js → chunk-Z7THA3L5.js} +670 -64
  3. package/dist/{elkLayout-S62RLGTO.js → elkLayout-TAUBPPVN.js} +1 -1
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +935 -0
  5. package/dist/hub-catalogue/concern/concern-architecture-style.radical +1112 -0
  6. package/dist/hub-catalogue/concern/concern-authentication.radical +685 -0
  7. package/dist/hub-catalogue/concern/concern-authorization.radical +1464 -0
  8. package/dist/hub-catalogue/concern/concern-availability.radical +804 -0
  9. package/dist/hub-catalogue/concern/concern-backend-stack.radical +1118 -0
  10. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1304 -0
  11. package/dist/hub-catalogue/concern/concern-capacity.radical +802 -0
  12. package/dist/hub-catalogue/concern/concern-communication-style.radical +1202 -0
  13. package/dist/hub-catalogue/concern/concern-data-consistency.radical +1081 -0
  14. package/dist/hub-catalogue/concern/concern-data-store.radical +960 -0
  15. package/dist/hub-catalogue/concern/concern-decomposition.radical +1143 -0
  16. package/dist/hub-catalogue/concern/concern-deployment.radical +952 -0
  17. package/dist/hub-catalogue/concern/concern-encryption.radical +1055 -0
  18. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1340 -0
  19. package/dist/hub-catalogue/concern/concern-infrastructure.radical +1151 -0
  20. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1079 -0
  21. package/dist/hub-catalogue/concern/concern-messaging.radical +940 -0
  22. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +864 -0
  23. package/dist/hub-catalogue/concern/concern-observability.radical +1048 -0
  24. package/dist/hub-catalogue/concern/concern-personal-data.radical +1434 -0
  25. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1153 -0
  26. package/dist/hub-catalogue/concern/concern-secrets.radical +1026 -0
  27. package/dist/hub-catalogue/concern/concern-supply-chain.radical +1312 -0
  28. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1306 -0
  29. package/dist/hub-catalogue/concern/concern-test-strategy.radical +1193 -0
  30. package/dist/index.js +9440 -3854
  31. package/package.json +1 -1
  32. package/dist/hub-catalogue/adr/adr-api-versioning.radical +0 -53
  33. package/dist/hub-catalogue/adr/adr-auth-strategy.radical +0 -53
  34. package/dist/hub-catalogue/adr/adr-caching-strategy.radical +0 -59
  35. package/dist/hub-catalogue/adr/adr-data-consistency-model.radical +0 -40
  36. package/dist/hub-catalogue/adr/adr-data-store.radical +0 -47
  37. package/dist/hub-catalogue/adr/adr-deployment-strategy.radical +0 -53
  38. package/dist/hub-catalogue/adr/adr-event-schema-evolution.radical +0 -53
  39. package/dist/hub-catalogue/adr/adr-integration-style.radical +0 -50
  40. package/dist/hub-catalogue/adr/adr-ledger-reconciliation-strategy.radical +0 -38
  41. package/dist/hub-catalogue/adr/adr-llm-provider-strategy.radical +0 -40
  42. package/dist/hub-catalogue/adr/adr-marketplace-payments-model.radical +0 -39
  43. package/dist/hub-catalogue/adr/adr-multi-region.radical +0 -60
  44. package/dist/hub-catalogue/adr/adr-multi-tenancy-strategy.radical +0 -41
  45. package/dist/hub-catalogue/adr/adr-observability.radical +0 -59
  46. package/dist/hub-catalogue/adr/adr-realtime-transport.radical +0 -38
  47. package/dist/hub-catalogue/adr/adr-tech-stack.radical +0 -45
  48. package/dist/hub-catalogue/adr/adr-zero-trust-network.radical +0 -40
  49. package/dist/hub-catalogue/blueprint/bp-ai-assistant-platform.radical +0 -1641
  50. package/dist/hub-catalogue/blueprint/bp-analytical-data-platform.radical +0 -1428
  51. package/dist/hub-catalogue/blueprint/bp-ecommerce-platform.radical +0 -1989
  52. package/dist/hub-catalogue/blueprint/bp-fintech-ledger-platform.radical +0 -1701
  53. package/dist/hub-catalogue/blueprint/bp-marketplace-platform.radical +0 -1792
  54. package/dist/hub-catalogue/blueprint/bp-realtime-collaboration.radical +0 -1421
  55. package/dist/hub-catalogue/blueprint/bp-saas-b2b-platform.radical +0 -1713
  56. package/dist/hub-catalogue/fitness-function/ff-accessibility-scan.radical +0 -34
  57. package/dist/hub-catalogue/fitness-function/ff-ai-eval-gate.radical +0 -52
  58. package/dist/hub-catalogue/fitness-function/ff-api-contract.radical +0 -36
  59. package/dist/hub-catalogue/fitness-function/ff-capacity-load-test.radical +0 -67
  60. package/dist/hub-catalogue/fitness-function/ff-carbon-footprint-guard.radical +0 -62
  61. package/dist/hub-catalogue/fitness-function/ff-change-failure-rate.radical +0 -45
  62. package/dist/hub-catalogue/fitness-function/ff-chaos-resilience-test.radical +0 -53
  63. package/dist/hub-catalogue/fitness-function/ff-cost-efficiency-guard.radical +0 -64
  64. package/dist/hub-catalogue/fitness-function/ff-coupling-guard.radical +0 -45
  65. package/dist/hub-catalogue/fitness-function/ff-data-integrity-check.radical +0 -51
  66. package/dist/hub-catalogue/fitness-function/ff-data-residency.radical +0 -43
  67. package/dist/hub-catalogue/fitness-function/ff-dependency-rules.radical +0 -37
  68. package/dist/hub-catalogue/fitness-function/ff-deploy-frequency.radical +0 -46
  69. package/dist/hub-catalogue/fitness-function/ff-dr-drill-success.radical +0 -52
  70. package/dist/hub-catalogue/fitness-function/ff-duplication-guard.radical +0 -53
  71. package/dist/hub-catalogue/fitness-function/ff-error-budget.radical +0 -59
  72. package/dist/hub-catalogue/fitness-function/ff-fail-safe-verification.radical +0 -34
  73. package/dist/hub-catalogue/fitness-function/ff-infra-drift.radical +0 -34
  74. package/dist/hub-catalogue/fitness-function/ff-latency-slo.radical +0 -59
  75. package/dist/hub-catalogue/fitness-function/ff-lead-time.radical +0 -44
  76. package/dist/hub-catalogue/fitness-function/ff-ledger-balance-integrity.radical +0 -45
  77. package/dist/hub-catalogue/fitness-function/ff-license-compliance.radical +0 -43
  78. package/dist/hub-catalogue/fitness-function/ff-mttr.radical +0 -45
  79. package/dist/hub-catalogue/fitness-function/ff-noisy-neighbor-guard.radical +0 -66
  80. package/dist/hub-catalogue/fitness-function/ff-sast-scan.radical +0 -35
  81. package/dist/hub-catalogue/fitness-function/ff-scale-out-verification.radical +0 -66
  82. package/dist/hub-catalogue/fitness-function/ff-security-scan.radical +0 -45
  83. package/dist/hub-catalogue/fitness-function/ff-startup-shutdown-check.radical +0 -66
  84. package/dist/hub-catalogue/fitness-function/ff-sync-convergence-test.radical +0 -45
  85. package/dist/hub-catalogue/fitness-function/ff-test-coverage.radical +0 -43
  86. package/dist/hub-catalogue/fitness-function/ff-web-vitals.radical +0 -57
  87. package/dist/hub-catalogue/pattern/pattern-anti-corruption-layer.radical +0 -88
  88. package/dist/hub-catalogue/pattern/pattern-api-gateway.radical +0 -168
  89. package/dist/hub-catalogue/pattern/pattern-bff.radical +0 -179
  90. package/dist/hub-catalogue/pattern/pattern-bulkhead.radical +0 -114
  91. package/dist/hub-catalogue/pattern/pattern-circuit-breaker.radical +0 -219
  92. package/dist/hub-catalogue/pattern/pattern-cqrs.radical +0 -195
  93. package/dist/hub-catalogue/pattern/pattern-crdt-sync.radical +0 -200
  94. package/dist/hub-catalogue/pattern/pattern-event-driven.radical +0 -210
  95. package/dist/hub-catalogue/pattern/pattern-event-sourced-ledger.radical +0 -211
  96. package/dist/hub-catalogue/pattern/pattern-hexagonal.radical +0 -196
  97. package/dist/hub-catalogue/pattern/pattern-microservices.radical +0 -262
  98. package/dist/hub-catalogue/pattern/pattern-rag-pipeline.radical +0 -213
  99. package/dist/hub-catalogue/pattern/pattern-rate-limiter.radical +0 -114
  100. package/dist/hub-catalogue/pattern/pattern-saga.radical +0 -208
  101. package/dist/hub-catalogue/pattern/pattern-sidecar.radical +0 -123
  102. package/dist/hub-catalogue/pattern/pattern-strangler-fig.radical +0 -227
  103. package/dist/hub-catalogue/pattern/pattern-transactional-outbox.radical +0 -209
  104. package/dist/hub-catalogue/requirement/req-accessibility.radical +0 -48
  105. package/dist/hub-catalogue/requirement/req-ai-autonomous-resolution.radical +0 -51
  106. package/dist/hub-catalogue/requirement/req-ai-groundedness.radical +0 -45
  107. package/dist/hub-catalogue/requirement/req-ai-human-handoff.radical +0 -46
  108. package/dist/hub-catalogue/requirement/req-alerting.radical +0 -52
  109. package/dist/hub-catalogue/requirement/req-api-response-time.radical +0 -51
  110. package/dist/hub-catalogue/requirement/req-api-standard.radical +0 -45
  111. package/dist/hub-catalogue/requirement/req-audit-logging.radical +0 -43
  112. package/dist/hub-catalogue/requirement/req-auth-response-time.radical +0 -45
  113. package/dist/hub-catalogue/requirement/req-auth.radical +0 -43
  114. package/dist/hub-catalogue/requirement/req-autoscaling.radical +0 -62
  115. package/dist/hub-catalogue/requirement/req-availability.radical +0 -50
  116. package/dist/hub-catalogue/requirement/req-backward-compatibility.radical +0 -46
  117. package/dist/hub-catalogue/requirement/req-batch-job-completion.radical +0 -50
  118. package/dist/hub-catalogue/requirement/req-carbon-efficiency.radical +0 -64
  119. package/dist/hub-catalogue/requirement/req-centralised-logging.radical +0 -45
  120. package/dist/hub-catalogue/requirement/req-ci-pipeline-time.radical +0 -43
  121. package/dist/hub-catalogue/requirement/req-code-complexity.radical +0 -43
  122. package/dist/hub-catalogue/requirement/req-config-propagation.radical +0 -45
  123. package/dist/hub-catalogue/requirement/req-data-integrity.radical +0 -35
  124. package/dist/hub-catalogue/requirement/req-data-retention.radical +0 -44
  125. package/dist/hub-catalogue/requirement/req-db-query-response.radical +0 -44
  126. package/dist/hub-catalogue/requirement/req-disaster-recovery.radical +0 -59
  127. package/dist/hub-catalogue/requirement/req-distributed-tracing.radical +0 -45
  128. package/dist/hub-catalogue/requirement/req-encryption.radical +0 -49
  129. package/dist/hub-catalogue/requirement/req-error-rate.radical +0 -45
  130. package/dist/hub-catalogue/requirement/req-error-recovery.radical +0 -34
  131. package/dist/hub-catalogue/requirement/req-event-schema-compatibility.radical +0 -37
  132. package/dist/hub-catalogue/requirement/req-fail-safe-default.radical +0 -55
  133. package/dist/hub-catalogue/requirement/req-fast-startup-graceful-shutdown.radical +0 -69
  134. package/dist/hub-catalogue/requirement/req-gdpr-erasure.radical +0 -44
  135. package/dist/hub-catalogue/requirement/req-graceful-degradation.radical +0 -39
  136. package/dist/hub-catalogue/requirement/req-health-checks.radical +0 -43
  137. package/dist/hub-catalogue/requirement/req-iac.radical +0 -36
  138. package/dist/hub-catalogue/requirement/req-idempotency.radical +0 -47
  139. package/dist/hub-catalogue/requirement/req-input-validation.radical +0 -37
  140. package/dist/hub-catalogue/requirement/req-least-privilege.radical +0 -47
  141. package/dist/hub-catalogue/requirement/req-ledger-immutability.radical +0 -38
  142. package/dist/hub-catalogue/requirement/req-mfa.radical +0 -36
  143. package/dist/hub-catalogue/requirement/req-ml-extraction-accuracy.radical +0 -42
  144. package/dist/hub-catalogue/requirement/req-onboarding-time.radical +0 -42
  145. package/dist/hub-catalogue/requirement/req-page-load-time.radical +0 -59
  146. package/dist/hub-catalogue/requirement/req-payout-latency.radical +0 -46
  147. package/dist/hub-catalogue/requirement/req-presence-latency.radical +0 -46
  148. package/dist/hub-catalogue/requirement/req-rate-limiting.radical +0 -45
  149. package/dist/hub-catalogue/requirement/req-report-generation.radical +0 -44
  150. package/dist/hub-catalogue/requirement/req-resource-efficiency.radical +0 -64
  151. package/dist/hub-catalogue/requirement/req-resource-headroom.radical +0 -53
  152. package/dist/hub-catalogue/requirement/req-resource-isolation.radical +0 -37
  153. package/dist/hub-catalogue/requirement/req-search-response-time.radical +0 -44
  154. package/dist/hub-catalogue/requirement/req-secrets-management.radical +0 -45
  155. package/dist/hub-catalogue/requirement/req-task-success-rate.radical +0 -42
  156. package/dist/hub-catalogue/requirement/req-test-coverage.radical +0 -42
  157. package/dist/hub-catalogue/requirement/req-throughput.radical +0 -55
  158. package/dist/hub-catalogue/requirement/req-vulnerability-scanning.radical +0 -52
  159. package/dist/hub-catalogue/requirement/req-zero-downtime-deploy.radical +0 -39
@@ -0,0 +1,1026 @@
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 change only with a redeploy."
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."
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) 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 load each one at run time from {{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
+ },
192
+ {
193
+ "id": "req-audit",
194
+ "type": "requirement",
195
+ "label": "Secret access audited",
196
+ "x": 260,
197
+ "y": 390,
198
+ "ears_type": "ubiquitous",
199
+ "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",
200
+ "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)."
201
+ },
202
+ {
203
+ "id": "req-manager",
204
+ "type": "requirement",
205
+ "label": "Read from the manager",
206
+ "x": 260,
207
+ "y": 520,
208
+ "ears_type": "event-driven",
209
+ "trigger": "the element starts or its credential lease is about to expire",
210
+ "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",
211
+ "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).",
212
+ "hubWhen": {
213
+ "STORE": [
214
+ "manager"
215
+ ]
216
+ }
217
+ },
218
+ {
219
+ "id": "req-workload",
220
+ "type": "requirement",
221
+ "label": "Short-lived credentials",
222
+ "x": 260,
223
+ "y": 650,
224
+ "ears_type": "ubiquitous",
225
+ "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",
226
+ "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).",
227
+ "hubWhen": {
228
+ "STORE": [
229
+ "identity"
230
+ ]
231
+ }
232
+ },
233
+ {
234
+ "id": "req-env",
235
+ "type": "requirement",
236
+ "label": "Variables never shown",
237
+ "x": 260,
238
+ "y": 780,
239
+ "ears_type": "unwanted-behaviour",
240
+ "unwanted_condition": "the element logs its configuration, fails with a crash report or serves a diagnostic endpoint",
241
+ "action": "leave out or mask every variable that holds a credential, and keep the values encrypted at rest in the deployment's store",
242
+ "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).",
243
+ "hubWhen": {
244
+ "STORE": [
245
+ "env"
246
+ ]
247
+ }
248
+ },
249
+ {
250
+ "id": "req-rotate-auto",
251
+ "type": "requirement",
252
+ "label": "Rotation is automatic",
253
+ "x": 260,
254
+ "y": 910,
255
+ "ears_type": "event-driven",
256
+ "trigger": "a stored credential is {{ROTATE_DAYS}} days old",
257
+ "action": "create its successor, switch every instance to it, and revoke the old one only when nothing uses it, with 0 failed requests",
258
+ "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).",
259
+ "hubWhen": {
260
+ "ROTATION": [
261
+ "automatic"
262
+ ]
263
+ }
264
+ },
265
+ {
266
+ "id": "req-rotate-runbook",
267
+ "type": "requirement",
268
+ "label": "Overdue rotation alerted",
269
+ "x": 260,
270
+ "y": 1040,
271
+ "ears_type": "state-driven",
272
+ "precondition": "a stored credential is older than {{ROTATE_DAYS}} days",
273
+ "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",
274
+ "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).",
275
+ "hubWhen": {
276
+ "ROTATION": [
277
+ "runbook"
278
+ ]
279
+ }
280
+ },
281
+ {
282
+ "id": "req-breakglass",
283
+ "type": "requirement",
284
+ "label": "People read via break-glass",
285
+ "x": 260,
286
+ "y": 1170,
287
+ "ears_type": "unwanted-behaviour",
288
+ "unwanted_condition": "a person needs to read a production secret",
289
+ "action": "allow it only through the break-glass procedure, after a second person approves, alert the security channel within 5 minutes, and rotate the secret within 24 hours",
290
+ "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).",
291
+ "hubWhen": {
292
+ "ACCESS": [
293
+ "breakglass"
294
+ ]
295
+ }
296
+ },
297
+ {
298
+ "id": "req-jit",
299
+ "type": "requirement",
300
+ "label": "Access granted just in time",
301
+ "x": 260,
302
+ "y": 1300,
303
+ "ears_type": "event-driven",
304
+ "trigger": "an on-call engineer requests read access to a production secret",
305
+ "action": "grant access to that one secret for at most 4 hours after a second person approves, and withdraw it automatically when the time is up",
306
+ "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).",
307
+ "hubWhen": {
308
+ "ACCESS": [
309
+ "jit"
310
+ ]
311
+ }
312
+ },
313
+ {
314
+ "id": "req-team",
315
+ "type": "requirement",
316
+ "label": "Rotated when people leave",
317
+ "x": 260,
318
+ "y": 1430,
319
+ "ears_type": "event-driven",
320
+ "trigger": "a person who could read the element's production secrets leaves the team",
321
+ "action": "withdraw their access the same day and rotate every secret they could read within 7 days",
322
+ "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).",
323
+ "hubWhen": {
324
+ "ACCESS": [
325
+ "team"
326
+ ]
327
+ }
328
+ },
329
+ {
330
+ "id": "req-scan-push",
331
+ "type": "requirement",
332
+ "label": "Secrets refused at push",
333
+ "x": 260,
334
+ "y": 1560,
335
+ "ears_type": "unwanted-behaviour",
336
+ "unwanted_condition": "a push to the code host contains a credential",
337
+ "action": "refuse the push and name the file and line, and record any bypass with its reason for review within 1 working day",
338
+ "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).",
339
+ "hubWhen": {
340
+ "SCANNING": [
341
+ "push"
342
+ ]
343
+ }
344
+ },
345
+ {
346
+ "id": "req-scan-ci",
347
+ "type": "requirement",
348
+ "label": "Secrets block the merge",
349
+ "x": 260,
350
+ "y": 1690,
351
+ "ears_type": "unwanted-behaviour",
352
+ "unwanted_condition": "a pull request adds a credential in any of its commits",
353
+ "action": "fail its required check so that it cannot merge, and treat the credential as exposed",
354
+ "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).",
355
+ "hubWhen": {
356
+ "SCANNING": [
357
+ "ci"
358
+ ]
359
+ }
360
+ },
361
+ {
362
+ "id": "req-scan-scheduled",
363
+ "type": "requirement",
364
+ "label": "Leaks found within a day",
365
+ "x": 260,
366
+ "y": 1820,
367
+ "ears_type": "event-driven",
368
+ "trigger": "a credential is committed, built into an image or written to a CI log",
369
+ "action": "report it to the element's owner within 24 hours, and have it revoked or marked as a false positive within 1 working day of the report",
370
+ "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).",
371
+ "hubWhen": {
372
+ "SCANNING": [
373
+ "scheduled"
374
+ ]
375
+ }
376
+ },
377
+ {
378
+ "id": "sc-no-repo",
379
+ "type": "scenario",
380
+ "label": "Repository clean",
381
+ "x": 520,
382
+ "y": 0,
383
+ "given": "the repository with its full history, the built images and the last 30 days of CI logs",
384
+ "when": "they are scanned with the secret scanner",
385
+ "then": "0 secrets are found outside the scanner's allow-list of test fixtures"
386
+ },
387
+ {
388
+ "id": "sc-own",
389
+ "type": "scenario",
390
+ "label": "Narrow rights",
391
+ "x": 520,
392
+ "y": 130,
393
+ "given": "the element's production database credential",
394
+ "when": "it is used to read a table the element does not use, and to connect to the staging database",
395
+ "then": "both are refused"
396
+ },
397
+ {
398
+ "id": "sc-leak",
399
+ "type": "scenario",
400
+ "label": "Leaked key revoked",
401
+ "x": 520,
402
+ "y": 260,
403
+ "given": "a production credential reported as pasted in a public place",
404
+ "when": "the leak runbook is followed",
405
+ "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"
406
+ },
407
+ {
408
+ "id": "sc-audit",
409
+ "type": "scenario",
410
+ "label": "Read leaves a record",
411
+ "x": 520,
412
+ "y": 390,
413
+ "given": "a production secret",
414
+ "when": "a person reads it and changes it",
415
+ "then": "the audit log holds both events with person, time, secret name and approval, and not the value"
416
+ },
417
+ {
418
+ "id": "sc-manager",
419
+ "type": "scenario",
420
+ "label": "Credential refreshed",
421
+ "x": 520,
422
+ "y": 520,
423
+ "given": "a running element whose database credential is replaced in the secrets manager",
424
+ "when": "its lease expires",
425
+ "then": "the element uses the new credential with no restart and no failed request, and nothing on its disk holds either value",
426
+ "hubWhen": {
427
+ "STORE": [
428
+ "manager"
429
+ ]
430
+ }
431
+ },
432
+ {
433
+ "id": "sc-workload",
434
+ "type": "scenario",
435
+ "label": "No stored secret",
436
+ "x": 520,
437
+ "y": 650,
438
+ "given": "the element's deployment manifests and running configuration",
439
+ "when": "they are listed",
440
+ "then": "they hold no password or key, only the identity, and the tokens it uses expire within 1 hour",
441
+ "hubWhen": {
442
+ "STORE": [
443
+ "identity"
444
+ ]
445
+ }
446
+ },
447
+ {
448
+ "id": "sc-env",
449
+ "type": "scenario",
450
+ "label": "Crash hides secrets",
451
+ "x": 520,
452
+ "y": 780,
453
+ "given": "the element running with its database password in an environment variable",
454
+ "when": "it crashes and its configuration endpoint is called",
455
+ "then": "neither the crash report nor the endpoint shows the password",
456
+ "hubWhen": {
457
+ "STORE": [
458
+ "env"
459
+ ]
460
+ }
461
+ },
462
+ {
463
+ "id": "sc-rotate-auto",
464
+ "type": "scenario",
465
+ "label": "Rotation without downtime",
466
+ "x": 520,
467
+ "y": 910,
468
+ "given": "a credential {{ROTATE_DAYS}} days old and traffic flowing",
469
+ "when": "the store rotates it",
470
+ "then": "no request fails and the old credential is refused afterwards",
471
+ "hubWhen": {
472
+ "ROTATION": [
473
+ "automatic"
474
+ ]
475
+ }
476
+ },
477
+ {
478
+ "id": "sc-rotate-runbook",
479
+ "type": "scenario",
480
+ "label": "Overdue key alerted",
481
+ "x": 520,
482
+ "y": 1040,
483
+ "given": "a partner API key created {{ROTATE_DAYS}} days ago",
484
+ "when": "the daily check runs",
485
+ "then": "the owner is alerted, and the alert stops once the key is replaced by following the runbook",
486
+ "hubWhen": {
487
+ "ROTATION": [
488
+ "runbook"
489
+ ]
490
+ }
491
+ },
492
+ {
493
+ "id": "sc-breakglass",
494
+ "type": "scenario",
495
+ "label": "Emergency read",
496
+ "x": 520,
497
+ "y": 1170,
498
+ "given": "an engineer without access to production secrets",
499
+ "when": "they read one through break-glass with a second person's approval",
500
+ "then": "the security channel is alerted within 5 minutes and the secret is rotated within 24 hours",
501
+ "hubWhen": {
502
+ "ACCESS": [
503
+ "breakglass"
504
+ ]
505
+ }
506
+ },
507
+ {
508
+ "id": "sc-jit",
509
+ "type": "scenario",
510
+ "label": "Access expires",
511
+ "x": 520,
512
+ "y": 1300,
513
+ "given": "an on-call engineer granted read access to one secret",
514
+ "when": "4 hours have passed",
515
+ "then": "the engineer can no longer read it, and could never read any other secret",
516
+ "hubWhen": {
517
+ "ACCESS": [
518
+ "jit"
519
+ ]
520
+ }
521
+ },
522
+ {
523
+ "id": "sc-team",
524
+ "type": "scenario",
525
+ "label": "Departure rotates",
526
+ "x": 520,
527
+ "y": 1430,
528
+ "given": "a team member who could read three production secrets",
529
+ "when": "they leave the team",
530
+ "then": "their access is gone that day and all three secrets are replaced within 7 days",
531
+ "hubWhen": {
532
+ "ACCESS": [
533
+ "team"
534
+ ]
535
+ }
536
+ },
537
+ {
538
+ "id": "sc-scan-push",
539
+ "type": "scenario",
540
+ "label": "Push refused",
541
+ "x": 520,
542
+ "y": 1560,
543
+ "given": "a commit that adds a cloud access key to a configuration file",
544
+ "when": "it is pushed",
545
+ "then": "the code host refuses it and names the file and line",
546
+ "hubWhen": {
547
+ "SCANNING": [
548
+ "push"
549
+ ]
550
+ }
551
+ },
552
+ {
553
+ "id": "sc-scan-ci",
554
+ "type": "scenario",
555
+ "label": "Merge blocked",
556
+ "x": 520,
557
+ "y": 1690,
558
+ "given": "a pull request whose second commit adds a database password and whose third removes it",
559
+ "when": "its checks run",
560
+ "then": "the secret check fails and the pull request cannot merge",
561
+ "hubWhen": {
562
+ "SCANNING": [
563
+ "ci"
564
+ ]
565
+ }
566
+ },
567
+ {
568
+ "id": "sc-scan-scheduled",
569
+ "type": "scenario",
570
+ "label": "Nightly scan reports",
571
+ "x": 520,
572
+ "y": 1820,
573
+ "given": "a credential committed to a branch during the day",
574
+ "when": "the nightly scan runs",
575
+ "then": "the owner has a finding by the next morning naming the commit and file",
576
+ "hubWhen": {
577
+ "SCANNING": [
578
+ "scheduled"
579
+ ]
580
+ }
581
+ },
582
+ {
583
+ "id": "adr-manager",
584
+ "type": "adr",
585
+ "label": "Credentials in a secrets manager",
586
+ "x": 780,
587
+ "y": 0,
588
+ "concern": "secrets",
589
+ "status": "accepted",
590
+ "date": "",
591
+ "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.",
592
+ "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.",
593
+ "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.",
594
+ "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.",
595
+ "hubWhen": {
596
+ "STORE": [
597
+ "manager"
598
+ ]
599
+ }
600
+ },
601
+ {
602
+ "id": "adr-identity",
603
+ "type": "adr",
604
+ "label": "Workload identity, no stored secrets",
605
+ "x": 780,
606
+ "y": 130,
607
+ "concern": "secrets",
608
+ "status": "accepted",
609
+ "date": "",
610
+ "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.",
611
+ "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, rotation: {{ROTATION}}, at least every {{ROTATE_DAYS}} days. Exposed keys stop working within {{REVOKE_MINUTES}} minutes. Production secrets may be read by {{ACCESS}}. Leaked credentials are caught {{SCANNING}}.",
612
+ "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.",
613
+ "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.",
614
+ "hubWhen": {
615
+ "STORE": [
616
+ "identity"
617
+ ]
618
+ }
619
+ },
620
+ {
621
+ "id": "adr-env",
622
+ "type": "adr",
623
+ "label": "Credentials in the deployment",
624
+ "x": 780,
625
+ "y": 260,
626
+ "concern": "secrets",
627
+ "status": "accepted",
628
+ "date": "",
629
+ "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.",
630
+ "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; 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.",
631
+ "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.",
632
+ "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.",
633
+ "hubWhen": {
634
+ "STORE": [
635
+ "env"
636
+ ]
637
+ }
638
+ },
639
+ {
640
+ "id": "ff-scan-push",
641
+ "type": "fitness-fn",
642
+ "label": "Push protection on",
643
+ "x": 1040,
644
+ "y": 0,
645
+ "category": "process",
646
+ "threshold": "100 % of the organisation's repositories have secret scanning and push protection enabled; 0 bypasses older than 1 working day without review",
647
+ "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; bypasses are reviewed from the secret scanning alerts.\n\nTool: GitHub secret scanning push protection, checked with the GitHub CLI\n\n```bash\n# fails when a repository has secret scanning or push protection off\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 || { cat unprotected.txt; exit 1; }\n```",
648
+ "hubWhen": {
649
+ "SCANNING": [
650
+ "push"
651
+ ]
652
+ }
653
+ },
654
+ {
655
+ "id": "ff-scan-ci",
656
+ "type": "fitness-fn",
657
+ "label": "Secret scan in CI",
658
+ "x": 1040,
659
+ "y": 130,
660
+ "category": "structural",
661
+ "threshold": "0 secrets found in the commits of a pull request; the check is required for merging",
662
+ "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\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\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.18.4 \\\n git /repo --log-opts=\"origin/${{ github.base_ref }}..HEAD\" --redact --exit-code 1\n```",
663
+ "hubWhen": {
664
+ "SCANNING": [
665
+ "push",
666
+ "ci"
667
+ ]
668
+ }
669
+ },
670
+ {
671
+ "id": "ff-scan-history",
672
+ "type": "fitness-fn",
673
+ "label": "Nightly history scan",
674
+ "x": 1040,
675
+ "y": 260,
676
+ "category": "process",
677
+ "threshold": "0 open findings older than 1 working day across history, images and CI logs",
678
+ "description": "A nightly job scans the full git history with Gitleaks and the latest built images with TruffleHog, and files each finding to the owner; the job fails while a finding stays open past its deadline.\n\nTool: Gitleaks and TruffleHog\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\n with: { fetch-depth: 0 }\n - run: docker run --rm -v \"$PWD:/repo\" zricethezav/gitleaks:v8.18.4 git /repo --redact --report-format sarif --report-path /repo/gitleaks.sarif --exit-code 0\n - run: docker run --rm trufflesecurity/trufflehog:3.63.0 docker --image \"$IMAGE\" --only-verified --fail\n - uses: github/codeql-action/upload-sarif@v3\n with: { sarif_file: gitleaks.sarif }\n```",
679
+ "hubWhen": {
680
+ "SCANNING": [
681
+ "scheduled"
682
+ ]
683
+ }
684
+ },
685
+ {
686
+ "id": "ff-age-manager",
687
+ "type": "fitness-fn",
688
+ "label": "Rotation is on",
689
+ "x": 1040,
690
+ "y": 390,
691
+ "category": "operational",
692
+ "threshold": "0 secrets in the secrets manager without rotation, or not rotated within {{ROTATE_DAYS}} days",
693
+ "description": "AWS Config evaluates every secret in AWS Secrets Manager against the managed rules and reports one that has no rotation or has not been rotated in time. On Vault or Key Vault, a scheduled job reads the secrets' metadata and checks the same.\n\nTool: AWS Config managed rules (secretsmanager-rotation-enabled-check, secretsmanager-secret-periodic-rotation)\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\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```",
694
+ "hubWhen": {
695
+ "STORE": [
696
+ "manager",
697
+ "identity"
698
+ ]
699
+ }
700
+ },
701
+ {
702
+ "id": "ff-no-static",
703
+ "type": "fitness-fn",
704
+ "label": "No stored database secrets",
705
+ "x": 1040,
706
+ "y": 520,
707
+ "category": "structural",
708
+ "threshold": "0 workloads that take a credential from a Kubernetes Secret, outside the allow-list of outside-system keys",
709
+ "description": "A Conftest policy over the rendered manifests fails when a workload reads an environment variable or volume from a Secret that is not on the allow-list, which would mean a stored credential came back.\n\nTool: Conftest (Open Policy Agent)\n\n```rego\npackage main\n\nimport rego.v1\n\nallowed := {\"partner-api-key\"}\n\ndeny contains msg if {\n input.kind == \"Deployment\"\n some c in input.spec.template.spec.containers\n some e in c.env\n name := e.valueFrom.secretKeyRef.name\n not allowed[name]\n msg := sprintf(\"%s reads secret %s: use the workload identity\", [input.metadata.name, name])\n}\n```",
710
+ "hubWhen": {
711
+ "STORE": [
712
+ "identity"
713
+ ]
714
+ }
715
+ },
716
+ {
717
+ "id": "ff-age-env",
718
+ "type": "fitness-fn",
719
+ "label": "Deployment secrets age",
720
+ "x": 1040,
721
+ "y": 650,
722
+ "category": "operational",
723
+ "threshold": "0 Secrets in production namespaces older than {{ROTATE_DAYS}} days",
724
+ "description": "A scheduled job lists the Kubernetes Secrets the elements read and fails on any created more than {{ROTATE_DAYS}} days ago, which means it was not rotated.\n\nTool: kubectl and jq\n\n```bash\nmax_age=$(( {{ROTATE_DAYS}} * 86400 ))\nkubectl get secrets -n production -l app.kubernetes.io/part-of=shop -o json \\\n | jq -r --argjson max \"$max_age\" '.items[]\n | select((now - (.metadata.creationTimestamp | fromdateiso8601)) > $max)\n | .metadata.name' > stale.txt\ntest ! -s stale.txt || { echo \"Secrets past rotation:\"; cat stale.txt; exit 1; }\n```",
725
+ "hubWhen": {
726
+ "STORE": [
727
+ "env"
728
+ ]
729
+ }
730
+ },
731
+ {
732
+ "id": "ff-human-reads",
733
+ "type": "fitness-fn",
734
+ "label": "Human reads alerted",
735
+ "x": 1040,
736
+ "y": 780,
737
+ "category": "operational",
738
+ "threshold": "100 % of reads of a production secret by a person raise an alert within 5 minutes; 0 reads without an approval record",
739
+ "description": "An EventBridge rule matches reads of secrets in AWS Secrets Manager by anything other than the workloads' roles and sends them to the security channel, where each is matched with its approval. On Vault, the audit device feeds the same alert.\n\nTool: AWS CloudTrail with an Amazon EventBridge rule\n\n```json\n{\n \"source\": [\"aws.secretsmanager\"],\n \"detail-type\": [\"AWS API Call via CloudTrail\"],\n \"detail\": {\n \"eventName\": [\"GetSecretValue\"],\n \"userIdentity\": {\n \"sessionContext\": {\n \"sessionIssuer\": {\n \"userName\": [{ \"anything-but\": { \"prefix\": \"workload-\" } }]\n }\n }\n }\n }\n}\n```",
740
+ "hubWhen": {
741
+ "ACCESS": [
742
+ "breakglass",
743
+ "jit"
744
+ ]
745
+ }
746
+ }
747
+ ],
748
+ "relations": [
749
+ {
750
+ "id": "req-no-repo--derives--need",
751
+ "sourceId": "req-no-repo",
752
+ "targetId": "need",
753
+ "relationType": "derives"
754
+ },
755
+ {
756
+ "id": "req-own--derives--need",
757
+ "sourceId": "req-own",
758
+ "targetId": "need",
759
+ "relationType": "derives"
760
+ },
761
+ {
762
+ "id": "req-leak--derives--need",
763
+ "sourceId": "req-leak",
764
+ "targetId": "need",
765
+ "relationType": "derives"
766
+ },
767
+ {
768
+ "id": "req-audit--derives--need",
769
+ "sourceId": "req-audit",
770
+ "targetId": "need",
771
+ "relationType": "derives"
772
+ },
773
+ {
774
+ "id": "req-manager--derives--need",
775
+ "sourceId": "req-manager",
776
+ "targetId": "need",
777
+ "relationType": "derives"
778
+ },
779
+ {
780
+ "id": "req-workload--derives--need",
781
+ "sourceId": "req-workload",
782
+ "targetId": "need",
783
+ "relationType": "derives"
784
+ },
785
+ {
786
+ "id": "req-env--derives--need",
787
+ "sourceId": "req-env",
788
+ "targetId": "need",
789
+ "relationType": "derives"
790
+ },
791
+ {
792
+ "id": "req-rotate-auto--derives--need",
793
+ "sourceId": "req-rotate-auto",
794
+ "targetId": "need",
795
+ "relationType": "derives"
796
+ },
797
+ {
798
+ "id": "req-rotate-runbook--derives--need",
799
+ "sourceId": "req-rotate-runbook",
800
+ "targetId": "need",
801
+ "relationType": "derives"
802
+ },
803
+ {
804
+ "id": "req-breakglass--derives--need",
805
+ "sourceId": "req-breakglass",
806
+ "targetId": "need",
807
+ "relationType": "derives"
808
+ },
809
+ {
810
+ "id": "req-jit--derives--need",
811
+ "sourceId": "req-jit",
812
+ "targetId": "need",
813
+ "relationType": "derives"
814
+ },
815
+ {
816
+ "id": "req-team--derives--need",
817
+ "sourceId": "req-team",
818
+ "targetId": "need",
819
+ "relationType": "derives"
820
+ },
821
+ {
822
+ "id": "req-scan-push--derives--need",
823
+ "sourceId": "req-scan-push",
824
+ "targetId": "need",
825
+ "relationType": "derives"
826
+ },
827
+ {
828
+ "id": "req-scan-ci--derives--need",
829
+ "sourceId": "req-scan-ci",
830
+ "targetId": "need",
831
+ "relationType": "derives"
832
+ },
833
+ {
834
+ "id": "req-scan-scheduled--derives--need",
835
+ "sourceId": "req-scan-scheduled",
836
+ "targetId": "need",
837
+ "relationType": "derives"
838
+ },
839
+ {
840
+ "id": "sc-no-repo--verifies--req-no-repo",
841
+ "sourceId": "sc-no-repo",
842
+ "targetId": "req-no-repo",
843
+ "relationType": "verifies"
844
+ },
845
+ {
846
+ "id": "sc-own--verifies--req-own",
847
+ "sourceId": "sc-own",
848
+ "targetId": "req-own",
849
+ "relationType": "verifies"
850
+ },
851
+ {
852
+ "id": "sc-leak--verifies--req-leak",
853
+ "sourceId": "sc-leak",
854
+ "targetId": "req-leak",
855
+ "relationType": "verifies"
856
+ },
857
+ {
858
+ "id": "sc-audit--verifies--req-audit",
859
+ "sourceId": "sc-audit",
860
+ "targetId": "req-audit",
861
+ "relationType": "verifies"
862
+ },
863
+ {
864
+ "id": "sc-manager--verifies--req-manager",
865
+ "sourceId": "sc-manager",
866
+ "targetId": "req-manager",
867
+ "relationType": "verifies"
868
+ },
869
+ {
870
+ "id": "sc-workload--verifies--req-workload",
871
+ "sourceId": "sc-workload",
872
+ "targetId": "req-workload",
873
+ "relationType": "verifies"
874
+ },
875
+ {
876
+ "id": "sc-env--verifies--req-env",
877
+ "sourceId": "sc-env",
878
+ "targetId": "req-env",
879
+ "relationType": "verifies"
880
+ },
881
+ {
882
+ "id": "sc-rotate-auto--verifies--req-rotate-auto",
883
+ "sourceId": "sc-rotate-auto",
884
+ "targetId": "req-rotate-auto",
885
+ "relationType": "verifies"
886
+ },
887
+ {
888
+ "id": "sc-rotate-runbook--verifies--req-rotate-runbook",
889
+ "sourceId": "sc-rotate-runbook",
890
+ "targetId": "req-rotate-runbook",
891
+ "relationType": "verifies"
892
+ },
893
+ {
894
+ "id": "sc-breakglass--verifies--req-breakglass",
895
+ "sourceId": "sc-breakglass",
896
+ "targetId": "req-breakglass",
897
+ "relationType": "verifies"
898
+ },
899
+ {
900
+ "id": "sc-jit--verifies--req-jit",
901
+ "sourceId": "sc-jit",
902
+ "targetId": "req-jit",
903
+ "relationType": "verifies"
904
+ },
905
+ {
906
+ "id": "sc-team--verifies--req-team",
907
+ "sourceId": "sc-team",
908
+ "targetId": "req-team",
909
+ "relationType": "verifies"
910
+ },
911
+ {
912
+ "id": "sc-scan-push--verifies--req-scan-push",
913
+ "sourceId": "sc-scan-push",
914
+ "targetId": "req-scan-push",
915
+ "relationType": "verifies"
916
+ },
917
+ {
918
+ "id": "sc-scan-ci--verifies--req-scan-ci",
919
+ "sourceId": "sc-scan-ci",
920
+ "targetId": "req-scan-ci",
921
+ "relationType": "verifies"
922
+ },
923
+ {
924
+ "id": "sc-scan-scheduled--verifies--req-scan-scheduled",
925
+ "sourceId": "sc-scan-scheduled",
926
+ "targetId": "req-scan-scheduled",
927
+ "relationType": "verifies"
928
+ },
929
+ {
930
+ "id": "ff-scan-push--implements--adr-manager",
931
+ "sourceId": "ff-scan-push",
932
+ "targetId": "adr-manager",
933
+ "relationType": "implements"
934
+ },
935
+ {
936
+ "id": "ff-scan-push--implements--adr-identity",
937
+ "sourceId": "ff-scan-push",
938
+ "targetId": "adr-identity",
939
+ "relationType": "implements"
940
+ },
941
+ {
942
+ "id": "ff-scan-push--implements--adr-env",
943
+ "sourceId": "ff-scan-push",
944
+ "targetId": "adr-env",
945
+ "relationType": "implements"
946
+ },
947
+ {
948
+ "id": "ff-scan-ci--implements--adr-manager",
949
+ "sourceId": "ff-scan-ci",
950
+ "targetId": "adr-manager",
951
+ "relationType": "implements"
952
+ },
953
+ {
954
+ "id": "ff-scan-ci--implements--adr-identity",
955
+ "sourceId": "ff-scan-ci",
956
+ "targetId": "adr-identity",
957
+ "relationType": "implements"
958
+ },
959
+ {
960
+ "id": "ff-scan-ci--implements--adr-env",
961
+ "sourceId": "ff-scan-ci",
962
+ "targetId": "adr-env",
963
+ "relationType": "implements"
964
+ },
965
+ {
966
+ "id": "ff-scan-history--implements--adr-manager",
967
+ "sourceId": "ff-scan-history",
968
+ "targetId": "adr-manager",
969
+ "relationType": "implements"
970
+ },
971
+ {
972
+ "id": "ff-scan-history--implements--adr-identity",
973
+ "sourceId": "ff-scan-history",
974
+ "targetId": "adr-identity",
975
+ "relationType": "implements"
976
+ },
977
+ {
978
+ "id": "ff-scan-history--implements--adr-env",
979
+ "sourceId": "ff-scan-history",
980
+ "targetId": "adr-env",
981
+ "relationType": "implements"
982
+ },
983
+ {
984
+ "id": "ff-age-manager--implements--adr-manager",
985
+ "sourceId": "ff-age-manager",
986
+ "targetId": "adr-manager",
987
+ "relationType": "implements"
988
+ },
989
+ {
990
+ "id": "ff-age-manager--implements--adr-identity",
991
+ "sourceId": "ff-age-manager",
992
+ "targetId": "adr-identity",
993
+ "relationType": "implements"
994
+ },
995
+ {
996
+ "id": "ff-no-static--implements--adr-identity",
997
+ "sourceId": "ff-no-static",
998
+ "targetId": "adr-identity",
999
+ "relationType": "implements"
1000
+ },
1001
+ {
1002
+ "id": "ff-age-env--implements--adr-env",
1003
+ "sourceId": "ff-age-env",
1004
+ "targetId": "adr-env",
1005
+ "relationType": "implements"
1006
+ },
1007
+ {
1008
+ "id": "ff-human-reads--implements--adr-manager",
1009
+ "sourceId": "ff-human-reads",
1010
+ "targetId": "adr-manager",
1011
+ "relationType": "implements"
1012
+ },
1013
+ {
1014
+ "id": "ff-human-reads--implements--adr-identity",
1015
+ "sourceId": "ff-human-reads",
1016
+ "targetId": "adr-identity",
1017
+ "relationType": "implements"
1018
+ },
1019
+ {
1020
+ "id": "ff-human-reads--implements--adr-env",
1021
+ "sourceId": "ff-human-reads",
1022
+ "targetId": "adr-env",
1023
+ "relationType": "implements"
1024
+ }
1025
+ ]
1026
+ }