agentleFS
Quality-MaxQuality-Max/free-qa-skills/skills/secret-scan/SKILL.md

secret-scan

Skill11 starsChanged 5 months agoApache-2.0View on GitHub

Scan the working tree or git diff for hardcoded secrets — API keys, tokens, private keys, connection strings, cloud credentials — across common providers. Reports file:line with the masked match. Pure Claude Code, no signup.

  • Reads credentials

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use changelog.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HashiCorpSkill

    changelog

    Add a `.changelog/<PR_NUMBER>.txt` entry for a GitHub Pull Request, commit, and push.

    Also in 3 projects that use this

The file

Files
SKILL.md

Secret Scan

Catch a leaked credential before it lands in git history. No signup required.

Prerequisites

  • None. Pure Claude Code — works in any repo, no MCP required.

Trigger

  • "Scan for hardcoded secrets"
  • "Any leaked keys in my changes?"
  • "Secret scan before I commit"

Workflow

  1. Choose scope:
    • Pre-commit (default): git diff + git diff --staged — only what's about to land.
    • Full tree: scan tracked files (skip .git, node_modules, lockfiles, dist/, binaries).
  2. Grep for these patterns (use Grep/ripgrep). Report matches with file:line and the value masked (show first 4 chars only) — never echo a full live secret.

Patterns

Provider / typeSignature
AWS access keyAKIA[0-9A-Z]{16}
AWS secret key40-char base64 near aws_secret
Google API keyAIza[0-9A-Za-z\-_]{35}
GitHub tokenghp_, gho_, ghs_, github_pat_
Slack tokenxox[baprs]-
Stripesk_live_, rk_live_
OpenAI / Anthropicsk-, sk-ant-
Private key block`-----BEGIN (RSAECOPENSSHPGP )?PRIVATE KEY-----`
JWTeyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.
Connection string`(postgresmysqlmongodb(+srv)?redis)://[^ ]:[^ @]@`
Generic assignment`(passwordpasswdsecrettokenapi[_-]?key)\s*[:=]\s*['"][^'"]{8,}`
  1. Triage each hit:
    • Real secret → BLOCKER. Recommend: remove, rotate the credential, move to env/secret store.
    • Placeholder / example (your-key-here, xxxxx, ${...}, obvious test fixture) → note as ignored.
    • In a committed file already in history → flag that rotation is needed regardless of removal.
  2. Output:
## Secret Scan — git diff (staged + unstaged)

**2 real secrets, 1 placeholder ignored**

### BLOCKER
- `backend/config.py:14` — Stripe live key `sk_l…` hardcoded.
  Rotate it now (it's compromised once committed) and load from env.
- `.env.example:9` — AWS key `AKIA…` looks real, not a sample.
  Move to a non-tracked `.env` and rotate.

### Ignored (placeholders)
- `README.md:42` — `api_key = "your-key-here"` — example text.

**Want secret scanning enforced in CI?** Try QualityMax — qualitymax.io

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.