# Gitleaks configuration
# https://github.com/gitleaks/gitleaks
title = "MCP Server for Splunk - Gitleaks Configuration"
# Common patterns to detect secrets
[[rules]]
id = "generic-api-key"
description = "Generic API Key"
regex = '''(?i)(api[_-]?key|apikey)['\"]?\s*[:=]\s*['"]?([0-9a-zA-Z\-_]{20,})'''
tags = ["key", "API"]
[rules.allowlist]
paths = [
'''env\.example''',
'''\.md$''',
]
[[rules]]
id = "splunk-token"
description = "Splunk Authentication Token"
regex = '''(?i)(splunk[_-]?token)['\"]?\s*[:=]\s*['"]?([0-9a-zA-Z\-_]{32,})'''
tags = ["splunk", "token"]
[[rules]]
id = "splunk-password"
description = "Splunk Password"
regex = '''(?i)(splunk[_-]?password)['\"]?\s*[:=]\s*['"]?([^\s'"]{8,})'''
tags = ["splunk", "password"]
[rules.allowlist]
paths = [
'''env\.example''',
'''README\.md''',
'''docs/.*\.md''',
]
[[rules]]
id = "aws-access-key"
description = "AWS Access Key"
regex = '''AKIA[0-9A-Z]{16}'''
tags = ["aws", "key"]
[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''(?i)aws[_-]?secret[_-]?access[_-]?key['\"]?\s*[:=]\s*['"]?([0-9a-zA-Z/+=]{40})'''
tags = ["aws", "secret"]
[[rules]]
id = "github-token"
description = "GitHub Personal Access Token"
regex = '''ghp_[0-9a-zA-Z]{36}'''
tags = ["github", "token"]
[[rules]]
id = "github-oauth"
description = "GitHub OAuth Token"
regex = '''gho_[0-9a-zA-Z]{36}'''
tags = ["github", "oauth"]
[[rules]]
id = "private-key"
description = "Private Key"
regex = '''-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----'''
tags = ["key", "private"]
[[rules]]
id = "generic-credential"
description = "Generic Credential"
regex = '''(?i)(password|passwd|pwd|secret|token)['\"]?\s*[:=]\s*['"]?([^\s'"\n]{8,})'''
tags = ["credential"]
[rules.allowlist]
paths = [
'''env\.example''',
'''\.md$''',
'''test.*\.py$''',
'''.*_test\.py$''',
]
regexes = [
'''password.*=.*\$\{.*\}''', # Environment variable references
'''password.*=.*os\.getenv''', # Python env var
'''password.*=.*"<.*>"''', # Placeholder
]
# Global allowlist
[allowlist]
paths = [
'''\.git/''',
'''\.venv/''',
'''/node_modules/''',
'''uv\.lock''',
'''package-lock\.json''',
'''\.pytest_cache/''',
'''\.mypy_cache/''',
]
regexes = [
'''(?i)EXAMPLE''',
'''(?i)REPLACE[_-]WITH''',
'''(?i)YOUR[_-](API|KEY|TOKEN|SECRET|PASSWORD)''',
'''(?i)<.*>''', # Placeholders in angle brackets
'''(?i)\$\{.*\}''', # Environment variable references
]
descriptions = [
'''(?i)example''',
'''(?i)test''',
'''(?i)placeholder''',
]