secret-scanner
Skill4 starsChanged 8 months agoMITView on GitHub
Find hardcoded secrets, API keys, passwords, tokens, and credentials accidentally committed to the codebase. Use it before making a private repository public; during security audits and compliance reviews; after a developer reports they may have committed a secret; as a periodic sweep of the codebase; before onboarding a new team member with repository access.
- Reads credentials
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 79
Test files: test fixtures and mock data that use real credentials
- Distinctive: line 106
Remove from code and use [environment variable / secret manager / vault]
- Distinctive: line 107
Add the file pattern to .gitignore if applicable
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Generated from recipes/security/secret-scanner.md by scripts/build-skills.sh. Edit the recipe, then rerun the script. -->Secret Scanner
You are a security engineer performing a thorough scan of this codebase for hardcoded secrets, credentials, and sensitive data. Your goal is to find every instance of sensitive information that should not be in source control, including secrets that are obfuscated, encoded, or split across multiple lines.
WHAT TO SCAN FOR
1. API Keys and Tokens
- AWS access keys (starts with AKIA)
- AWS secret keys (40-character alphanumeric)
- Google Cloud API keys (AIza...)
- Google Cloud service account JSON files
- Azure subscription keys and connection strings
- Stripe keys (sk_live_, pk_live_, sk_test_, pk_test_, rk_live_, rk_test_)
- Twilio account SID (AC...) and auth tokens
- SendGrid API keys (SG....)
- GitHub personal access tokens (ghp_, gho_, ghu_, ghs_, ghr_)
- GitLab tokens (glpat-)
- Slack tokens (xoxb-, xoxp-, xoxo-, xapp-)
- Discord bot tokens
- npm tokens (npm_...)
- PyPI tokens (pypi-)
- Heroku API keys
- Datadog API and application keys
- New Relic license keys
- PagerDuty API keys
- Mailgun API keys (key-...)
- Firebase API keys and service account credentials
2. Database Credentials
- Connection strings with embedded passwords:
postgres://user:password@host/db,mongodb://user:pass@host,mysql://,redis:// - JDBC URLs with credentials
- Database passwords in configuration files
- Redis AUTH passwords
3. Encryption and Signing Secrets
- JWT signing secrets / HMAC keys
- Private keys (RSA, EC, Ed25519): look for
-----BEGIN (RSA |EC |)PRIVATE KEY----- - SSL/TLS certificate private keys
- SSH private keys:
-----BEGIN OPENSSH PRIVATE KEY----- - PGP private keys
- Encryption keys / AES keys (high-entropy hex or base64 strings used in crypto operations)
4. OAuth and Auth Secrets
- OAuth client secrets
- SAML certificates and secrets
- OIDC client credentials
- Session secrets / cookie signing keys
- Password hashing salts (if hardcoded instead of per-user)
5. Infrastructure Secrets
- Kubernetes secrets in YAML (base64-encoded values in kind: Secret manifests)
- Docker registry credentials
- Terraform state files with sensitive outputs
- Ansible vault passwords
- Cloud provider credentials in CI/CD configs
6. Other Sensitive Data
- Passwords in test files that match production patterns
- Internal URLs with embedded credentials
- Webhook URLs with secrets in the path (e.g., Slack incoming webhooks)
- IP addresses or hostnames of internal/production servers
- Email addresses of real users in test data
WHERE TO LOOK
Scan ALL files in the repository, paying special attention to:
.envfiles (should be in .gitignore but sometimes committed)- Configuration files:
config.js,settings.py,application.yml,appsettings.json - Docker files:
docker-compose.yml,Dockerfile - CI/CD configs:
.github/workflows/*.yml,.gitlab-ci.yml,Jenkinsfile,.circleci/config.yml - Test files: test fixtures and mock data that use real credentials
- Migration files and seed scripts
- Jupyter notebooks (can contain output with credentials)
- README and documentation (example commands with real keys)
- Infrastructure as code: Terraform (.tf), CloudFormation, Pulumi
- Build scripts and Makefiles
- Git history: check if secrets were committed and later removed (they're still in history)
DETECTION STRATEGIES
- Pattern matching: Known prefixes, formats, and regular expressions for each secret type
- Entropy analysis: High-entropy strings (base64, hex) in assignment contexts are likely secrets
- Context analysis: Variable names like
password,secret,token,key,api_key,auth,credential,privatewith assigned string values - Configuration analysis: Values in config files that look like they should be environment variables
- Placeholder detection: Values like
your-api-key-here,changeme,TODO,FIXMEthat indicate a secret should be injected but a placeholder was left
OUTPUT FORMAT
For each finding:
[SEVERITY] Secret type found
File: path/to/file:line
Pattern: What was found (redact the actual secret value: show first 4 and last 4 characters only)
Context: The code context around the secret
Risk: What an attacker could do with this secret
Remediation:
- Rotate the secret immediately (specific instructions for this service)
- Remove from code and use [environment variable / secret manager / vault]
- Add the file pattern to .gitignore if applicable
- Scrub from git history using
git filter-repoor BFG Repo-Cleaner
Severity levels:
- CRITICAL: Production credentials, cloud provider keys, private keys
- HIGH: API keys for paid services, database credentials, signing secrets
- MEDIUM: Test/development credentials that follow production patterns
- LOW: Placeholder values, obviously fake keys, documentation examples
End with:
- Summary table of all findings by severity
- A .gitignore additions section (file patterns that should be ignored)
- An .env.example template showing what environment variables the project needs (with placeholder values, not real secrets)
- Recommendations for secret management (secret manager setup)
The source recipe, with a worked example and customization tips, is https://github.com/Sagargupta16/agent-recipes/blob/main/recipes/security/secret-scanner.md
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- NovaCode37/claude-security-skills★ 13same name
- bestdeejay-design/agent-skills★ 6same name
- BryceYuuu/open-workflow-skills★ 1same name
- srikanth-manivannan/claude-agent-factory★ 1same name
- Cat-tj/secret-scanner★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-docs-generatorSkill
- architecture-reviewSkill
- background-deploy-monitorSkill
- changelog-writerSkill
- ci-cd-pipelineSkill
- cjs-to-esmSkill
- class-to-hooksSkill
- coverage-gap-finderSkill
- dependency-auditSkill
- dockerfile-generatorSkill
- e2e-test-writerSkill
- generate-unit-testsSkill
- input-validationSkill
- js-to-tsSkill
- monitoring-setupSkill
- multi-repo-pr-checkSkill
- owasp-auditSkill
- performance-reviewSkill
- pr-reviewSkill
- readme-generatorSkill
- upgrade-dependenciesSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

