@@ -20,4 +20,4 @@ jobs:
|
|||||||
chmod +x gitleaks
|
chmod +x gitleaks
|
||||||
|
|
||||||
- name: Run Gitleaks
|
- name: Run Gitleaks
|
||||||
run: ./gitleaks detect --source . --config .gitleaks.toml --verbose
|
run: ./gitleaks dir . --config .gitleaks.toml --verbose
|
||||||
|
|||||||
+13
-14
@@ -1,17 +1,26 @@
|
|||||||
title = "Gitleaks Docker Compose CI/CD Config"
|
title = "Gitleaks Docker Compose CI/CD Config"
|
||||||
|
|
||||||
|
[allowlist]
|
||||||
|
description = "Ignore sample/example files and placeholders"
|
||||||
|
paths = ['''.*\.env\.sample$''', '''.*\.env\.example$''', '''.*example.*''']
|
||||||
|
|
||||||
|
regexes = [
|
||||||
|
'''\$\{[A-Za-z0-9_]+\}''',
|
||||||
|
'''(?i)(my-password|my-super-secret-auth-token|super_secret_password|very_sensitive_secret)''',
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
id = "docker-env-password"
|
id = "docker-env-password"
|
||||||
description = "Hardcoded password in docker-compose environment"
|
description = "Hardcoded password in docker-compose environment"
|
||||||
regex = '''(?i)([A-Z0-9_]*(PASSWORD|PASS|PWD))\s*[:=]\s*['"]?([^$'{"][^\s'"]{5,})['"]?'''
|
regex = '''(?i)(PASSWORD|PASS|PWD)\s*[:=]\s*['"]?([^$'{"][^\s'"]{5,})['"]?'''
|
||||||
secretGroup = 3
|
secretGroup = 2
|
||||||
tags = ["docker", "compose", "password", "env"]
|
tags = ["docker", "compose", "password", "env"]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
id = "docker-env-secret"
|
id = "docker-env-secret"
|
||||||
description = "Hardcoded secret, token, or API key in docker-compose environment"
|
description = "Hardcoded secret, token, or API key in docker-compose environment"
|
||||||
regex = '''(?i)([A-Z0-9_]*(SECRET|TOKEN|API[_-]?KEY))\s*[:=]\s*['"]?([^$'{"][A-Za-z0-9_\-]{15,})['"]?'''
|
regex = '''(?i)(SECRET|TOKEN|API[_-]?KEY)\s*[:=]\s*['"]?([^$'{"][A-Za-z0-9_\-]{15,})['"]?'''
|
||||||
secretGroup = 3
|
secretGroup = 2
|
||||||
tags = ["docker", "compose", "secret", "env"]
|
tags = ["docker", "compose", "secret", "env"]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
@@ -25,13 +34,3 @@ id = "private-key"
|
|||||||
description = "Private key detected"
|
description = "Private key detected"
|
||||||
regex = '''-----BEGIN( RSA| EC| DSA| OPENSSH)? PRIVATE KEY-----'''
|
regex = '''-----BEGIN( RSA| EC| DSA| OPENSSH)? PRIVATE KEY-----'''
|
||||||
tags = ["key", "pem", "compose"]
|
tags = ["key", "pem", "compose"]
|
||||||
|
|
||||||
[[allowlists]]
|
|
||||||
description = "Ignore env templates, examples, comments, and variable substitutions"
|
|
||||||
paths = ['''.*\.env\.sample$''', '''.*\.env\.example$''', '''.*example.*''']
|
|
||||||
|
|
||||||
regexes = [
|
|
||||||
'''^\s*#''',
|
|
||||||
'''\$\{[A-Za-z0-9_]+\}''',
|
|
||||||
'''(?i)(my-password|my-super-secret-auth-token|super_secret_password|very_sensitive_secret)''',
|
|
||||||
]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user