Security skill that scans code, config files, and repos for accidentally leaked secrets and credentials.
Use this skill when the user:
Detect 40+ secret patterns including:
Scan individual files, directories, or entire repos recursively
Ignore binary files, node_modules, .git, and other non-relevant paths
Output results as Markdown report or JSON
Provide severity ratings (Critical, High, Medium, Low)
Suggest remediation for each finding
bash
python secret_scanner.py /path/to/project
bash
python secret_scanner.py /path/to/project --json
bash
python secret_scanner.py /path/to/project --output report.md
text
"Scan this project for leaked secrets"
"Check if there are any API keys in the codebase"
"Run secret-scanner on the current directory"
"Find hardcoded passwords in my config files"
"Audit this repo before I push to GitHub"
ProviderSecrets DetectedAWSAccess Key ID ( AKIA...), Secret Access Key, Session TokenAzureStorage Account Key, Connection String, SAS Token, Client SecretGCPAPI Key ( AIza...), Service Account JSON, OAuth Client Secret
ServicePatternOpenAIsk- prefixed API keysAnthropicsk-ant- prefixed keysHugging Facehf_ prefixed tokensCohereAPI keys in config
PlatformSecrets DetectedGitHubghp_, gho_, ghu_, ghs_, ghr_ tokensGitLabglpat- tokensSlackxoxb-, xoxp-, xoxs- tokens, webhook URLsStripesk_live_, sk_test_, rk_live_ keysTwilioAccount SID, Auth TokenSendGridSG. prefixed API keys
TypePatternMongoDBmongodb:// or mongodb+srv:// with credentialsPostgreSQLpostgresql:// with embedded passwordMySQLmysql:// with embedded passwordRedisredis:// with passwordSSH-----BEGIN (RSA|EC|OPENSSH) PRIVATE KEY-----CertificatesPEM, PFX, P12 with embedded keys
PatternDescriptionpassword=Hardcoded passwords in config/env filessecret=Hardcoded secretstoken=Hardcoded tokensBearerBearer tokens in codeBasic AuthBase64-encoded basic auth headersJWTeyJ prefixed JWT tokensHigh EntropyLong random strings that look like secrets
SeverityDescriptionExamples🔴 CriticalActive production credentialsAWS Secret Key, Private Keys, DB passwords🟠 HighService tokens with broad accessGitHub PAT, Slack Bot Token, Stripe Live Key🟡 MediumKeys that may be test/devTest API keys, example tokens🟢 LowPotential false positivesGeneric password= in comments, placeholder values
Scans these file types by default:
.py, .js, .ts, .java, .go, .rb, .php, .cs, .rs.json, .yaml, .yml, .toml, .ini, .cfg, .conf.env, .env.local, .env.production.sh, .bash, .zsh, .ps1.md, .txtDockerfile, docker-compose.yml, MakefileAutomatically skips:
node_modules/, vendor/, venv/, .venv/.git/, .svn/__pycache__/, .pytest_cache/package-lock.json, yarn.lockWhen secrets are found, the skill recommends:
.env and credential files from being committedsecret_scanner.py#security #secrets #credentials #api-keys #tokens #passwords #scanner #audit #pre-commit #leak-detection #cloud #aws #azure #gcp #devops