leak-proof
v1.1.0
Published
Zero-config Git pre-commit hook that blocks secrets (AWS keys, API tokens, .env files) from being committed. Auto-installs for your entire team.
Downloads
312
Maintainers
Readme
leak-proof 🛡️
Stop accidental secret leaks before they leave your laptop.
Leak-Proof is a zero-config CLI that blocks you from committing
.envfiles or hardcoded secrets (AWS keys, Tokens, Private Keys).
🚨 Security Notice
⚠️ CRITICAL UPDATE (v1.1.0): If you are using v1.0.x, upgrade immediately.
What was fixed:
- [CRITICAL] Staging area bypass vulnerability - secrets in Git's index could be bypassed by modifying the working directory
- [HIGH] Memory crash on large files (500MB+ SQL dumps, binaries)
How to upgrade:
npm install leak-proof@latest --save-dev✨ Features
- 🔒 Automatic Secret Detection - Instantly spots AWS keys, private keys, and generic secrets in staged files.
- 👥 Team-Wide Protection - Auto-installs for every team member via
npm install. No manual setup required. - 🎨 Beautiful CLI - Clear, colored output with actionable security alerts.
- ⚡ Zero Config - Best-practice security defaults out of the box.
- 🛡️ Smart Filtering - Intelligently ignores binary files, lock files, and safe assets.
🚀 For Users
Installation
Install leak-proof as a development dependency in your project:
npm install leak-proof --save-devQuick Start
Initialize in your project:
npx leak-proof initThis sets up the necessary Git hooks and configuring your project for safety.
Commit as usual:
git add . git commit -m "feat: amazing new feature"That's it! If you accidentally stage a file with secrets (like
.envor a hardcoded API key),leak-proofwill block the commit and show you exactly what needs to be fixed.
How it Works
- You run
npx leak-proof init. - A
preparescript is added to yourpackage.json. - When your teammates pull the code and run
npm install, the hooks are automatically set up for them too. - Everyone is protected effectively immediately. 🎉
💻 For Developers & Contributors
We welcome contributions! Whether you're fixing a bug, improving the docs, or adding a new secret pattern, here's how to get started.
Development Setup
Clone the repository:
git clone https://github.com/sayan365/leak-proof.git cd leak-proofInstall dependencies:
npm installLink locally: This allows you to test your local changes as if they were an installed global package.
npm linkNow you can run the
leak-proofcommand anywhere in your terminal to test your changes.Verify your setup: Run the help command to see if your local version is active:
leak-proof --help
🤝 Contributing
We love contributions! Here's how you can help make Leak-Proof better:
- Fork & Clone the repository.
- Create a Branch for your feature (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'feat: add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request and describe your changes.
💡 Note: Validation is currently manual. Please run the scanner against dummy files to verify your changes before submitting.
🔍 Security Checks
File Patterns Blocked
.env.env.local,.env.test,.env.production, etc.
Secrets Detected
- AWS Access Keys:
AKIA... - Private Keys:
-----BEGIN PRIVATE KEY----- - Generic Secrets:
api_key = "..."auth_token: "..."client_secret = "..."
🚦 Bypassing Checks (False Positives)
Sometimes you need to commit a dummy key for testing purposes. You have two options:
Force Commit (Emergency)
If you need to bypass the entire hook for a specific commit:
git commit -m "fixing stuff" --no-verify🗑️ Uninstalling
If you want to remove Leak-Proof from your project, run:
npx leak-proof removeThis cleans up the git hooks and removes the scripts from your package.json.
👨💻 Author
Built with ❤️ by Sayan.
