Secrets Management

Use when: handle credentials, keys, and tokens without leaking them into code, logs, or history.

kimtth e7c17e0 1.1 KB Updated

File contents

Goal: keep secrets out of source and accessible only to what needs them.

Use for:

  • storing API keys, passwords, and certificates
  • wiring secrets into apps and CI safely
  • responding to a leaked credential

Workflow:

  1. Keep secrets out of source control entirely.
  2. Load them from environment or a secrets manager at runtime.
  3. Scope each secret to least privilege.
  4. Rotate secrets regularly and on any suspicion of leak.
  5. Keep secrets out of logs, errors, and crash dumps.
  6. Scan the repo and history for accidental commits.

Practices:

  • a secrets manager or vault over plaintext files
  • per-environment secrets, never shared across stages
  • short-lived credentials where supported
  • pre-commit secret scanning

Rules:

  • never commit a secret; if you do, rotate it immediately
  • never log or echo secret values
  • grant least privilege and rotate on a schedule
  • do not pass secrets on the command line where they leak to history

kimtth/agent-skill-100-lines-or-less/tree/main/skills/secrets-management commit e7c17e087b

Frequently asked questions

npx skillmds@latest add kimtth/secrets-management