|
| 1 | +# .gitleaks.toml |
| 2 | + |
| 3 | +[allowlist] |
| 4 | +description = "Allowlist for paths and commits that are known to be safe." |
| 5 | +paths = [ |
| 6 | + '''gitleaks.toml''', |
| 7 | + '''(.*?)(go.sum|go.mod|vendor)''', |
| 8 | + '''(.*?)(package.json|package-lock.json|npm-shrinkwrap.json)''', |
| 9 | + '''(.*?)(Pipfile|Pipfile.lock|poetry.lock)''', |
| 10 | + '''(.*?)(Gemfile.lock|gems.locked)''', |
| 11 | + '''(.*?)(Cargo.lock)''', |
| 12 | + '''(.*?)(yarn.lock)''', |
| 13 | + '''(.*?)(composer.lock)''', |
| 14 | + '''(.*?)(.snap)''', |
| 15 | + '''(.*?)(\.md|\.txt)''', # Documentation files |
| 16 | + '''env\.example''', # Example env files |
| 17 | + '''(.*?)test_.*\.py''', # Test files with fixtures |
| 18 | + '''(.*?)tests/fixtures/.*''', # Test fixtures |
| 19 | + '''deployment/scripts/.*''', # Deployment scripts with env var templates |
| 20 | + '''\.env\..*''', # Environment template files |
| 21 | +] |
| 22 | + |
| 23 | +# Stopwords to avoid false positives |
| 24 | +stopwords = [ |
| 25 | + "example", |
| 26 | + "sample", |
| 27 | + "test", |
| 28 | + "mock", |
| 29 | + "dummy", |
| 30 | + "placeholder", |
| 31 | +] |
| 32 | + |
| 33 | +[[rules]] |
| 34 | + id = "aws-access-token" |
| 35 | + description = "AWS Access Token" |
| 36 | + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' |
| 37 | + tags = ["key", "AWS"] |
| 38 | + |
| 39 | +[[rules]] |
| 40 | + id = "github-pat" |
| 41 | + description = "GitHub Personal Access Token" |
| 42 | + regex = '''ghp_[0-9a-zA-Z]{36}''' |
| 43 | + tags = ["key", "GitHub"] |
| 44 | + |
| 45 | +[[rules]] |
| 46 | + id = "github-fine-grained-pat" |
| 47 | + description = "GitHub Fine-Grained Personal Access Token" |
| 48 | + regex = '''github_pat_[0-9a-zA-Z]{22}_[0-9a-zA-Z]{59}''' |
| 49 | + tags = ["key", "GitHub"] |
| 50 | + |
| 51 | +[[rules]] |
| 52 | + id = "github-app-token" |
| 53 | + description = "GitHub App Token" |
| 54 | + regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}''' |
| 55 | + tags = ["key", "GitHub"] |
| 56 | + |
| 57 | +[[rules]] |
| 58 | + id = "github-refresh-token" |
| 59 | + description = "GitHub Refresh Token" |
| 60 | + regex = '''ghr_[0-9a-zA-Z]{76}''' |
| 61 | + tags = ["key", "GitHub"] |
| 62 | + |
| 63 | +[[rules]] |
| 64 | + id = "slack-token" |
| 65 | + description = "Slack Token" |
| 66 | + regex = '''xox[baprs]-([0-9a-zA-Z-]{10,48})?''' |
| 67 | + tags = ["key", "Slack"] |
| 68 | + |
| 69 | +[[rules]] |
| 70 | + id = "stripe-sk" |
| 71 | + description = "Stripe Secret Key" |
| 72 | + regex = '''sk_live_[0-9a-zA-Z]{24}''' |
| 73 | + tags = ["key", "Stripe"] |
| 74 | + |
| 75 | +[[rules]] |
| 76 | + id = "stripe-rk" |
| 77 | + description = "Stripe Restricted Key" |
| 78 | + regex = '''rk_live_[0-9a-zA-Z]{24}''' |
| 79 | + tags = ["key", "Stripe"] |
| 80 | + |
| 81 | +[[rules]] |
| 82 | + id = "private-key" |
| 83 | + description = "Private Key" |
| 84 | + regex = '''-----BEGIN ((EC|PGP|OPENSSH|RSA|DSA) )?PRIVATE KEY( BLOCK)?-----''' |
| 85 | + tags = ["key", "Asymmetric"] |
| 86 | + |
| 87 | +[[rules]] |
| 88 | + id = "watsonx-api-key" |
| 89 | + description = "WatsonX API Key" |
| 90 | + regex = '''(?i)(WATSONX_APIKEY|WATSONX_API_KEY)\s*[=:]\s*['"]?([a-zA-Z0-9_-]{32,})['"]?''' |
| 91 | + tags = ["key", "WatsonX"] |
| 92 | + |
| 93 | +[[rules]] |
| 94 | + id = "anthropic-api-key" |
| 95 | + description = "Anthropic API Key" |
| 96 | + regex = '''(?i)ANTHROPIC_API_KEY\s*[=:]\s*['"]?(sk-ant-[a-zA-Z0-9_-]{32,})['"]?''' |
| 97 | + tags = ["key", "Anthropic"] |
| 98 | + |
| 99 | +[[rules]] |
| 100 | + id = "mlflow-credentials" |
| 101 | + description = "MLFlow Credentials" |
| 102 | + regex = '''(?i)MLFLOW_TRACKING_(USERNAME|PASSWORD)\s*[=:]\s*['"]?([^'"\s]{3,})['"]?''' |
| 103 | + tags = ["credentials", "MLFlow"] |
| 104 | + |
| 105 | +[[rules]] |
| 106 | + id = "minio-credentials" |
| 107 | + description = "MinIO Credentials" |
| 108 | + regex = '''(?i)MINIO_ROOT_(USER|PASSWORD)\s*[=:]\s*['"]?([^'"\s]{3,})['"]?''' |
| 109 | + tags = ["credentials", "MinIO"] |
| 110 | + |
| 111 | +[[rules]] |
| 112 | + id = "postgres-password" |
| 113 | + description = "PostgreSQL Password" |
| 114 | + regex = '''(?i)(POSTGRES_PASSWORD|COLLECTIONDB_PASSWORD)\s*[=:]\s*['"]?([^'"\s]{3,})['"]?''' |
| 115 | + tags = ["password", "PostgreSQL"] |
| 116 | + |
| 117 | +[[rules]] |
| 118 | + id = "jwt-secret-key" |
| 119 | + description = "JWT Secret Key" |
| 120 | + regex = '''(?i)JWT_SECRET_KEY\s*[=:]\s*['"]?([a-zA-Z0-9_-]{32,})['"]?''' |
| 121 | + tags = ["secret", "JWT"] |
| 122 | + |
| 123 | +[[rules]] |
| 124 | + id = "high-entropy-strings" |
| 125 | + description = "High Entropy String (possible secret)" |
| 126 | + regex = '''[a-zA-Z0-9+/=]{32,}''' |
| 127 | + entropy = 4.5 |
| 128 | + tags = ["entropy"] |
0 commit comments