Skip to content

Conversation

@vanman2024
Copy link
Owner

Security Enhancement

Add comprehensive credential protection to prevent API key exposure.

What's Added:

  1. .gitleaks.toml

    • Strict secret detection configuration
    • Custom rules for documentation files
    • Catches Google, Supabase, Clerk, Stripe keys
  2. scripts/sanitize-env-for-docs.sh

    • Sanitizes environment variables for documentation
    • Prevents real credentials in docs
    • Provides safe placeholders
  3. docs/CREDENTIAL-SAFETY.md

    • Complete security guidelines
    • Emergency response procedures
    • Best practices for doc generation
  4. .git-hooks/pre-commit

    • Pre-commit hook for gitleaks
    • Prevents committing secrets
    • Runs automatically before each commit

Setup:

After merging, team members should:

# Install gitleaks (one-time)
brew install gitleaks  # macOS
# or https://github.com/gitleaks/gitleaks

# Install pre-commit hook (one-time per repo)
cp .git-hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

For Doc Generators:

When creating documentation with API keys:

source scripts/sanitize-env-for-docs.sh
echo "GOOGLE_API_KEY=$SANITIZED_GOOGLE_API_KEY"
# Output: GOOGLE_API_KEY=your_google_api_key_here

🤖 Generated with Claude Code

Add security measures to prevent API key exposure:
- .gitleaks.toml: Strict secret detection config
- scripts/sanitize-env-for-docs.sh: Env var sanitization for docs
- docs/CREDENTIAL-SAFETY.md: Security guidelines and procedures
- .git-hooks/pre-commit: Pre-commit secret scanning hook

These measures prevent accidental commit of API keys, tokens, and other
credentials in documentation and code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vanman2024 vanman2024 merged commit 820bc57 into master Dec 25, 2025
1 check failed
@vanman2024 vanman2024 deleted the security/add-credential-protection branch December 25, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants