security: add gitleaks secret scanning GitHub Action#2
Merged
Conversation
Adds gitleaks prevention layer to catch secrets on every push/PR. Custom ruleset detects n8n public-api JWTs, Supabase service-role keys, and Anthropic/OpenAI/Cohere/Resend API keys beyond gitleaks defaults. Placeholder tokens (ANTHROPIC_API_KEY, POSTGRES_CREDENTIAL_ID, etc.) are allowlisted to prevent false positives.
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 gitleaks secret scanning on every push + PR. Pure prevention layer — no existing issues to fix.
Scan baseline
This repo was scanned during a portfolio-wide audit. Came back clean — zero hardcoded tokens, zero internal infrastructure URLs, zero PII. The codebase already uses environment variables for all credentials (
ANTHROPIC_API_KEY,OPENAI_API_KEY,COHERE_API_KEY, Supabase keys via@supabase/ssr), which is the correct pattern.What's added
.gitleaks.toml— custom rulesetExtends gitleaks defaults with rules specific to this stack:
sk-...).envpaths)sk-ant-...)Allowlist prevents false positives on:
.env.exampletemplates[ANTHROPIC_API_KEY],sk-ant-YOUR_KEY.github/workflows/gitleaks.yml— GitHub ActionRuns on every push/PR across all branches. Posts findings to PR comments + GitHub Security tab.
Why this matters for RAG specifically
A leaked Supabase service-role key on a RAG app is worse than on a typical SaaS app: it bypasses all RLS policies, meaning an attacker with the key can read every workspace's documents and conversations — the entire knowledge base, across all tenants. The custom
supabase-service-role-keyrule specifically catches this.Test plan
sk-ant-ABC123...— verify Action catches it — then delete the branch🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com