agentleFS
MohOneXMohOneX/claude-opus-skills/secrets-management-audit/SKILL.md

secrets-management-audit

Skill0 starsChanged 5 months agoMITView on GitHub

Audits how secrets (keys, tokens, passwords, certs) are stored, distributed, rotated, and exposed across a system. Use when reviewing credential handling, after a suspected leak, before an audit, or when secrets appear in code, configs, logs, or CI.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    The blast radius of one leak: if this single credential leaks, what does it unlock?

    line 27
  2. Very specific:

    Logs and telemetry: search logs/APM/error trackers for tokens, passwords, and auth headers — they leak into observability constantly.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Secrets Management Audit

A secret's lifetime of exposure, not its strength, determines the breach. A perfectly random key committed to git is worthless. Audit the full lifecycle: creation, storage, distribution, use, rotation, and revocation.

Find where secrets live (and where they leak)

  1. At rest: source code, config files, environment variables, container images/layers, IaC templates, CI/CD variables, and backups. Each is a place a secret gets copied and forgotten.
  2. In transit: how does a secret get to the service that needs it? Hardcoded, baked into the image, injected at runtime from a vault? Every hop is an exposure point.
  3. In flight / in use: secrets in process memory, in logs, in error messages, in URLs (query strings get logged everywhere), in client-side code (anything shipped to the browser is public).

The lifecycle controls

  • Generation: high-entropy, generated by the secret manager, never human-chosen for service credentials.
  • Storage: a dedicated secrets manager/vault with access control and audit logging — not env files checked into repos, not plaintext config.
  • Distribution: injected at runtime via short-lived credentials or workload identity, not baked into artifacts.
  • Rotation: routine and automated; the system must tolerate rotation without downtime. A secret that can't be rotated easily won't be after a leak.
  • Revocation: a leaked secret must be killable immediately. Long-lived static keys with no revocation path are the worst case.

Adversarial validation

  • Git history: secrets are often removed from HEAD but live forever in history (and in every clone/fork). Removing from the latest commit is not remediation — the secret is compromised and must be rotated.
  • The blast radius of one leak: if this single credential leaks, what does it unlock? Over-scoped, shared, and long-lived secrets turn one leak into total compromise. Prefer least-privilege, per-service, short-lived.
  • Logs and telemetry: search logs/APM/error trackers for tokens, passwords, and auth headers — they leak into observability constantly.
  • Client-side exposure: any secret in a mobile app, SPA bundle, or browser is already public; treat API keys shipped to clients as identifiers, not secrets.
  • CI/CD: build logs, PR-triggered workflows from forks, and over-broad pipeline tokens are a top leak vector.

Non-obvious risks

  • Encryption keys protecting secrets are themselves secrets — the chain bottoms out at a root of trust (HSM/KMS); a key encrypting keys stored next to them protects nothing.
  • Rotation without revoking the old value just adds a valid credential; old must be invalidated.
  • "It's only internal" secrets become external the moment one internal component is breached.

Output structure

Deliver: the inventory of where each secret class lives at rest/in transit/in use, the lifecycle gaps (generation, storage, rotation, revocation), the git-history and log/telemetry leak check, the blast radius per secret with least-privilege/short-lived recommendations, and an ordered remediation list (rotate-now items first).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.