Agent skill
secrets-management
Safe handling of API keys, Vault/AWS Secrets Manager patterns, rotation.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/security-andreibesleaga-gabbe-11
SKILL.md
secrets-management Skill
This skill enforces the zero-trust handling of credentials.
1. The Core Commandments
- NEVER commit secrets to Git. (Not even encrypted, if possible).
- NEVER log secrets to stdout/files.
- LEAST PRIVILEGE: An App's DB user should not be
postgres(superuser).
2. Storage Patterns
Level 1: Environment Variables (.env)
- Dev:
.envfile (gitignored). - Prod: Injected by platform (Vercel/Heroku env vars).
- Risk: Shell history exposure, accidental printenv.
Level 2: Secret Ops (SOPS / Encrypted Git)
- Secrets stored in git but encrypted with KMS/PGP.
- Decrypted only at build/deploy time.
- Tool: Mozilla SOPS, git-crypt.
Level 3: Secret Manager (The Standard)
- AWS Secrets Manager, Google Secret Manager, HashiCorp Vault.
- App fetches secret at runtime via SDK or Sidecar.
- Pros: Rotation, Audit trails.
3. Secret Rotation
- Static Secrets (API Keys): Rotate every 90 days.
- Dynamic Secrets (Db Creds): Vault creates a credential per session that expires in 1h.
4. Detection (Pre-Commit)
- Use
gitleaksortrufflehogin CI/CD. - If a secret is committed:
- Revoke it immediately.
- Rotate the key.
- Rewrite git history (BFG Repo Cleaner) - optional but recommended.
5. Kubernetes Secrets
- Default K8s Secrets are base64 encoded (NOT encrypted).
- Requirement: Enable Encryption-at-Rest for etcd.
- Better: Use "External Secrets Operator" to sync from AWS/Vault.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?