|
| 1 | +title = "Shared monitor repos gitleaks config" |
| 2 | + |
| 3 | +[extend] |
| 4 | +useDefault = true |
| 5 | + |
| 6 | +[[rules]] |
| 7 | +id = "monitor-secret-assignment" |
| 8 | +description = "Detects monitor project secret assignments with lower entropy tolerance" |
| 9 | +path = '''(?i)(?:^|/)(?:\.env(?:\.[^/]+)?|[^/]+\.(?:py|env|ini|cfg|conf|toml|ya?ml|json|sh))$''' |
| 10 | +regex = '''(?i)\b(?:steam_api_key|github_token|lastfm_api_key|lastfm_api_secret|riot_api_key|psn_npsso|ms_app_client_secret|sp_app_client_secret|sp_user_client_secret|sp_client_secret|sp_dc_cookie|refresh_token|session_password|smtp_password|sp_sha256)\b(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|:{1,3}=|:|=>|\?=)[\s=]{0,3}[\x60'"]([^\x60'"\s#]{8,256})[\x60'"](?:[\x60'"\s;]|\\[nr]|$)''' |
| 11 | +secretGroup = 1 |
| 12 | +entropy = 3.1 |
| 13 | +keywords = [ |
| 14 | + "steam_api_key", |
| 15 | + "github_token", |
| 16 | + "lastfm_api_key", |
| 17 | + "lastfm_api_secret", |
| 18 | + "riot_api_key", |
| 19 | + "psn_npsso", |
| 20 | + "ms_app_client_secret", |
| 21 | + "sp_app_client_secret", |
| 22 | + "sp_user_client_secret", |
| 23 | + "sp_client_secret", |
| 24 | + "sp_dc_cookie", |
| 25 | + "refresh_token", |
| 26 | + "session_password", |
| 27 | + "smtp_password", |
| 28 | + "sp_sha256", |
| 29 | +] |
| 30 | + |
| 31 | +[[rules.allowlists]] |
| 32 | +description = "Skip placeholders and variable references" |
| 33 | +regexTarget = "secret" |
| 34 | +regexes = [ |
| 35 | + '''(?i)^your_[a-z0-9_]+$''', |
| 36 | + '''(?i)^example(?:_[a-z0-9_]+)?$''', |
| 37 | + '''(?i)^dummy(?:_[a-z0-9_]+)?$''', |
| 38 | + '''(?i)^changeme(?:_[a-z0-9_]+)?$''', |
| 39 | + '''(?i)^replace(?:_[a-z0-9_]+)?$''', |
| 40 | + '''(?i)^[a-z_][a-z0-9_]*(?:\.[a-z_][a-z0-9_]*)+$''', |
| 41 | + '''(?i)^[a-z_][a-z0-9_]*\([^\)]{0,80}\)$''', |
| 42 | + '''(?i)^<[^>]{1,64}>$''', |
| 43 | + '''(?i)^\$\{?[A-Z0-9_]{2,64}\}?$''', |
| 44 | + '''(?i)^\$\{?[a-z_][a-z0-9_]{1,63}\}?$''', |
| 45 | + '''(?i)^x{8,}$''', |
| 46 | + '''^_+$''', |
| 47 | +] |
0 commit comments