Spaces:
Running
Running
TruffleHog backstop: soft-warn (flag for review) instead of hard-reject; drop FP Twilio regex
Browse files
scrub.py
CHANGED
|
@@ -84,7 +84,9 @@ SECRET_PATTERNS = [
|
|
| 84 |
("sendgrid_key", re.compile(r'\bSG\.[A-Za-z0-9_\-]{16,32}\.[A-Za-z0-9_\-]{16,64}\b')),
|
| 85 |
("npm_token", re.compile(r'\bnpm_[0-9A-Za-z]{36}\b')),
|
| 86 |
("pypi_token", re.compile(r'\bpypi-[A-Za-z0-9_\-]{16,}\b')),
|
| 87 |
-
|
|
|
|
|
|
|
| 88 |
("azure_storage_key", re.compile(r'\bAccountKey=[A-Za-z0-9+/=]{40,}')),
|
| 89 |
("slack_webhook", re.compile(r'https://hooks\.slack\.com/services/[A-Za-z0-9/_\-]+')),
|
| 90 |
("discord_webhook", re.compile(r'https://(?:canary\.|ptb\.)?discord(?:app)?\.com/api/webhooks/[0-9]+/[A-Za-z0-9_\-]+')),
|
|
|
|
| 84 |
("sendgrid_key", re.compile(r'\bSG\.[A-Za-z0-9_\-]{16,32}\.[A-Za-z0-9_\-]{16,64}\b')),
|
| 85 |
("npm_token", re.compile(r'\bnpm_[0-9A-Za-z]{36}\b')),
|
| 86 |
("pypi_token", re.compile(r'\bpypi-[A-Za-z0-9_\-]{16,}\b')),
|
| 87 |
+
# Twilio (SK + 32 hex) is deliberately NOT regexed here: the shape collides
|
| 88 |
+
# with ordinary hashes/IDs and would cause false redactions. TruffleHog's
|
| 89 |
+
# validated Twilio detector handles it on the server backstop instead.
|
| 90 |
("azure_storage_key", re.compile(r'\bAccountKey=[A-Za-z0-9+/=]{40,}')),
|
| 91 |
("slack_webhook", re.compile(r'https://hooks\.slack\.com/services/[A-Za-z0-9/_\-]+')),
|
| 92 |
("discord_webhook", re.compile(r'https://(?:canary\.|ptb\.)?discord(?:app)?\.com/api/webhooks/[0-9]+/[A-Za-z0-9_\-]+')),
|