Automatically scan for secrets (API keys, tokens, passwords) before every git commit.
🇹🇼 正體中文
每次 git commit 自動掃描機敏資料(API keys、tokens、密碼)。
- 🔍 自動掃描 - 每次 commit 自動檢查,不需手動操作
- 🚫 阻擋提交 - 防止意外洩漏機敏資料
- 🌍 全域設定 - 一次設定,所有 repo 自動套用
- ⚡ 快速 - 使用 gitleaks 高效掃描
git clone https://github.com/seikaikyo/git-security-hooks.git
cd git-security-hooks
./install.shgit commit -m "your message"
│
▼
🔍 掃描機敏資料...
│
├─ 安全 → ✓ 安全檢查通過 → Commit 成功
└─ 有問題 → ⚠️ Commit 被阻止 → 修正後重試
git config --global --unset core.hooksPath🇯🇵 日本語
git commit のたびに機密情報(APIキー、トークン、パスワード)を自動スキャン。
- 🔍 自動スキャン - コミットごとに自動チェック、手動操作不要
- 🚫 コミットをブロック - 機密情報の漏洩を防止
- 🌍 グローバル設定 - 一度の設定ですべてのリポジトリに適用
- ⚡ 高速 - gitleaks による効率的なスキャン
git clone https://github.com/seikaikyo/git-security-hooks.git
cd git-security-hooks
./install.shgit commit -m "your message"
│
▼
🔍 機密情報をスキャン中...
│
├─ 安全 → ✓ セキュリティチェック通過 → コミット成功
└─ 問題あり → ⚠️ コミットをブロック → 修正して再試行
git config --global --unset core.hooksPath- 🔍 Automatic scanning - Every commit is scanned, no manual steps
- 🚫 Blocks commits - Prevents accidental secret leaks
- 🌍 Global setup - Works for all repositories on your machine
- ⚡ Fast - Uses gitleaks for efficient scanning
# Clone this repo
git clone https://github.com/seikaikyo/git-security-hooks.git
# Run installer
cd git-security-hooks
./install.shThat's it! All your git commits will now be scanned automatically.
git commit -m "your message"
│
▼
🔍 Scanning for secrets...
│
├─ Clean → ✓ Security check passed → Commit succeeds
│
└─ Has secrets → ⚠️ Commit blocked → Fix and retry
- API Keys (AWS, GCP, Azure, Vercel, Netlify, etc.)
- Access Tokens (GitHub, GitLab, npm, etc.)
- Private Keys (RSA, SSH, PGP)
- Passwords and secrets in config files
- Database connection strings
- And 100+ other patterns
# Install gitleaks
brew install gitleaks # macOS
# or see https://github.com/gitleaks/gitleaks#installation
# Set global hooks path
git config --global core.hooksPath /path/to/git-security-hooks/hooksIf you get a false positive:
git commit --no-verify -m "your message"git config --global --unset core.hooksPath- Git 2.9+ (for
core.hooksPathsupport) - gitleaks
Services like GitGuardian and GitHub Secret Scanning catch secrets after you push. This hook catches them before you commit - preventing the embarrassment and security risk entirely.
MIT
Made with ❤️ to prevent "oh no I pushed my API key" moments.