proagents 1.6.16 → 1.6.18

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 (170) hide show
  1. package/.claude/settings.local.json +169 -0
  2. package/COMMANDS.md +595 -0
  3. package/README.md +22 -64
  4. package/bin/proagents.js +0 -2
  5. package/lib/commands/init.js +4 -174
  6. package/package.json +2 -7
  7. package/.proagents/ai-models/README.md +0 -141
  8. package/.proagents/ai-models/cost-management.md +0 -362
  9. package/.proagents/ai-models/fallbacks.md +0 -342
  10. package/.proagents/ai-models/model-config.md +0 -318
  11. package/.proagents/ai-models/task-routing.md +0 -503
  12. package/.proagents/ai-training/README.md +0 -155
  13. package/.proagents/ai-training/continuous-learning.md +0 -413
  14. package/.proagents/ai-training/domain-knowledge.md +0 -378
  15. package/.proagents/ai-training/pattern-learning.md +0 -455
  16. package/.proagents/ai-training/training-data.md +0 -337
  17. package/.proagents/ai-training/user-preferences.md +0 -346
  18. package/.proagents/approval-workflows/README.md +0 -146
  19. package/.proagents/approval-workflows/approval-config.md +0 -332
  20. package/.proagents/approval-workflows/approval-stages.md +0 -503
  21. package/.proagents/approval-workflows/emergency-bypass.md +0 -351
  22. package/.proagents/approval-workflows/examples.md +0 -859
  23. package/.proagents/approval-workflows/notifications.md +0 -320
  24. package/.proagents/compliance/README.md +0 -206
  25. package/.proagents/compliance/access-control.md +0 -310
  26. package/.proagents/compliance/audit-logging.md +0 -444
  27. package/.proagents/compliance/compliance-frameworks.md +0 -429
  28. package/.proagents/compliance/reports.md +0 -491
  29. package/.proagents/compliance/retention-policies.md +0 -454
  30. package/.proagents/config-versioning/README.md +0 -120
  31. package/.proagents/config-versioning/changelog.md +0 -300
  32. package/.proagents/config-versioning/rollback.md +0 -283
  33. package/.proagents/config-versioning/versioning.md +0 -330
  34. package/.proagents/contract-testing/README.md +0 -223
  35. package/.proagents/contract-testing/contract-testing.md +0 -614
  36. package/.proagents/contract-testing/pact-integration.md +0 -507
  37. package/.proagents/contract-testing/schema-validation.md +0 -565
  38. package/.proagents/dependency-management/README.md +0 -140
  39. package/.proagents/dependency-management/automation.md +0 -363
  40. package/.proagents/dependency-management/compatibility.md +0 -319
  41. package/.proagents/dependency-management/security-scanning.md +0 -413
  42. package/.proagents/dependency-management/update-policies.md +0 -374
  43. package/.proagents/disaster-recovery/README.md +0 -247
  44. package/.proagents/disaster-recovery/automation.md +0 -366
  45. package/.proagents/disaster-recovery/backup-recovery.md +0 -571
  46. package/.proagents/disaster-recovery/incident-response.md +0 -565
  47. package/.proagents/disaster-recovery/rollback-procedures.md +0 -499
  48. package/.proagents/disaster-recovery/runbooks.md +0 -603
  49. package/.proagents/disaster-recovery/scenarios.md +0 -892
  50. package/.proagents/disaster-recovery/testing.md +0 -438
  51. package/.proagents/environments/README.md +0 -244
  52. package/.proagents/environments/configuration.md +0 -437
  53. package/.proagents/environments/promotion.md +0 -434
  54. package/.proagents/environments/setup.md +0 -420
  55. package/.proagents/examples/README.md +0 -55
  56. package/.proagents/examples/backend-nodejs/README.md +0 -188
  57. package/.proagents/examples/backend-nodejs/complete-conversation.md +0 -601
  58. package/.proagents/examples/backend-nodejs/proagents.config.yaml +0 -415
  59. package/.proagents/examples/backend-nodejs/workflow-example.md +0 -909
  60. package/.proagents/examples/fullstack-nextjs/README.md +0 -155
  61. package/.proagents/examples/fullstack-nextjs/complete-conversation.md +0 -604
  62. package/.proagents/examples/fullstack-nextjs/proagents.config.yaml +0 -287
  63. package/.proagents/examples/fullstack-nextjs/workflow-example.md +0 -553
  64. package/.proagents/examples/mobile-react-native/README.md +0 -171
  65. package/.proagents/examples/mobile-react-native/complete-conversation.md +0 -825
  66. package/.proagents/examples/mobile-react-native/proagents.config.yaml +0 -330
  67. package/.proagents/examples/mobile-react-native/workflow-example.md +0 -723
  68. package/.proagents/examples/web-frontend-react/README.md +0 -125
  69. package/.proagents/examples/web-frontend-react/complete-conversation.md +0 -556
  70. package/.proagents/examples/web-frontend-react/proagents.config.yaml +0 -183
  71. package/.proagents/examples/web-frontend-react/workflow-example.md +0 -603
  72. package/.proagents/existing-projects/README.md +0 -65
  73. package/.proagents/existing-projects/challenges.md +0 -861
  74. package/.proagents/existing-projects/coexistence-mode.md +0 -483
  75. package/.proagents/existing-projects/compatibility-assessment.md +0 -541
  76. package/.proagents/existing-projects/gradual-adoption.md +0 -515
  77. package/.proagents/existing-projects/migration-strategies.md +0 -788
  78. package/.proagents/existing-projects/pattern-reconciliation.md +0 -489
  79. package/.proagents/existing-projects/team-onboarding.md +0 -617
  80. package/.proagents/existing-projects/technical-debt-handling.md +0 -644
  81. package/.proagents/feature-flags/README.md +0 -263
  82. package/.proagents/feature-flags/ab-testing.md +0 -413
  83. package/.proagents/feature-flags/configuration.md +0 -420
  84. package/.proagents/feature-flags/kill-switches.md +0 -444
  85. package/.proagents/feature-flags/rollout-strategies.md +0 -392
  86. package/.proagents/history.log +0 -12
  87. package/.proagents/i18n/README.md +0 -133
  88. package/.proagents/i18n/extraction.md +0 -433
  89. package/.proagents/i18n/tms-integration.md +0 -332
  90. package/.proagents/i18n/translation-workflow.md +0 -413
  91. package/.proagents/i18n/validation.md +0 -355
  92. package/.proagents/logging/README.md +0 -276
  93. package/.proagents/logging/aggregation.md +0 -475
  94. package/.proagents/logging/log-levels.md +0 -376
  95. package/.proagents/logging/sensitive-data.md +0 -423
  96. package/.proagents/logging/structured-logging.md +0 -406
  97. package/.proagents/metrics/README.md +0 -69
  98. package/.proagents/metrics/code-quality-kpis.md +0 -461
  99. package/.proagents/metrics/deployment-metrics.md +0 -517
  100. package/.proagents/metrics/developer-productivity.md +0 -368
  101. package/.proagents/metrics/learning-effectiveness.md +0 -478
  102. package/.proagents/migrations/README.md +0 -77
  103. package/.proagents/migrations/from-claude-projects.md +0 -313
  104. package/.proagents/migrations/from-cursor-rules.md +0 -345
  105. package/.proagents/migrations/from-custom-workflows.md +0 -410
  106. package/.proagents/monitoring/README.md +0 -308
  107. package/.proagents/monitoring/alerting.md +0 -449
  108. package/.proagents/monitoring/dashboards.md +0 -454
  109. package/.proagents/monitoring/health-checks.md +0 -436
  110. package/.proagents/monitoring/metrics.md +0 -434
  111. package/.proagents/multi-project/README.md +0 -170
  112. package/.proagents/multi-project/coordinated-deploy.md +0 -510
  113. package/.proagents/multi-project/cross-project-deps.md +0 -395
  114. package/.proagents/multi-project/unified-changelog.md +0 -477
  115. package/.proagents/multi-project/walkthroughs/monorepo-setup.md +0 -787
  116. package/.proagents/multi-project/workspace-config.md +0 -408
  117. package/.proagents/notifications/README.md +0 -151
  118. package/.proagents/notifications/channels.md +0 -457
  119. package/.proagents/notifications/preferences.md +0 -415
  120. package/.proagents/notifications/routing.md +0 -449
  121. package/.proagents/notifications/scheduling.md +0 -425
  122. package/.proagents/notifications/templates.md +0 -446
  123. package/.proagents/offline-mode/README.md +0 -145
  124. package/.proagents/offline-mode/caching.md +0 -344
  125. package/.proagents/offline-mode/offline-operations.md +0 -312
  126. package/.proagents/offline-mode/queue-specifications.md +0 -679
  127. package/.proagents/offline-mode/sync.md +0 -475
  128. package/.proagents/parallel-features/README.md +0 -85
  129. package/.proagents/parallel-features/conflict-detection.md +0 -226
  130. package/.proagents/parallel-features/dependency-management.md +0 -392
  131. package/.proagents/parallel-features/merge-coordination.md +0 -506
  132. package/.proagents/parallel-features/tracking-system.md +0 -416
  133. package/.proagents/performance/README.md +0 -59
  134. package/.proagents/performance/bundle-analysis.md +0 -375
  135. package/.proagents/performance/load-testing.md +0 -563
  136. package/.proagents/performance/runtime-metrics.md +0 -489
  137. package/.proagents/performance/web-vitals.md +0 -425
  138. package/.proagents/plugins/README.md +0 -139
  139. package/.proagents/plugins/creating-plugins.md +0 -504
  140. package/.proagents/plugins/plugin-api.md +0 -467
  141. package/.proagents/plugins/plugin-registry.md +0 -276
  142. package/.proagents/reporting/README.md +0 -158
  143. package/.proagents/reporting/dashboards.md +0 -366
  144. package/.proagents/reporting/exports.md +0 -524
  145. package/.proagents/reporting/quality-metrics.md +0 -385
  146. package/.proagents/reporting/templates/README.md +0 -56
  147. package/.proagents/reporting/templates/dashboard-config.json +0 -187
  148. package/.proagents/reporting/templates/metrics-queries.md +0 -427
  149. package/.proagents/reporting/templates/react-dashboard.tsx +0 -544
  150. package/.proagents/reporting/templates/widgets.md +0 -451
  151. package/.proagents/reporting/velocity-metrics.md +0 -340
  152. package/.proagents/reverse-engineering/README.md +0 -151
  153. package/.proagents/reverse-engineering/architecture-extraction.md +0 -325
  154. package/.proagents/reverse-engineering/code-analysis.md +0 -377
  155. package/.proagents/reverse-engineering/dependency-mapping.md +0 -567
  156. package/.proagents/reverse-engineering/diagram-generation.md +0 -586
  157. package/.proagents/reverse-engineering/documentation-generation.md +0 -468
  158. package/.proagents/reverse-engineering/pattern-detection.md +0 -569
  159. package/.proagents/reverse-engineering/quality-assessment.md +0 -733
  160. package/.proagents/secrets/README.md +0 -278
  161. package/.proagents/secrets/access-control.md +0 -443
  162. package/.proagents/secrets/rotation.md +0 -403
  163. package/.proagents/secrets/scanning.md +0 -487
  164. package/.proagents/secrets/storage.md +0 -394
  165. package/.proagents/webhooks/README.md +0 -126
  166. package/.proagents/webhooks/endpoints.md +0 -298
  167. package/.proagents/webhooks/events.md +0 -316
  168. package/.proagents/webhooks/payloads.md +0 -325
  169. package/.proagents/webhooks/reliability.md +0 -363
  170. package/.proagents/webhooks/security.md +0 -380
@@ -1,278 +0,0 @@
1
- # Secret Management
2
-
3
- Secure handling of API keys, credentials, and sensitive data.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- Protect sensitive information throughout the development lifecycle.
10
-
11
- ## Documentation
12
-
13
- | Document | Description |
14
- |----------|-------------|
15
- | [Secret Storage](./storage.md) | Where to store secrets |
16
- | [Secret Rotation](./rotation.md) | Rotating credentials |
17
- | [Access Control](./access-control.md) | Who can access secrets |
18
- | [Scanning](./scanning.md) | Detecting leaked secrets |
19
-
20
- ---
21
-
22
- ## Secret Types
23
-
24
- | Type | Examples | Storage |
25
- |------|----------|---------|
26
- | API Keys | Stripe, Twilio, OpenAI | Vault/SSM |
27
- | Database | Connection strings, passwords | Vault/SSM |
28
- | Authentication | JWT secrets, OAuth credentials | Vault/SSM |
29
- | Infrastructure | AWS keys, SSH keys | Vault/SSM |
30
- | Encryption | AES keys, certificates | Vault/HSM |
31
-
32
- ---
33
-
34
- ## Configuration
35
-
36
- ### Secret Sources
37
-
38
- ```yaml
39
- # proagents.config.yaml
40
- secrets:
41
- # Primary source
42
- provider: "aws-ssm" # aws-ssm, vault, azure-keyvault, gcp-secrets
43
-
44
- # Provider config
45
- aws_ssm:
46
- region: "us-east-1"
47
- prefix: "/myapp/"
48
-
49
- # Fallback for development
50
- development:
51
- provider: "dotenv"
52
- file: ".env.local"
53
- ```
54
-
55
- ### Secret References
56
-
57
- ```yaml
58
- # Reference secrets in config
59
- database:
60
- url: "${secrets.DATABASE_URL}"
61
-
62
- api:
63
- stripe_key: "${secrets.STRIPE_SECRET_KEY}"
64
- ```
65
-
66
- ---
67
-
68
- ## Secret Scanning
69
-
70
- ### Pre-Commit Scanning
71
-
72
- ```yaml
73
- secrets:
74
- scanning:
75
- enabled: true
76
-
77
- # When to scan
78
- hooks:
79
- - "pre-commit"
80
- - "pre-push"
81
-
82
- # What to scan for
83
- patterns:
84
- - name: "AWS Access Key"
85
- pattern: "AKIA[0-9A-Z]{16}"
86
-
87
- - name: "Generic API Key"
88
- pattern: "api[_-]?key['\"]?\\s*[:=]\\s*['\"][a-zA-Z0-9]{32,}"
89
-
90
- - name: "Private Key"
91
- pattern: "-----BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY-----"
92
-
93
- # Block on detection
94
- block_commit: true
95
- ```
96
-
97
- ### Scanning Commands
98
-
99
- ```bash
100
- # Scan for secrets
101
- proagents secrets scan
102
-
103
- # Scan specific files
104
- proagents secrets scan src/
105
-
106
- # Scan git history
107
- proagents secrets scan --history
108
-
109
- # Check if clean
110
- proagents secrets check
111
- ```
112
-
113
- ---
114
-
115
- ## Secret Rotation
116
-
117
- ### Rotation Policy
118
-
119
- ```yaml
120
- secrets:
121
- rotation:
122
- enabled: true
123
-
124
- policies:
125
- # Rotate database passwords monthly
126
- database:
127
- interval: "30d"
128
- auto_rotate: true
129
-
130
- # Rotate API keys quarterly
131
- api_keys:
132
- interval: "90d"
133
- auto_rotate: false
134
- notify_before: "7d"
135
-
136
- # Never auto-rotate these
137
- encryption_keys:
138
- auto_rotate: false
139
- manual_review: true
140
- ```
141
-
142
- ### Rotation Commands
143
-
144
- ```bash
145
- # Check rotation status
146
- proagents secrets rotation-status
147
-
148
- # Rotate specific secret
149
- proagents secrets rotate DATABASE_PASSWORD
150
-
151
- # Schedule rotation
152
- proagents secrets schedule-rotation API_KEY --date "2024-03-01"
153
- ```
154
-
155
- ---
156
-
157
- ## Access Control
158
-
159
- ### Permission Model
160
-
161
- ```yaml
162
- secrets:
163
- access:
164
- roles:
165
- developer:
166
- read:
167
- - "development/*"
168
- write: []
169
-
170
- devops:
171
- read:
172
- - "development/*"
173
- - "staging/*"
174
- - "production/*"
175
- write:
176
- - "development/*"
177
- - "staging/*"
178
-
179
- admin:
180
- read: ["*"]
181
- write: ["*"]
182
- ```
183
-
184
- ### Audit Logging
185
-
186
- ```yaml
187
- secrets:
188
- audit:
189
- enabled: true
190
- log_access: true
191
- log_changes: true
192
-
193
- # Where to send logs
194
- destinations:
195
- - "cloudwatch"
196
- - "splunk"
197
- ```
198
-
199
- ---
200
-
201
- ## Best Practices
202
-
203
- ### Do's
204
-
205
- ```
206
- ✅ Use secret managers (not env files in production)
207
- ✅ Rotate secrets regularly
208
- ✅ Audit secret access
209
- ✅ Use different secrets per environment
210
- ✅ Encrypt secrets at rest and in transit
211
- ✅ Limit secret access by role
212
- ✅ Scan for leaked secrets
213
- ```
214
-
215
- ### Don'ts
216
-
217
- ```
218
- ❌ Commit secrets to git
219
- ❌ Log secrets in application logs
220
- ❌ Share secrets via Slack/email
221
- ❌ Use same secrets across environments
222
- ❌ Store secrets in code comments
223
- ❌ Hardcode secrets in source code
224
- ```
225
-
226
- ---
227
-
228
- ## Emergency Procedures
229
-
230
- ### Secret Leak Response
231
-
232
- ```bash
233
- # 1. Immediately revoke the leaked secret
234
- proagents secrets revoke LEAKED_SECRET
235
-
236
- # 2. Rotate to new value
237
- proagents secrets rotate LEAKED_SECRET --emergency
238
-
239
- # 3. Audit access
240
- proagents secrets audit LEAKED_SECRET --since "24h"
241
-
242
- # 4. Scan for exposure
243
- proagents secrets scan --history
244
- ```
245
-
246
- ### Leak Response Checklist
247
-
248
- - [ ] Revoke compromised secret immediately
249
- - [ ] Generate new secret
250
- - [ ] Update all services using the secret
251
- - [ ] Check for unauthorized access
252
- - [ ] Scan git history for exposure
253
- - [ ] Document incident
254
- - [ ] Review access controls
255
-
256
- ---
257
-
258
- ## Commands Reference
259
-
260
- ```bash
261
- # List secrets (names only, not values)
262
- proagents secrets list
263
-
264
- # Get secret value (requires auth)
265
- proagents secrets get DATABASE_URL
266
-
267
- # Set secret
268
- proagents secrets set API_KEY "value" --env production
269
-
270
- # Delete secret
271
- proagents secrets delete OLD_SECRET
272
-
273
- # Sync secrets to environment
274
- proagents secrets sync --env staging
275
-
276
- # Export for backup (encrypted)
277
- proagents secrets export --encrypt --output secrets.enc
278
- ```
@@ -1,443 +0,0 @@
1
- # Secret Access Control
2
-
3
- Managing who and what can access secrets.
4
-
5
- ---
6
-
7
- ## Access Principles
8
-
9
- | Principle | Description |
10
- |-----------|-------------|
11
- | **Least Privilege** | Grant minimum necessary access |
12
- | **Need to Know** | Only those who need it get access |
13
- | **Separation of Duties** | No single person has all access |
14
- | **Audit Everything** | Log all access attempts |
15
-
16
- ---
17
-
18
- ## Role-Based Access
19
-
20
- ### Configuration
21
-
22
- ```yaml
23
- # proagents.config.yaml
24
- secrets:
25
- access_control:
26
- enabled: true
27
-
28
- roles:
29
- # Read-only access
30
- viewer:
31
- permissions:
32
- - "secrets:read"
33
- allowed_secrets:
34
- - "public/*"
35
-
36
- # Developer access
37
- developer:
38
- permissions:
39
- - "secrets:read"
40
- allowed_secrets:
41
- - "development/*"
42
- - "staging/*"
43
- denied_secrets:
44
- - "*/credentials"
45
- - "*/api-keys"
46
-
47
- # Operations access
48
- operator:
49
- permissions:
50
- - "secrets:read"
51
- - "secrets:rotate"
52
- allowed_secrets:
53
- - "*"
54
- environments:
55
- - "staging"
56
- - "production"
57
-
58
- # Admin access
59
- admin:
60
- permissions:
61
- - "secrets:*"
62
- allowed_secrets:
63
- - "*"
64
- ```
65
-
66
- ### User Assignment
67
-
68
- ```yaml
69
- secrets:
70
- access_control:
71
- users:
72
- "developer@company.com":
73
- roles: ["developer"]
74
- teams: ["frontend"]
75
-
76
- "ops@company.com":
77
- roles: ["operator"]
78
- teams: ["platform"]
79
-
80
- "admin@company.com":
81
- roles: ["admin"]
82
- mfa_required: true
83
-
84
- # Team-based access
85
- teams:
86
- frontend:
87
- allowed_secrets:
88
- - "frontend/*"
89
-
90
- backend:
91
- allowed_secrets:
92
- - "backend/*"
93
- - "database/*"
94
-
95
- platform:
96
- allowed_secrets:
97
- - "*"
98
- ```
99
-
100
- ---
101
-
102
- ## Service Access
103
-
104
- ### Service Accounts
105
-
106
- ```yaml
107
- secrets:
108
- access_control:
109
- services:
110
- # API service
111
- api-service:
112
- allowed_secrets:
113
- - "database/connection-string"
114
- - "redis/url"
115
- - "jwt/signing-key"
116
- environments:
117
- - "${ENVIRONMENT}"
118
-
119
- # Worker service
120
- worker-service:
121
- allowed_secrets:
122
- - "database/connection-string"
123
- - "queue/credentials"
124
- environments:
125
- - "${ENVIRONMENT}"
126
-
127
- # CI/CD pipeline
128
- ci-pipeline:
129
- allowed_secrets:
130
- - "ci/*"
131
- - "npm/token"
132
- allowed_operations:
133
- - "read"
134
- ```
135
-
136
- ### Kubernetes Service Accounts
137
-
138
- ```yaml
139
- secrets:
140
- access_control:
141
- kubernetes:
142
- # Bind service accounts to secret access
143
- bindings:
144
- - service_account: "api-service"
145
- namespace: "production"
146
- secrets:
147
- - "database-credentials"
148
- - "api-keys"
149
-
150
- - service_account: "worker"
151
- namespace: "production"
152
- secrets:
153
- - "database-credentials"
154
- - "queue-credentials"
155
- ```
156
-
157
- ---
158
-
159
- ## Access Policies
160
-
161
- ### Policy Definition
162
-
163
- ```yaml
164
- secrets:
165
- access_control:
166
- policies:
167
- # Time-based access
168
- production_access:
169
- name: "Production Access"
170
- conditions:
171
- - type: "time_window"
172
- days: ["monday", "tuesday", "wednesday", "thursday", "friday"]
173
- hours: ["09:00", "18:00"]
174
- timezone: "America/New_York"
175
-
176
- - type: "ip_range"
177
- ranges:
178
- - "10.0.0.0/8"
179
- - "192.168.1.0/24"
180
-
181
- # Emergency access
182
- emergency_access:
183
- name: "Emergency Access"
184
- conditions:
185
- - type: "requires_approval"
186
- approvers: ["security-team", "on-call-manager"]
187
-
188
- - type: "time_limited"
189
- duration: "4h"
190
-
191
- - type: "audit_required"
192
- notify: ["security@company.com"]
193
- ```
194
-
195
- ### Vault Policies
196
-
197
- ```hcl
198
- # vault/policies/api-service.hcl
199
- path "secret/data/api/*" {
200
- capabilities = ["read"]
201
- }
202
-
203
- path "secret/data/database/connection" {
204
- capabilities = ["read"]
205
- }
206
-
207
- path "database/creds/api-role" {
208
- capabilities = ["read"]
209
- }
210
-
211
- # Deny access to admin secrets
212
- path "secret/data/admin/*" {
213
- capabilities = ["deny"]
214
- }
215
- ```
216
-
217
- ### AWS IAM Policies
218
-
219
- ```json
220
- {
221
- "Version": "2012-10-17",
222
- "Statement": [
223
- {
224
- "Sid": "AllowReadSecrets",
225
- "Effect": "Allow",
226
- "Action": [
227
- "secretsmanager:GetSecretValue"
228
- ],
229
- "Resource": [
230
- "arn:aws:secretsmanager:*:*:secret:myapp/production/*"
231
- ],
232
- "Condition": {
233
- "StringEquals": {
234
- "aws:PrincipalTag/Environment": "production"
235
- }
236
- }
237
- },
238
- {
239
- "Sid": "DenyAdminSecrets",
240
- "Effect": "Deny",
241
- "Action": [
242
- "secretsmanager:*"
243
- ],
244
- "Resource": [
245
- "arn:aws:secretsmanager:*:*:secret:myapp/admin/*"
246
- ]
247
- }
248
- ]
249
- }
250
- ```
251
-
252
- ---
253
-
254
- ## Access Auditing
255
-
256
- ### Audit Configuration
257
-
258
- ```yaml
259
- secrets:
260
- access_control:
261
- audit:
262
- enabled: true
263
-
264
- # Events to log
265
- events:
266
- - "secret_accessed"
267
- - "secret_created"
268
- - "secret_updated"
269
- - "secret_deleted"
270
- - "access_denied"
271
- - "policy_changed"
272
-
273
- # Log details
274
- log_details:
275
- - "timestamp"
276
- - "user"
277
- - "service"
278
- - "secret_name"
279
- - "action"
280
- - "ip_address"
281
- - "user_agent"
282
-
283
- # Storage
284
- destinations:
285
- - type: "cloudwatch"
286
- log_group: "/security/secret-access"
287
-
288
- - type: "siem"
289
- endpoint: "${SIEM_ENDPOINT}"
290
-
291
- # Retention
292
- retention: "2 years"
293
- ```
294
-
295
- ### Audit Alerts
296
-
297
- ```yaml
298
- secrets:
299
- access_control:
300
- alerts:
301
- # Suspicious access
302
- - name: "Unusual Secret Access"
303
- condition: |
304
- access_count > normal_baseline * 3
305
- AND time_of_day NOT IN business_hours
306
- severity: "warning"
307
- notify: ["security-team"]
308
-
309
- # Access denied spike
310
- - name: "Multiple Access Denied"
311
- condition: "access_denied_count > 10 IN 5m"
312
- severity: "critical"
313
- notify: ["security-team", "pagerduty"]
314
-
315
- # Sensitive secret access
316
- - name: "Sensitive Secret Accessed"
317
- condition: "secret_path MATCHES 'admin/*'"
318
- severity: "info"
319
- notify: ["security-team"]
320
- ```
321
-
322
- ---
323
-
324
- ## Emergency Access
325
-
326
- ### Break-Glass Procedure
327
-
328
- ```yaml
329
- secrets:
330
- access_control:
331
- emergency:
332
- enabled: true
333
-
334
- # Break-glass accounts
335
- break_glass:
336
- accounts:
337
- - id: "emergency-1"
338
- stored_in: "physical_safe"
339
- access_log: "mandatory"
340
-
341
- - id: "emergency-2"
342
- stored_in: "cto_vault"
343
- access_log: "mandatory"
344
-
345
- # Procedure
346
- procedure:
347
- steps:
348
- - "Contact security team"
349
- - "Document incident number"
350
- - "Retrieve break-glass credentials"
351
- - "Access required secrets"
352
- - "Complete incident report"
353
- - "Rotate compromised credentials"
354
-
355
- # Automatic actions
356
- on_use:
357
- - "alert_security_team"
358
- - "start_audit_recording"
359
- - "expire_in_4_hours"
360
- - "require_followup_report"
361
- ```
362
-
363
- ---
364
-
365
- ## Implementation
366
-
367
- ### Access Check Middleware
368
-
369
- ```typescript
370
- // middleware/secretAccess.ts
371
- import { SecretAccessPolicy } from '../policies';
372
-
373
- export function checkSecretAccess(
374
- user: User,
375
- secretPath: string,
376
- operation: 'read' | 'write' | 'delete'
377
- ): boolean {
378
- // Get user's roles and policies
379
- const policies = getUserPolicies(user);
380
-
381
- // Check each policy
382
- for (const policy of policies) {
383
- if (policy.allows(secretPath, operation)) {
384
- // Log access
385
- auditLog.record({
386
- user: user.id,
387
- secret: secretPath,
388
- operation,
389
- allowed: true,
390
- timestamp: new Date(),
391
- });
392
- return true;
393
- }
394
- }
395
-
396
- // Access denied
397
- auditLog.record({
398
- user: user.id,
399
- secret: secretPath,
400
- operation,
401
- allowed: false,
402
- timestamp: new Date(),
403
- });
404
-
405
- return false;
406
- }
407
- ```
408
-
409
- ---
410
-
411
- ## Commands
412
-
413
- ```bash
414
- # Check access for user
415
- proagents secrets check-access --user developer@company.com --secret database/password
416
-
417
- # List user permissions
418
- proagents secrets permissions --user developer@company.com
419
-
420
- # Grant access
421
- proagents secrets grant --user developer@company.com --secret api/key --permission read
422
-
423
- # Revoke access
424
- proagents secrets revoke --user developer@company.com --secret api/key
425
-
426
- # View audit log
427
- proagents secrets audit-log --last 24h
428
-
429
- # Request emergency access
430
- proagents secrets emergency-access --reason "Production incident" --duration 4h
431
- ```
432
-
433
- ---
434
-
435
- ## Best Practices
436
-
437
- 1. **Least Privilege**: Start with no access, grant as needed
438
- 2. **Regular Reviews**: Audit access quarterly
439
- 3. **Separation of Duties**: No one person has all keys
440
- 4. **Time-Based Access**: Limit access to business hours when possible
441
- 5. **Audit Everything**: Log all access, successful or not
442
- 6. **Emergency Procedures**: Document and test break-glass access
443
- 7. **Automate Reviews**: Use tools to flag excessive permissions