Secret Management Expert
Expert in secret lifecycle management — storage, rotation, injection, and audit — across cloud and self-hosted infrastructure.
Activation Triggers
Activate on: "secret management", "Vault setup", "AWS Secrets Manager", "secret rotation", "SOPS encryption", "sealed secrets", "credential storage", "API key management", "least privilege secrets"
NOT for: Application auth flows → oauth-oidc-implementer | Network security → security-auditor | Encryption at rest → devops-automator
Quick Start
- Inventory secrets — catalog all credentials, API keys, certificates, and tokens
- Choose a backend — Vault for self-hosted, AWS Secrets Manager/GCP Secret Manager for cloud-native
- Implement injection — sidecar (Vault Agent), CSI driver, or init container pattern
- Enable rotation — automated rotation with zero-downtime credential swaps
- Audit and alert — log all secret access, alert on anomalous patterns
Core Capabilities
| Domain |
Technologies |
| Secret Stores |
HashiCorp Vault 1.18, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault |
| Encryption |
SOPS 3.9, age, AWS KMS, GCP Cloud KMS, sealed-secrets |
| K8s Integration |
External Secrets Operator, Vault CSI Provider, Sealed Secrets controller |
| Rotation |
Vault dynamic secrets, AWS Lambda rotation, custom rotation functions |
| Audit |
Vault audit log, CloudTrail, access anomaly detection |
Architecture Patterns
External Secrets Operator (K8s Best Practice, 2026)
# ExternalSecret pulls from AWS Secrets Manager into K8s Secret
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: database-credentials
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: db-credentials # K8s Secret name
creationPolicy: Owner
data:
- secretKey: DB_PASSWORD
remoteRef:
key: prod/database/postgres
property: password
- secretKey: DB_USERNAME
remoteRef:
key: prod/database/postgres
property: username
Vault Dynamic Secrets (Zero Standing Credentials)
App requests credential → Vault generates ephemeral DB credential
├─ Credential has TTL (e.g., 1 hour)
├─ Vault creates DB user with scoped permissions
├─ App uses credential until near expiry
├─ Vault Agent auto-renews or rotates
└─ On expiry: Vault revokes DB user automatically
Result: No long-lived credentials exist. Every credential is:
- Unique to the requester
- Time-bounded
- Automatically revoked
- Fully audited
SOPS for Git-Encrypted Secrets
# Encrypt secrets file with age key (developer workflow)
sops --encrypt --age age1... secrets.yaml > secrets.enc.yaml
# Decrypt in CI/CD pipeline
export SOPS_AGE_KEY=$(vault kv get -field=age-key secret/ci/sops)
sops --decrypt secrets.enc.yaml > secrets.yaml
# .sops.yaml — defines encryption rules per path
creation_rules:
- path_regex: secrets\.yaml$
age: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
- path_regex: \.env\..*$
age: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
Anti-Patterns
- Secrets in environment variables at build time — Docker
ARG and ENV persist in image layers. Use runtime injection via sidecar, CSI driver, or entrypoint script.
- Shared service accounts — one credential used by multiple services. Use per-service identities with scoped permissions so compromise is isolated.
- No rotation — static credentials that never change. Implement automated rotation with overlap periods so active credentials always work.
- Secrets in Git — even in
.env.example with placeholder values that get real values committed. Use SOPS, sealed-secrets, or External Secrets Operator. Add .env* to .gitignore.
- Manual secret distribution — passing credentials via Slack, email, or shared drives. Use a secret store with RBAC and audit logging.
Quality Checklist
[ ] All secrets stored in a dedicated secret store (not config files)
[ ] No secrets in Docker image layers, Git history, or CI logs
[ ] Automated rotation enabled for database credentials
[ ] Secret access logged and auditable (Vault audit, CloudTrail)
[ ] Least privilege: each service has scoped access to only its secrets
[ ] SOPS or sealed-secrets used for any secrets committed to Git
[ ] Dynamic secrets preferred over static credentials
[ ] Secret TTLs set — no indefinite credentials
[ ] Emergency revocation procedure documented and tested
[ ] CI/CD uses short-lived tokens (OIDC federation), not long-lived keys
[ ] Developers cannot access production secrets from local machines
[ ] Secret sprawl inventory maintained and reviewed quarterly
1---
2license: Apache-2.0
3name: secret-management-expert
4description: 'Secret lifecycle management with Vault, AWS Secrets Manager, and rotation automation. Activate on: secret management, HashiCorp Vault, AWS Secrets Manager, secret rotation, SOPS, sealed secrets, credential management, API key storage, least privilege. NOT for: application auth flows (use oauth-oidc-implementer), network security (use security-auditor), encryption at rest (use devops-automator).'
5allowed-tools: Read,Write,Edit,Bash(docker:*,kubectl:*,terraform:*,npm:*,npx:*)
6category: Security
7tags:
8 - secrets
9 - security
10 - vault
11 - compliance
12pairs-with:
13 - skill: security-auditor
14 reason: Broad security audit includes secret management posture
15 - skill: environment-config-manager
16 reason: Config management must integrate with secret injection
17metadata:
18 source: https://skillmd.com/skills/curiositech/secret-management-expert
19---
20
21# Secret Management Expert
22
23Expert in secret lifecycle management — storage, rotation, injection, and audit — across cloud and self-hosted infrastructure.
24
25## Activation Triggers
26
27**Activate on:** "secret management", "Vault setup", "AWS Secrets Manager", "secret rotation", "SOPS encryption", "sealed secrets", "credential storage", "API key management", "least privilege secrets"
28
29**NOT for:** Application auth flows → `oauth-oidc-implementer` | Network security → `security-auditor` | Encryption at rest → `devops-automator`
30
31## Quick Start
32
331. **Inventory secrets** — catalog all credentials, API keys, certificates, and tokens
342. **Choose a backend** — Vault for self-hosted, AWS Secrets Manager/GCP Secret Manager for cloud-native
353. **Implement injection** — sidecar (Vault Agent), CSI driver, or init container pattern
364. **Enable rotation** — automated rotation with zero-downtime credential swaps
375. **Audit and alert** — log all secret access, alert on anomalous patterns
38
39## Core Capabilities
40
41| Domain | Technologies |
42|--------|-------------|
43| **Secret Stores** | HashiCorp Vault 1.18, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault |
44| **Encryption** | SOPS 3.9, age, AWS KMS, GCP Cloud KMS, sealed-secrets |
45| **K8s Integration** | External Secrets Operator, Vault CSI Provider, Sealed Secrets controller |
46| **Rotation** | Vault dynamic secrets, AWS Lambda rotation, custom rotation functions |
47| **Audit** | Vault audit log, CloudTrail, access anomaly detection |
48
49## Architecture Patterns
50
51### External Secrets Operator (K8s Best Practice, 2026)
52
53```yaml
54# ExternalSecret pulls from AWS Secrets Manager into K8s Secret
55apiVersion: external-secrets.io/v1
56kind: ExternalSecret
57metadata:
58 name: database-credentials
59spec:
60 refreshInterval: 1h
61 secretStoreRef:
62 name: aws-secrets-manager
63 kind: ClusterSecretStore
64 target:
65 name: db-credentials # K8s Secret name
66 creationPolicy: Owner
67 data:
68 - secretKey: DB_PASSWORD
69 remoteRef:
70 key: prod/database/postgres
71 property: password
72 - secretKey: DB_USERNAME
73 remoteRef:
74 key: prod/database/postgres
75 property: username
76```
77
78### Vault Dynamic Secrets (Zero Standing Credentials)
79
80```
81App requests credential → Vault generates ephemeral DB credential
82 ├─ Credential has TTL (e.g., 1 hour)
83 ├─ Vault creates DB user with scoped permissions
84 ├─ App uses credential until near expiry
85 ├─ Vault Agent auto-renews or rotates
86 └─ On expiry: Vault revokes DB user automatically
87
88Result: No long-lived credentials exist. Every credential is:
89 - Unique to the requester
90 - Time-bounded
91 - Automatically revoked
92 - Fully audited
93```
94
95### SOPS for Git-Encrypted Secrets
96
97```bash
98# Encrypt secrets file with age key (developer workflow)
99sops --encrypt --age age1... secrets.yaml > secrets.enc.yaml
100
101# Decrypt in CI/CD pipeline
102export SOPS_AGE_KEY=$(vault kv get -field=age-key secret/ci/sops)
103sops --decrypt secrets.enc.yaml > secrets.yaml
104
105# .sops.yaml — defines encryption rules per path
106creation_rules:
107 - path_regex: secrets\.yaml$
108 age: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
109 - path_regex: \.env\..*$
110 age: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
111```
112
113## Anti-Patterns
114
1151. **Secrets in environment variables at build time** — Docker `ARG` and `ENV` persist in image layers. Use runtime injection via sidecar, CSI driver, or entrypoint script.
1162. **Shared service accounts** — one credential used by multiple services. Use per-service identities with scoped permissions so compromise is isolated.
1173. **No rotation** — static credentials that never change. Implement automated rotation with overlap periods so active credentials always work.
1184. **Secrets in Git** — even in `.env.example` with placeholder values that get real values committed. Use SOPS, sealed-secrets, or External Secrets Operator. Add `.env*` to `.gitignore`.
1195. **Manual secret distribution** — passing credentials via Slack, email, or shared drives. Use a secret store with RBAC and audit logging.
120
121## Quality Checklist
122
123```
124[ ] All secrets stored in a dedicated secret store (not config files)
125[ ] No secrets in Docker image layers, Git history, or CI logs
126[ ] Automated rotation enabled for database credentials
127[ ] Secret access logged and auditable (Vault audit, CloudTrail)
128[ ] Least privilege: each service has scoped access to only its secrets
129[ ] SOPS or sealed-secrets used for any secrets committed to Git
130[ ] Dynamic secrets preferred over static credentials
131[ ] Secret TTLs set — no indefinite credentials
132[ ] Emergency revocation procedure documented and tested
133[ ] CI/CD uses short-lived tokens (OIDC federation), not long-lived keys
134[ ] Developers cannot access production secrets from local machines
135[ ] Secret sprawl inventory maintained and reviewed quarterly
136```