|
| 1 | +# Gitleaks configuration for cc-polymath |
| 2 | +# This configuration file helps prevent false positives while maintaining security |
| 3 | + |
| 4 | +title = "cc-polymath gitleaks config" |
| 5 | + |
| 6 | +[extend] |
| 7 | +# Use default gitleaks rules as baseline |
| 8 | +useDefault = true |
| 9 | + |
| 10 | +[allowlist] |
| 11 | +description = "Allowlist for false positives in documentation and test examples" |
| 12 | + |
| 13 | +# Allowlist paths - documentation and example files |
| 14 | +paths = [ |
| 15 | + # Documentation files showing security anti-patterns |
| 16 | + '''skills/SECURITY\.md''', |
| 17 | + '''skills/security/.*\.md''', |
| 18 | + '''skills/api/.*\.md''', |
| 19 | + '''skills/cryptography/.*\.md''', |
| 20 | + '''skills/protocols/.*\.md''', |
| 21 | + '''skills/rust/.*/resources/REFERENCE\.md''', |
| 22 | + |
| 23 | + # Work notes and production readiness docs |
| 24 | + '''\.work/.*\.md''', |
| 25 | + |
| 26 | + # Test and example files |
| 27 | + '''.*/resources/scripts/README\.md''', |
| 28 | + '''.*/examples/.*''', |
| 29 | + '''.*/tests/.*''', |
| 30 | +] |
| 31 | + |
| 32 | +# Allowlist specific regex patterns for false positives |
| 33 | +regexes = [ |
| 34 | + # WebSocket handshake keys (not secrets, part of protocol) |
| 35 | + '''Sec-WebSocket-Key: [A-Za-z0-9+/=]+''', |
| 36 | + |
| 37 | + # Test tokens clearly marked as examples or test-only |
| 38 | + '''TOKEN="eyJhbGciOi.*".*# Test token''', |
| 39 | + '''token.*=.*"eyJhbGciOi.*".*test''', |
| 40 | + |
| 41 | + # Example API keys clearly marked as bad examples |
| 42 | + '''API_KEY = "sk-live-EXAMPLE_BAD".*# Never hardcode''', |
| 43 | + '''API_KEY = "sk_test_[^"]*".*# Hardcoded - example''', |
| 44 | + '''API_KEY = "sk_test_[^"]*".*# Example of what''', |
| 45 | + |
| 46 | + # Password examples in security documentation |
| 47 | + '''password = "EXAMPLE_BAD_PASSWORD".*# Never hardcode''', |
| 48 | + '''DB_PASSWORD="example123"''', |
| 49 | + '''API_KEY="my-secret-key"''', |
| 50 | + |
| 51 | + # Generic test/example markers |
| 52 | + '''API_KEY = "[^"]*".*# Real API key''', # Ironically, in docs showing what NOT to do |
| 53 | + '''expired_token = "[^"]*".*# Test token''', |
| 54 | +] |
| 55 | + |
| 56 | +# Allowlist specific commits (if needed for historical reasons) |
| 57 | +# commits = [] |
| 58 | + |
| 59 | +# Allowlist specific stopwords - words/phrases that indicate false positives |
| 60 | +stopwords = [ |
| 61 | + "example", |
| 62 | + "test", |
| 63 | + "sample", |
| 64 | + "placeholder", |
| 65 | + "your-secret-key", |
| 66 | + "EXAMPLE_BAD", |
| 67 | + "test_password_for_local_dev_only", |
| 68 | +] |
0 commit comments