Stops API key leaks by blocking commits with secrets before they reach GitHub.
Project description
LeakLock
Stop secrets before they reach GitHub.
LeakLock is a lightweight security tool that scans your code in real time and blocks commits containing API keys, tokens, or passwords.
It integrates with Git via a pre-commit hook, so secrets never leave your machine.
Features
- Scans staged files for common secret patterns (AWS keys, GitHub tokens, Slack tokens, etc.)
- Detects high-entropy strings that may indicate secrets
- Blocks commits automatically when secrets are found
- Works with the pre-commit framework for cross-platform support
Installation
Install from PyPI:
pip install leaklock
Or install from source:
git clone https://github.com/your-username/leaklock.git
cd leaklock
pip install -e .
Install pre-requesties:
pip install requirements.txt
Make sure you have ".pre-commit-config.yaml" file in your repo:
repos:
- repo: local
hooks:
- id: leaklock
name: LeakLock secret scanner
entry: leaklock
language: python
types: [file] # scan all files
files: '' # optional: can limit to staged files
Install the hook in your repo:
pre-commit install
This adds a Git pre-commit hook. Make a commit
Usage
Scan files manually:
leaklock
Run on all staged files before commit:
git add .
git commit -m "test commit"
If secrets are found → ❌ commit is blocked with a warning.
If clean → ✅ commit goes through.
🔑 Example Output
❌ Commit blocked by LeakLock (secrets detected):
- AWS Access Key ID detected in app/config.py:23
- Slack Token detected in utils/slack.py:10
Fix or remove these values before committing.
Contributing
Contributions are welcome!
- Fork the repo
- Create a feature branch (git checkout -b feature/new-scan)
- Submit a PR
License
MIT License © 2025 LeakLock Contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leaklock-0.1.0.tar.gz.
File metadata
- Download URL: leaklock-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fcca2a325ac28144db200f16ec5972ff7f950fe8bc44cfb99b76a4e4bdbfdb6
|
|
| MD5 |
8457a08b31a3e18816dad453e7a5ed8c
|
|
| BLAKE2b-256 |
8554beb73d8dde3d9caf1bc55afc0232492a71645188978dd6f2a449efcb4937
|
File details
Details for the file leaklock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: leaklock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d63b48f0d8e3901ca7a1268b38ec717705760b73032463f5b02012c7db23b345
|
|
| MD5 |
564728434bf13a328a92ab9bd8940049
|
|
| BLAKE2b-256 |
31327e09a3f247471af43d039ffcc71c231105afffbbd4384436c750ce3b6f18
|