|
| 1 | +title = "postgres-ai gitleaks config" |
| 2 | + |
| 3 | +[extend] |
| 4 | +# extend the default ruleset |
| 5 | +useDefault = true |
| 6 | + |
| 7 | +# GitLab token types — https://docs.gitlab.com/security/tokens/ |
| 8 | +[[rules]] |
| 9 | +id = "gitlab-pat" |
| 10 | +description = "GitLab Personal Access Token" |
| 11 | +regex = '''\bglpat-[A-Za-z0-9_-]{20,}\b''' |
| 12 | +tags = ["gitlab", "token"] |
| 13 | + |
| 14 | +[[rules]] |
| 15 | +id = "gitlab-runner-token" |
| 16 | +description = "GitLab Runner Registration Token" |
| 17 | +regex = '''\bglrt-[A-Za-z0-9_-]{20,}\b''' |
| 18 | +tags = ["gitlab", "token"] |
| 19 | + |
| 20 | +[[rules]] |
| 21 | +id = "gitlab-deploy-token" |
| 22 | +description = "GitLab Deploy Token" |
| 23 | +regex = '''\bgldt-[A-Za-z0-9_-]{20,}\b''' |
| 24 | +tags = ["gitlab", "token"] |
| 25 | + |
| 26 | +[[rules]] |
| 27 | +id = "gitlab-trigger-token" |
| 28 | +description = "GitLab Pipeline Trigger Token" |
| 29 | +regex = '''\bglptt-[A-Za-z0-9_-]{20,}\b''' |
| 30 | +tags = ["gitlab", "token"] |
| 31 | + |
| 32 | +[[rules]] |
| 33 | +id = "gitlab-oauth-app-secret" |
| 34 | +description = "GitLab OAuth Application Secret" |
| 35 | +regex = '''\bgloas-[A-Za-z0-9_-]{20,}\b''' |
| 36 | +tags = ["gitlab", "token"] |
| 37 | + |
| 38 | +[[rules]] |
| 39 | +id = "gitlab-scim-token" |
| 40 | +description = "GitLab SCIM Token" |
| 41 | +regex = '''\bglsoat-[A-Za-z0-9_-]{20,}\b''' |
| 42 | +tags = ["gitlab", "token"] |
| 43 | + |
| 44 | +[[rules]] |
| 45 | +id = "anthropic-api-key" |
| 46 | +description = "Anthropic API Key" |
| 47 | +regex = '''\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b''' |
| 48 | +tags = ["anthropic", "ai"] |
| 49 | + |
| 50 | +[[rules]] |
| 51 | +id = "anthropic-oauth-token" |
| 52 | +description = "Anthropic OAuth Token" |
| 53 | +regex = '''\bsk-ant-oat[0-9]{2}-[A-Za-z0-9_-]{20,}\b''' |
| 54 | +tags = ["anthropic", "ai"] |
| 55 | + |
| 56 | +[[rules]] |
| 57 | +id = "hetzner-api-token" |
| 58 | +description = "Hetzner Cloud API Token (variable assignment)" |
| 59 | +regex = '''(?i)\b(hetzner_token|hetzner_api_token|hetzner_api_key|hcloud_token|hcloud_api_key|hz_token)\b\s*[:=]\s*["']?[A-Za-z0-9_-]{60,}["']?''' |
| 60 | +tags = ["hetzner", "cloud"] |
| 61 | + |
| 62 | +# Global allowlist — gitleaks uses [[allowlists]] (array of tables) |
| 63 | +[[allowlists]] |
| 64 | +description = "False positives: test fixtures, example data, CI collections, rotated secrets" |
| 65 | + |
| 66 | +regexes = [ |
| 67 | + '''example\.com''', |
| 68 | + '''dummy[-_]?token''', |
| 69 | + '''fake[-_]?key''', |
| 70 | + '''test[-_]?secret''', |
| 71 | +] |
| 72 | + |
| 73 | +paths = [ |
| 74 | + # Unit test fixtures with dummy credentials |
| 75 | + '''cli/test/''', |
| 76 | + '''^spec/''', |
| 77 | + '''__tests__/''', |
| 78 | + # Postman collections (Stripe pk_test_ keys, recorded calls) |
| 79 | + '''\.ci/.*\.postman_collection\.json''', |
| 80 | + # Sqitch DB migration verification scripts (test JWTs, example secrets) |
| 81 | + '''db/verify/''', |
| 82 | + # Terraform test files (test passwords/credentials in .tftest.hcl) |
| 83 | + '''terraform/.*tests/''', |
| 84 | + '''terraform/.*\.tftest\.hcl$''', |
| 85 | + # GCP/AWS user_data scripts (cloud-init bootstrap, example credentials) |
| 86 | + '''terraform/.*/user_data\.sh$''', |
| 87 | + # Gitleaks test suites (intentionally contain synthetic secrets for rule testing) |
| 88 | + '''tests/gitleaks/fixtures/''', |
| 89 | + # Our own fixture directory |
| 90 | + '''tests/fixtures/gitleaks/''', |
| 91 | +] |
| 92 | + |
| 93 | +# Commit SHA allowlist: known rotated/revoked secrets pending history cleanup |
| 94 | +# glpat-tars3 token committed by bench-bot on 2026-02-25 — token already revoked (infra#20) |
| 95 | +commits = ["5fbe547dd4b4efb052d8642d0613ac3e32f1fb52"] |
0 commit comments