secretsaudit
v1.0.0
Published
Zero-config CLI that scans node_modules for hardcoded secrets, API keys, tokens, and passwords
Maintainers
Readme
secretsaudit
Zero-config CLI that scans your node_modules for hardcoded secrets, API keys, tokens, and passwords.
npm audit checks for known vulnerabilities — secretsaudit checks if your dependencies are shipping secrets.
Install
npx secretsauditUsage
# Scan node_modules in current directory
npx secretsaudit
# Scan a specific project
npx secretsaudit --path /path/to/project
# JSON output for CI pipelines
npx secretsaudit --json
# Only show high severity findings
npx secretsaudit --severity high
# Ignore specific packages
npx secretsaudit --ignore some-package another-package
# Combine flags
npx secretsaudit --json --severity mediumWhat It Detects
| Category | Secrets |
|----------|---------|
| Cloud Providers | AWS keys, Google API keys, Azure keys, Heroku keys |
| GitHub | Personal access tokens, OAuth tokens, app tokens |
| Payment | Stripe keys, Twilio keys |
| Communication | Slack tokens/webhooks, Discord tokens, Telegram tokens |
| Database | MongoDB, PostgreSQL, MySQL, Redis connection URIs |
| Auth | Passwords, JWT secrets, bearer tokens, API keys |
| NPM | .npmrc auth tokens, registry tokens |
| Other | Private keys, SendGrid keys, Mailgun keys, Firebase URLs |
Why
npm auditchecks CVEs, not secrets in dependency codetrufflehog/gitleaksscan repos, not installednode_modulessecretsauditfills the gap — scans what's actually installed
Exit Codes
0— No secrets found1— Secrets found2— Error (nonode_modulesfound, etc.)
CI Integration
# GitHub Actions
- name: Audit dependencies for secrets
run: npx secretsaudit --json --severity mediumLicense
MIT
