|
| 1 | +title = "Gitleaks config for theangrytech repos" |
| 2 | +description = "Targets JS, Terraform, Python, Cloud configs, secrets, and Git metadata" |
| 3 | +version = "2" |
| 4 | +redact = false # Show actual secrets in alerts |
| 5 | + |
| 6 | +[config] |
| 7 | +logLevel = "INFO" |
| 8 | + |
| 9 | +#Scan these specific file types |
| 10 | +[[config.pathAllowlist]] |
| 11 | +description = "Only scan selected file extensions" |
| 12 | +regexes = [ |
| 13 | + ".*\\.js$", |
| 14 | + ".*\\.jsx$", |
| 15 | + ".*\\.ts$", |
| 16 | + ".*\\.tsx$", |
| 17 | + ".*\\.exe$", |
| 18 | + ".*\\.dll$", |
| 19 | + ".*\\.py$", |
| 20 | + ".*\\.tf$", |
| 21 | + ".*\\.json$", |
| 22 | + ".*\\.yml$", |
| 23 | + ".*\\.yaml$", |
| 24 | + ".*\\.dockerfile$", |
| 25 | + ".*\\.template$", |
| 26 | + ".*\\.bicep$" |
| 27 | +] |
| 28 | + |
| 29 | +########################## |
| 30 | +#Common Secret Rules # |
| 31 | +########################## |
| 32 | + |
| 33 | +[[rules]] |
| 34 | +id = "aws-access-key" |
| 35 | +description = "AWS Access Key" |
| 36 | +regex = '''(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}''' |
| 37 | +tags = ["AWS", "key"] |
| 38 | + |
| 39 | +[[rules]] |
| 40 | +id = "aws-secret-key" |
| 41 | +description = "AWS Secret Access Key" |
| 42 | +regex = '''(?i)aws(.{0,20})?(secret|access)?(.{0,20})?['\"=:\s]{1,10}[0-9a-zA-Z/+]{40}''' |
| 43 | +tags = ["AWS", "secret"] |
| 44 | + |
| 45 | +[[rules]] |
| 46 | +id = "azure-client-secret" |
| 47 | +description = "Azure Client Secret" |
| 48 | +regex = '''(?i)(azure)?.*(client)?.*(secret)[\"'=:\s]{1,10}[0-9a-zA-Z\-_.]{20,100}''' |
| 49 | +tags = ["Azure", "secret"] |
| 50 | + |
| 51 | +[[rules]] |
| 52 | +id = "azure-storage-key" |
| 53 | +description = "Azure Storage Account Key" |
| 54 | +regex = '''(?i)(DefaultEndpointsProtocol=.*;AccountName=.*;AccountKey=.*;EndpointSuffix=.*)''' |
| 55 | +tags = ["Azure", "storage"] |
| 56 | + |
| 57 | +[[rules]] |
| 58 | +id = "terraform-password" |
| 59 | +description = "Hardcoded password in Terraform or cloud config" |
| 60 | +regex = '''(?i)(administrator_login_password|password)[^=:.]{0,20}[:=][ \t]*["']?[a-z0-9=_\-]{8,45}["']?''' |
| 61 | +tags = ["terraform", "password"] |
| 62 | + |
| 63 | +[[rules]] |
| 64 | +id = "jwt-token" |
| 65 | +description = "JWT Token" |
| 66 | +regex = '''\beyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+''' |
| 67 | +tags = ["token", "jwt"] |
| 68 | + |
| 69 | +[[rules]] |
| 70 | +id = "generic-secret" |
| 71 | +description = "Generic token/password/apiKey" |
| 72 | +regex = '''(?i)(key|api|token|secret|client|passwd|password|auth|access)[^=:.]{0,20}[:=][ \t]*["']?[a-z0-9-_]{10,150}["']?''' |
| 73 | +tags = ["generic", "secret"] |
| 74 | + |
| 75 | +[[rules]] |
| 76 | +id = "private-key" |
| 77 | +description = "Private Key" |
| 78 | +regex = '''-----BEGIN( RSA| DSA| EC)? PRIVATE KEY-----''' |
| 79 | +tags = ["key", "private"] |
| 80 | + |
| 81 | +[[rules]] |
| 82 | +id = "github-pat" |
| 83 | +description = "GitHub Personal Access Token" |
| 84 | +regex = '''gh[pousr]_[A-Za-z0-9_]{36}''' |
| 85 | +tags = ["github", "token"] |
| 86 | + |
| 87 | +[[rules]] |
| 88 | +id = "slack-webhook" |
| 89 | +description = "Slack Webhook URL" |
| 90 | +regex = '''https://hooks.slack.com/services/T[A-Z0-9]{8}/B[A-Z0-9]{8}/[a-zA-Z0-9]{24}''' |
| 91 | +tags = ["slack", "webhook"] |
| 92 | + |
| 93 | +########################## |
| 94 | +# Git Metadata Rules # |
| 95 | +########################## |
| 96 | + |
| 97 | +[[rules]] |
| 98 | +id = "git-commit-email" |
| 99 | +description = "Exposed Git email in commit" |
| 100 | +regex = '''[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}''' |
| 101 | +tags = ["git", "email"] |
| 102 | +entropy = false |
| 103 | + |
| 104 | +[[rules]] |
| 105 | +id = "git-author-name" |
| 106 | +description = "Git author name (example detection)" |
| 107 | +regex = '''(?i)(author|committer):\s*["']?([a-z0-9_\- ]{3,})["']?''' |
| 108 | +tags = ["git", "name"] |
| 109 | +entropy = false |
| 110 | + |
| 111 | +########################## |
| 112 | +# Allowlist false positives |
| 113 | +########################## |
| 114 | + |
| 115 | +[allowlist] |
| 116 | +description = "Ignore known non-sensitive files" |
| 117 | +files = [ |
| 118 | + "test/", |
| 119 | + "tests/", |
| 120 | + "docs/", |
| 121 | + ".github/", |
| 122 | + "README.md" |
| 123 | +] |
| 124 | + |
| 125 | +[allowlist.regexes] |
| 126 | +"dummy-api-key" = "dummy_[a-zA-Z0-9]{10,}" |
0 commit comments