secrets-scanner
Skill4 starsChanged 7 months agoMITView on GitHub
Detect hardcoded secrets in source code, configuration files, and git history. This skill is language-agnostic and works on any text file regardless of programming language. Identify files likely to contain secrets across the entire repository. Include: - Source code files (all languages: .py, .js, .ts, .go, .java, .rb, .php, .rs, .cs, .c, .cpp, .swift, .kt, etc.) - Configuration files (.yml, .yaml, .json, .toml, .ini, .cfg, .conf, .xml, .properties) - Environment files (.env, .env.*, .envrc) - CI/CD configs (.github/workflows/*, .gitlab-ci.yml, Jenkinsfile,…
- Reads credentials
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- swap-cameroon/kuro-antigravity-configedited, first seen Nov 15, 2026
- BrivaHamisi/laravel-shipkittheir own version, first seen Sep 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- swap-cameroon/kuro-antigravity-config★ 296% same
Wrote their own version · 1
- BrivaHamisi/laravel-shipkit★ 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 repository8 other files it gives its agents.
- API Contract TestingSkill
- compliance-mapperSkill
- DAST ScannerSkill
- dependency-auditSkill
- llm-sast-scannerSkill
- remediation-validatorSkill
- security-auditSkill
- security-config-reviewSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Test fixture data that is explicitly marked as fake
- Very specific: line 33
Use the Grep tool to search identified files for regex patterns.
- Very specific: line 55
Search commit history for secrets that were added and later removed.
- Distinctive: line 57
Use the Bash tool to execute these git commands:
- Distinctive: line 76
Test files where secrets are explicitly marked as test fixtures
- Distinctive: line 84
Use entropy as a secondary signal, not a sole determinant
- Distinctive: line 99
Low: Test/dev keys (test API keys, development-only credentials, sandbox tokens)
- Very specific: line 103
Add the file pattern to .gitignore if applicable
- Distinctive: line 104
Use environment variables or secrets management instead of hardcoding
- Distinctive: line 122
Actionable output: Every finding must include a specific remediation step.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Secrets Scanner
Detect hardcoded secrets in source code, configuration files, and git history. This skill is language-agnostic and works on any text file regardless of programming language.
Workflow
Step 1: File Discovery
Identify files likely to contain secrets across the entire repository.
Include:
- Source code files (all languages:
.py,.js,.ts,.go,.java,.rb,.php,.rs,.cs,.c,.cpp,.swift,.kt, etc.) - Configuration files (
.yml,.yaml,.json,.toml,.ini,.cfg,.conf,.xml,.properties) - Environment files (
.env,.env.*,.envrc) - CI/CD configs (
.github/workflows/*,.gitlab-ci.yml,Jenkinsfile,.circleci/*,.travis.yml,azure-pipelines.yml,bitbucket-pipelines.yml) - Infrastructure files (
Dockerfile,docker-compose*.yml,Vagrantfile,terraform/*.tf,*.tfvars) - Shell scripts (
.sh,.bash,.zsh,.fish,.bat,.ps1,.cmd) - Build files (
Makefile,Rakefile,Gruntfile,gulpfile,webpack.config.*,package.json)
Exclude:
- Binary files (images, compiled objects, archives)
node_modules/,vendor/,.venv/,venv/,__pycache__/,.git/- Test fixture data that is explicitly marked as fake
- Lock files (
package-lock.json,yarn.lock,Gemfile.lock,poetry.lock,Cargo.lock) - Minified/bundled files (
*.min.js,*.bundle.js,dist/)
Step 2: Pattern Matching
Use the Grep tool to search identified files for regex patterns. Use the Read tool to load patterns from the secret_patterns.md reference file.
- Provider-specific patterns -- Match known secret formats:
- AWS keys starting with
AKIA - GitHub tokens starting with
ghp_,gho_,ghu_,ghs_ - Stripe keys starting with
sk_live_,pk_live_ - Slack tokens starting with
xoxb-,xoxp- - Private key headers (
-----BEGIN RSA PRIVATE KEY-----) - And all other patterns documented in
secret_patterns.md
- AWS keys starting with
- Generic high-entropy strings -- Detect secrets that don't match known provider patterns:
- Long hex strings (32+ chars) in assignment context
- Long base64 strings (40+ chars) in assignment context
- Password and API key variable assignments with literal string values
- Connection strings with embedded credentials
- Context-aware detection -- Check surrounding code for secret-indicating variable names:
password,passwd,pwd,secret,token,api_key,apikey,access_key,auth_token,credentials,private_key- Case-insensitive matching across naming conventions (snake_case, camelCase, UPPER_CASE)
Step 3: Git History Scanning
Search commit history for secrets that were added and later removed. Use the Read tool to load git_history_scanning.md for detailed techniques.
Use the Bash tool to execute these git commands:
- Diff search --
git log -p --all -S 'PATTERN'andgit log -p --all -G 'REGEX'to find secrets that appeared in any commit across all branches. - Deleted file recovery --
git log --diff-filter=D --name-onlyto find deleted files that may have contained secrets (e.g.,.envfiles committed before.gitignorewas set up). - Sensitive file history --
git log -p -- '*.env' '*.pem' '*.key' '*.yml' '*.json'to search history for changes to files commonly containing secrets. - Reflog inspection --
git reflogto check for force-pushed branches that may have contained secrets in now-orphaned commits. - Scan depth -- By default scan the last 200 commits. For thorough scans, search the full history.
Step 4: False Positive Filtering
Reduce noise by excluding findings that are clearly not real secrets.
Exclude:
- Placeholder values:
xxx,TODO,CHANGEME,changeme,REPLACE_ME,your-key-here,INSERT_HERE,<your_token>,example,sample - Obviously fake values:
test123,password123,abc123,foobar,dummy,fake,mock - Documentation domains:
example.com,example.org,test.com,localhost,127.0.0.1 - Template variables:
${VAR},{{ var }},%{var},<%= var %>,ENV['...'],os.environ[...],process.env. - Example/documentation files when values are clearly illustrative
.env.example,.env.sample,.env.templatefiles with placeholder values- Test files where secrets are explicitly marked as test fixtures
- Empty string assignments (
password = "",secret = '') - Comment-only references explaining what a variable should contain
Entropy check:
- Calculate Shannon entropy of candidate strings
- Real secrets typically have entropy > 3.5 bits per character
- Constants, code identifiers, and English words typically have entropy < 3.0
- Use entropy as a secondary signal, not a sole determinant
Step 5: Report
Generate a structured report of all findings.
For each finding, include:
- Location:
file:linefor current files, orcommit_hash (file:line)for git history findings - Secret type: The category of secret detected (e.g., "AWS Access Key", "GitHub PAT", "Database Connection String")
- Provider: The service provider if identifiable (e.g., AWS, GitHub, Stripe, Slack)
- Masked value: Show only first 4 and last 4 characters with masking (e.g.,
AKIA****WXYZ,ghp_****ab3f) - Risk level:
- Critical: Production keys with broad access (AWS root keys, admin tokens, private keys, database credentials for production)
- High: Keys with scoped access (scoped API tokens, service-specific keys, OAuth secrets)
- Medium: Internal tokens (internal service tokens, webhook URLs, CI/CD variables)
- Low: Test/dev keys (test API keys, development-only credentials, sandbox tokens)
- Remediation:
- Rotate the credential immediately with the provider
- Store in a secrets vault (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager)
- Add the file pattern to
.gitignoreif applicable - Use environment variables or secrets management instead of hardcoding
- For git history: rewrite history with
git filter-repoor BFG Repo-Cleaner, then force push - Set up pre-commit hooks to prevent future secret commits
Report structure:
- Executive summary: Total findings count by risk level, most critical findings highlighted
- Current file findings: Grouped by risk level (Critical first), then by file
- Git history findings: Grouped by risk level, including commit hash and date
- Recommendations: Prioritized list of remediation actions
- Prevention: Suggestions for preventing future secret leaks (pre-commit hooks, CI scanning,
.gitignoreimprovements)
Key Principles
- Never echo actual secret values -- Always mask secrets in the report. Show only the first 4 and last 4 characters with asterisks in between (e.g.,
AKIA****WXYZ). For short secrets (fewer than 12 characters), show only the first 2 and last 2 characters. - Prioritize by impact: committed secrets in current files > secrets visible in git history > secrets in example/template files
- Context-aware analysis: A
SECRET_KEYin.env.examplewith valuechangemeis not a finding. ASECRET_KEYin.envwith a 64-character hex string is a critical finding. - No false sense of security: Clearly state that automated scanning cannot catch all secrets. Recommend manual review for custom secret formats.
- Actionable output: Every finding must include a specific remediation step. Generic advice is not sufficient.
- Language-agnostic: This skill works on any text file. Do not assume any specific programming language or framework.
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
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.

