@fanioz/secretsweep
v1.0.0
Published
Zero-config secret scanning for staged git files — catch API keys before you push
Downloads
120
Maintainers
Readme
secretsweep
Zero-config secret scanning for staged git files — catch API keys before you push.
Install
npx secretsweepOr install globally:
npm install -g secretsweepUsage
Scan staged files (pre-commit friendly)
secretsweep
# or explicitly:
secretsweep stagedScans only files staged in git add — perfect for pre-commit hooks.
Scan a directory or file
secretsweep scan ./src
secretsweep scan ./config/production.jsonUse as a pre-commit hook
# .husky/pre-commit (or .git/hooks/pre-commit)
npx secretsweep stagedWhat it detects
| Category | Patterns | |---|---| | AWS | Access Keys (AKIA...), Secret Keys | | GitHub | Personal Access Tokens, OAuth, App Tokens | | GCP | API Keys, OAuth tokens, Service Account keys | | Azure | Connection Strings | | Stripe | Secret and Publishable Keys | | Slack | Bot tokens, Webhooks | | Database | MongoDB, PostgreSQL, MySQL, Redis URIs | | Generic | Bearer tokens, API keys, passwords, private keys | | Entropy | High-entropy strings that look like secrets |
Ignore false positives
Create a .secretsweepignore file:
# Ignore test fixtures
test/fixtures/
*.test.js
# Ignore specific files
examples/demo.jsWhy secretsweep?
Existing tools like gitleaks and truffleHog are powerful but enterprise-focused. secretsweep is:
- Zero config — works immediately, no setup files needed
- Fast — under 2 seconds for typical repos
- Git-aware — scans staged files by default, not your whole history
- Focused — catches secrets before they leave your machine
License
MIT
