security: add gitleaks pre-commit hook and CI scan#285
Merged
Conversation
Deploys org-wide secret-leak prevention following the 2026-04-17 Discord webhook URL incident (scraped from public karaoke-gen repo, used to spam malware in #releases). Layers: - .githooks/pre-commit — gitleaks protect --staged (fail fast) - .github/workflows/security.yml — reusable CI scanner - .gitleaks.toml — default rules + Discord-webhook rule + FP allowlist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds org-wide gitleaks secret-scanning in two layers:
.githooks/pre-commit) — blocks commits containing potential secrets before they're even created. Enable withgit config core.hooksPath .githooks..github/workflows/security.yml) — calls the reusable gitleaks workflow innomadkaraoke/.github, scans every PR and push tomain.Config:
.gitleaks.tomlextends the default gitleaks rules with a dedicated Discord-webhook rule and an allowlist for known false-positive paths (lockfiles, vendor/, node_modules/, Flutter.dart_tool/, WordPresswp-content/, Python test fixtures, Firebase/GCP client API keys).Why
Following the 2026-04-17 Discord webhook URL leak — a real webhook URL sat in
nomadkaraoke/karaoke-gen's archived setup docs for ~9 months, was scraped, and was used to push malware into the#releaseschannel.Existing defenses: GitHub push protection (enabled on all public repos). This PR adds the two missing layers (local pre-commit, CI).
Test plan
brew install gitleaks && git config core.hooksPath .githookslocally, then attempt the same commit — the pre-commit hook should block it.@coderabbitai ignore
🤖 Generated with Claude Code