timecs 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app.py +3014 -0
- ast_scanner.py +36187 -0
- banner.py +146 -0
- ci_reporter.py +570 -0
- cli.py +2347 -0
- config_loader.py +307 -0
- cross_file_engine.py +1781 -0
- delivery_models.py +145 -0
- delivery_repository.py +78 -0
- diff_scan.py +127 -0
- durable_delivery_sink.py +103 -0
- event_bus.py +155 -0
- event_publisher.py +345 -0
- event_taxonomy.py +313 -0
- function_summarizer.py +354 -0
- html_auditor.py +274 -0
- iac_auditor.py +400 -0
- in_app_adapter.py +115 -0
- js_scanner.py +895 -0
- manifest_parser.py +960 -0
- master_rules_bank.py +389 -0
- notification_models.py +346 -0
- notification_policy.py +309 -0
- notification_repository.py +118 -0
- notification_routes.py +394 -0
- notification_service.py +199 -0
- osv_client.py +437 -0
- remediation/__init__.py +39 -0
- remediation/base.py +102 -0
- remediation/contracts.py +196 -0
- remediation/cwe1188_binding.py +78 -0
- remediation/cwe1336_jinja.py +91 -0
- remediation/cwe22_path_traversal.py +348 -0
- remediation/cwe295_ssl.py +87 -0
- remediation/cwe327_weak_hash.py +78 -0
- remediation/cwe377_tempfile.py +77 -0
- remediation/cwe489_debug.py +80 -0
- remediation/cwe502_yaml.py +89 -0
- remediation/cwe614_cookie.py +91 -0
- remediation/cwe78_cmdi.py +415 -0
- remediation/cwe798_credentials.py +153 -0
- remediation/cwe89_sqli.py +425 -0
- remediation/cwe916_password_hash.py +131 -0
- remediation/cwe95_eval.py +77 -0
- remediation/dispatcher.py +114 -0
- remediation/orchestrator.py +541 -0
- remediation/patch_engine.py +213 -0
- remediation/verification.py +253 -0
- rule_engine.py +1535 -0
- sarif_adapter.py +719 -0
- sarif_exporter.py +88 -0
- sca_reachability/__init__.py +28 -0
- sca_reachability/ast_analyzer.py +366 -0
- sca_reachability/call_graph.py +203 -0
- sca_reachability/contracts.py +365 -0
- sca_reachability/dist_import_map.py +46 -0
- sca_reachability/engine.py +603 -0
- sca_reachability/resolver.py +169 -0
- scanners/__init__.py +70 -0
- scanners/container_scanner.py +323 -0
- scanners/cve_index.py +521 -0
- scanners/iac_scanner.py +328 -0
- scanners/sbom.py +183 -0
- scanners/sca_scanner.py +667 -0
- scanners/secret_scanner.py +345 -0
- scanners/yaml_lite.py +217 -0
- secret_filters.py +435 -0
- secret_scanner.py +943 -0
- sqlite_delivery_repository.py +277 -0
- sqlite_notification_repository.py +441 -0
- ssrf_guard.py +276 -0
- staged_scanner.py +492 -0
- suppression_resolver.py +282 -0
- symbol_indexer.py +424 -0
- tcs/__init__.py +1 -0
- tcs/analysis/__init__.py +1 -0
- tcs/analysis/def_use.py +408 -0
- tcs/analysis/function_contracts.py +290 -0
- tcs/parallel_analyzer.py +276 -0
- tcs/parallel_scanner.py +630 -0
- tcs/treesitter_packer.py +1446 -0
- tcs_cli.py +2086 -0
- tcs_config.py +218 -0
- tcs_gui.py +2123 -0
- timecs-2.0.0.dist-info/METADATA +142 -0
- timecs-2.0.0.dist-info/RECORD +94 -0
- timecs-2.0.0.dist-info/WHEEL +5 -0
- timecs-2.0.0.dist-info/entry_points.txt +4 -0
- timecs-2.0.0.dist-info/licenses/LICENSE +201 -0
- timecs-2.0.0.dist-info/top_level.txt +49 -0
- version_matcher.py +934 -0
- webhook_adapter.py +495 -0
- webhook_client.py +483 -0
- webhook_formatters.py +245 -0
master_rules_bank.py
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Master Security Rules & Signatures Bank for TimeCodeSecurity.
|
|
3
|
+
Consolidated Registry:
|
|
4
|
+
- Full Gitleaks Ruleset (120+ Cloud, AI, VCS, Finance, & SaaS Signatures)
|
|
5
|
+
- Gitleaks Official Allowlists & Stopwords (False-Positive Suppression)
|
|
6
|
+
- PyCQA Bandit & CodeQL Enterprise Sinks (39 AST Injection Sinks)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# =====================================================================
|
|
10
|
+
# 1. BANDIT & CODEQL ENTERPRISE CODE SINKS (AST Engine)
|
|
11
|
+
# =====================================================================
|
|
12
|
+
ENTERPRISE_SINKS_BANK = {
|
|
13
|
+
# CWE-502: Insecure Deserialization & Socket Injection
|
|
14
|
+
"pickle.loads": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
15
|
+
"pickle.load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
16
|
+
"_pickle.loads": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
17
|
+
"_pickle.load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
18
|
+
"yaml.load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
19
|
+
"yaml.unsafe_load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
20
|
+
"shelve.open": {"cwe": "CWE-502", "severity": "HIGH"},
|
|
21
|
+
"marshal.loads": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
22
|
+
"torch.load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
23
|
+
"logging.config.listen": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
24
|
+
# Pickle/dill serialization produces payloads that are unsafe to deserialize;
|
|
25
|
+
# flagged as the attack surface that enables CWE-502 on the receiving side.
|
|
26
|
+
"pickle.dumps": {"cwe": "CWE-502", "severity": "HIGH"},
|
|
27
|
+
"_pickle.dumps": {"cwe": "CWE-502", "severity": "HIGH"},
|
|
28
|
+
"dill.loads": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
29
|
+
"dill.load": {"cwe": "CWE-502", "severity": "CRITICAL"},
|
|
30
|
+
"dill.dumps": {"cwe": "CWE-502", "severity": "HIGH"},
|
|
31
|
+
|
|
32
|
+
# CWE-22: Path Traversal & Archive Slip
|
|
33
|
+
"shutil.rmtree": {"cwe": "CWE-22", "severity": "HIGH"},
|
|
34
|
+
"zipfile.ZipFile.extractall": {"cwe": "CWE-22", "severity": "CRITICAL", "type": "receiver"},
|
|
35
|
+
"tarfile.TarFile.extractall": {"cwe": "CWE-22", "severity": "CRITICAL", "type": "receiver"},
|
|
36
|
+
"tarfile.extractall": {"cwe": "CWE-22", "severity": "CRITICAL"},
|
|
37
|
+
|
|
38
|
+
# CWE-79: Sanitization Bypass / XSS
|
|
39
|
+
"markupsafe.Markup": {"cwe": "CWE-79", "severity": "HIGH"},
|
|
40
|
+
"django.utils.safestring.mark_safe": {"cwe": "CWE-79", "severity": "HIGH"},
|
|
41
|
+
|
|
42
|
+
# CWE-295: Broken TLS / Insecure Transport & Host Key Verification
|
|
43
|
+
"paramiko.client.AutoAddPolicy": {"cwe": "CWE-295", "severity": "HIGH"},
|
|
44
|
+
"paramiko.AutoAddPolicy": {"cwe": "CWE-295", "severity": "HIGH"},
|
|
45
|
+
"ssl._create_unverified_context": {"cwe": "CWE-295", "severity": "HIGH"},
|
|
46
|
+
"urllib3.disable_warnings": {"cwe": "CWE-295", "severity": "MEDIUM"},
|
|
47
|
+
|
|
48
|
+
# CWE-918: Server-Side Request Forgery (SSRF)
|
|
49
|
+
"urllib.request.urlopen": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
50
|
+
"requests.get": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
51
|
+
"requests.post": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
52
|
+
"requests.put": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
53
|
+
"httpx.get": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
54
|
+
"httpx.post": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
55
|
+
"aiohttp.ClientSession.get": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
56
|
+
"aiohttp.ClientSession.post": {"cwe": "CWE-918", "severity": "HIGH"},
|
|
57
|
+
|
|
58
|
+
# CWE-611: XML External Entity (XXE)
|
|
59
|
+
"xml.etree.ElementTree.fromstring": {"cwe": "CWE-611", "severity": "HIGH"},
|
|
60
|
+
"xml.dom.minidom.parseString": {"cwe": "CWE-611", "severity": "HIGH"},
|
|
61
|
+
"xml.dom.minidom.parse": {"cwe": "CWE-611", "severity": "HIGH"},
|
|
62
|
+
"lxml.etree.fromstring": {"cwe": "CWE-611", "severity": "HIGH"},
|
|
63
|
+
"lxml.etree.parse": {"cwe": "CWE-611", "severity": "HIGH"},
|
|
64
|
+
|
|
65
|
+
# CWE-601: Open Redirect
|
|
66
|
+
"flask.redirect": {"cwe": "CWE-601", "severity": "MEDIUM"},
|
|
67
|
+
"django.shortcuts.redirect": {"cwe": "CWE-601", "severity": "MEDIUM"},
|
|
68
|
+
|
|
69
|
+
# CWE-1333 / CWE-400: Regex Injection / ReDoS / Resource Exhaustion
|
|
70
|
+
"re.compile": {"cwe": "CWE-1333", "severity": "MEDIUM"},
|
|
71
|
+
"regex.compile": {"cwe": "CWE-1333", "severity": "MEDIUM"},
|
|
72
|
+
"re.search": {"cwe": "CWE-400", "severity": "MEDIUM"},
|
|
73
|
+
"re.match": {"cwe": "CWE-400", "severity": "MEDIUM"},
|
|
74
|
+
|
|
75
|
+
# CWE-327 / CWE-328: Broken Crypto & Hashing
|
|
76
|
+
"hashlib.md5": {"cwe": "CWE-327", "severity": "MEDIUM"},
|
|
77
|
+
"hashlib.sha1": {"cwe": "CWE-327", "severity": "MEDIUM"},
|
|
78
|
+
"Crypto.Cipher.DES.new": {"cwe": "CWE-327", "severity": "HIGH"},
|
|
79
|
+
"Crypto.Cipher.DES": {"cwe": "CWE-327", "severity": "HIGH"},
|
|
80
|
+
"DES.new": {"cwe": "CWE-327", "severity": "HIGH"},
|
|
81
|
+
|
|
82
|
+
# CWE-338: Insecure Randomness for Security Contexts
|
|
83
|
+
"random.random": {"cwe": "CWE-338", "severity": "MEDIUM"},
|
|
84
|
+
"random.randint": {"cwe": "CWE-338", "severity": "MEDIUM"},
|
|
85
|
+
"random.choice": {"cwe": "CWE-338", "severity": "MEDIUM"},
|
|
86
|
+
"random.randrange": {"cwe": "CWE-338", "severity": "MEDIUM"},
|
|
87
|
+
"random.sample": {"cwe": "CWE-338", "severity": "MEDIUM"},
|
|
88
|
+
|
|
89
|
+
# CWE-1336: SSTI (Server-Side Template Injection)
|
|
90
|
+
"jinja2.Template": {"cwe": "CWE-1336", "severity": "HIGH"},
|
|
91
|
+
"mako.template.Template": {"cwe": "CWE-1336", "severity": "HIGH"},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# =====================================================================
|
|
95
|
+
# 2. FULL GITLEAKS OFFICIAL SIGNATURES (120+ SECRETS)
|
|
96
|
+
# =====================================================================
|
|
97
|
+
GITLEAKS_SECRETS_BANK = {
|
|
98
|
+
# 1Password & Authress
|
|
99
|
+
"1password-secret-key": r"\bA3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\b",
|
|
100
|
+
"1password-service-account-token": r"ops_eyJ[a-zA-Z0-9+/]{250,}={0,3}",
|
|
101
|
+
"authress-service-client-access-key": r"\b((?:sc|ext|scauth|authress)_(?i)[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.(?-i:acc)[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120})",
|
|
102
|
+
|
|
103
|
+
# AI Platforms
|
|
104
|
+
"adafruit-api-key": r"(?i)[\w.-]{0,50}?(?:adafruit)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9_-]{32})",
|
|
105
|
+
"anthropic-admin-api-key": r"\b(sk-ant-admin01-[a-zA-Z0-9_\-]{93}AA)\b",
|
|
106
|
+
"anthropic-api-key": r"\b(sk-ant-api03-[a-zA-Z0-9_\-]{93}AA)\b",
|
|
107
|
+
"cohere-api-token": r"[\w.-]{0,50}?(?i:[\w.-]{0,50}?(?:cohere|CO_API_KEY)(?:[ \t\w.-]{0,20})[\s'\"]{0,3})(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-zA-Z0-9]{40})",
|
|
108
|
+
"huggingface-access-token": r"\b(hf_(?i:[a-z]{34}))\b",
|
|
109
|
+
"huggingface-organization-api-token": r"\b(api_org_(?i:[a-z]{34}))\b",
|
|
110
|
+
"openai-api-key": r"\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})",
|
|
111
|
+
"perplexity-api-key": r"\b(pplx-[a-zA-Z0-9]{48})\b",
|
|
112
|
+
"privateai-api-token": r"[\w.-]{0,50}?(?i:[\w.-]{0,50}?(?:private[_-]?ai)(?:[ \t\w.-]{0,20})[\s'\"]{0,3})(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
113
|
+
|
|
114
|
+
# Adobe, Age & Airtable
|
|
115
|
+
"adobe-client-id": r"(?i)[\w.-]{0,50}?(?:adobe)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{32})",
|
|
116
|
+
"adobe-client-secret": r"\b(p8e-(?i)[a-z0-9]{32})",
|
|
117
|
+
"age-secret-key": r"AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}",
|
|
118
|
+
"airtable-api-key": r"(?i)[\w.-]{0,50}?(?:airtable)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{17})",
|
|
119
|
+
"airtable-personnal-access-token": r"\b(pat[[:alnum:]]{14}\.[a-f0-9]{64})\b",
|
|
120
|
+
"algolia-api-key": r"(?i)[\w.-]{0,50}?(?:algolia)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
121
|
+
|
|
122
|
+
# Cloud Giants: Alibaba, AWS, Azure, GCP
|
|
123
|
+
"alibaba-access-key-id": r"\b(LTAI(?i)[a-z0-9]{20})\b",
|
|
124
|
+
"alibaba-secret-key": r"(?i)[\w.-]{0,50}?(?:alibaba)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{30})",
|
|
125
|
+
"aws-access-token": r"\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\b",
|
|
126
|
+
"aws-amazon-bedrock-api-key-long-lived": r"\b(ABSK[A-Za-z0-9+/]{109,269}={0,2})\b",
|
|
127
|
+
"aws-amazon-bedrock-api-key-short-lived": r"bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29t",
|
|
128
|
+
"azure-ad-client-secret": r"(?:^|[\\'\x60\s>=:(,)])([a-zA-Z0-9_~.]{3}\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\'\x60\s<),])",
|
|
129
|
+
"gcp-api-key": r"\b(AIza[\w-]{35})\b",
|
|
130
|
+
|
|
131
|
+
# Artifactory, Asana, Atlassian, Beamer
|
|
132
|
+
"artifactory-api-key": r"\bAKCp[A-Za-z0-9]{69}\b",
|
|
133
|
+
"artifactory-reference-token": r"\bcmVmd[A-Za-z0-9]{59}\b",
|
|
134
|
+
"asana-client-id": r"(?i)[\w.-]{0,50}?(?:asana)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9]{16})",
|
|
135
|
+
"asana-client-secret": r"(?i)[\w.-]{0,50}?(?:asana)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
136
|
+
"atlassian-api-token": r"(?i)[\w.-]{0,50}?(?:(?-i:ATLASSIAN|[Aa]tlassian)|(?-i:CONFLUENCE|[Cc]onfluence)|(?-i:JIRA|[Jj]ira))(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{20}[a-f0-9]{4})|\b(ATATT3[A-Za-z0-9_\-=]{186})",
|
|
137
|
+
"beamer-api-token": r"(?i)[\w.-]{0,50}?(?:beamer)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(b_[a-z0-9=_\-]{44})",
|
|
138
|
+
|
|
139
|
+
# Bitbucket, Bittrex, Cisco, Clickhouse, Clojars
|
|
140
|
+
"bitbucket-client-id": r"(?i)[\w.-]{0,50}?(?:bitbucket)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
141
|
+
"bitbucket-client-secret": r"(?i)[\w.-]{0,50}?(?:bitbucket)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{64})",
|
|
142
|
+
"bittrex-access-key": r"(?i)[\w.-]{0,50}?(?:bittrex)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
143
|
+
"bittrex-secret-key": r"(?i)[\w.-]{0,50}?(?:bittrex)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
144
|
+
"cisco-meraki-api-key": r"[\w.-]{0,50}?(?i:[\w.-]{0,50}?(?:(?-i:[Mm]eraki|MERAKI))(?:[ \t\w.-]{0,20})[\s'\"]{0,3})(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{40})",
|
|
145
|
+
"clickhouse-cloud-api-secret-key": r"\b(4b1d[A-Za-z0-9]{38})\b",
|
|
146
|
+
"clojars-api-token": r"(?i)CLOJARS_[a-z0-9]{60}",
|
|
147
|
+
|
|
148
|
+
# Cloudflare, Codecov, Coinbase, Confluent, Contentful, cURL
|
|
149
|
+
"cloudflare-api-key": r"(?i)[\w.-]{0,50}?(?:cloudflare)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9_-]{40})",
|
|
150
|
+
"cloudflare-global-api-key": r"(?i)[\w.-]{0,50}?(?:cloudflare)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{37})",
|
|
151
|
+
"cloudflare-origin-ca-key": r"\b(v1\.0-[a-f0-9]{24}-[a-f0-9]{146})\b",
|
|
152
|
+
"codecov-access-token": r"(?i)[\w.-]{0,50}?(?:codecov)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
153
|
+
"coinbase-access-token": r"(?i)[\w.-]{0,50}?(?:coinbase)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9_-]{64})",
|
|
154
|
+
"confluent-access-token": r"(?i)[\w.-]{0,50}?(?:confluent)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{16})",
|
|
155
|
+
"confluent-secret-key": r"(?i)[\w.-]{0,50}?(?:confluent)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{64})",
|
|
156
|
+
"contentful-delivery-api-token": r"(?i)[\w.-]{0,50}?(?:contentful)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{43})",
|
|
157
|
+
"curl-auth-header": r"\bcurl\b(?:.*?|.*?(?:[\r\n]{1,2}.*?){1,5})[ \t\n\r](?:-H|--header)(?:=|[ \t]{0,5})(?:\"(?i)(?:Authorization:[ \t]{0,5}(?:Basic[ \t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \t]([\w=~@.+/-]{8,})|([\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \t]{0,5}([\w=~@.+/-]{8,}))\"|'(?i)(?:Authorization:[ \t]{0,5}(?:Basic[ \t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \t]([\w=~@.+/-]{8,})|([\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \t]{0,5}([\w=~@.+/-]{8,}))')",
|
|
158
|
+
"curl-auth-user": r"\bcurl\b(?:.*|.*(?:[\r\n]{1,2}.*){1,5})[ \t\n\r](?:-u|--user)(?:=|[ \t]{0,5})(\"(:[^\"]{3,}|[^:\"]{3,}:|[^:\"]{3,}:[^\"]{3,})\"|'([^:']{3,}:[^']{3,})'|((?:\"[^\"]{3,}\"|'[^']{3,}'|[\w$@.-]+):(?:\"[^\"]{3,}\"|'[^']{3,}'|[\w${}@.-]+)))",
|
|
159
|
+
|
|
160
|
+
# Databricks, Datadog, Defined Networking, DigitalOcean, Discord, Doppler, DroneCI
|
|
161
|
+
"databricks-api-token": r"\b(dapi[a-f0-9]{32}(?:-\d)?)\b",
|
|
162
|
+
"datadog-access-token": r"(?i)[\w.-]{0,50}?(?:datadog)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{40})",
|
|
163
|
+
"defined-networking-api-token": r"(?i)[\w.-]{0,50}?(?:dnkey)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52})",
|
|
164
|
+
"digitalocean-access-token": r"\b(doo_v1_[a-f0-9]{64})\b",
|
|
165
|
+
"digitalocean-pat": r"\b(dop_v1_[a-f0-9]{64})\b",
|
|
166
|
+
"digitalocean-refresh-token": r"(?i)\b(dor_v1_[a-f0-9]{64})\b",
|
|
167
|
+
"discord-api-token": r"(?i)[\w.-]{0,50}?(?:discord)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{64})",
|
|
168
|
+
"discord-client-id": r"(?i)[\w.-]{0,50}?(?:discord)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9]{18})",
|
|
169
|
+
"discord-client-secret": r"(?i)[\w.-]{0,50}?(?:discord)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{32})",
|
|
170
|
+
"doppler-api-token": r"dp\.pt\.(?i)[a-z0-9]{43}",
|
|
171
|
+
"droneci-access-token": r"(?i)[\w.-]{0,50}?(?:droneci)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
172
|
+
|
|
173
|
+
# Dropbox, Duffel, Dynatrace, EasyPost, Etsy, Facebook, Fastly, Finicity, Finnhub, Flickr
|
|
174
|
+
"dropbox-api-token": r"(?i)[\w.-]{0,50}?(?:dropbox)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{15})",
|
|
175
|
+
"dropbox-long-lived-api-token": r"(?i)[\w.-]{0,50}?(?:dropbox)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43})",
|
|
176
|
+
"dropbox-short-lived-api-token": r"(?i)[\w.-]{0,50}?(?:dropbox)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(sl\.[a-z0-9\-=_]{135})",
|
|
177
|
+
"duffel-api-token": r"duffel_(?:test|live)_(?i)[a-z0-9_\-=]{43}",
|
|
178
|
+
"dynatrace-api-token": r"dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}",
|
|
179
|
+
"easypost-api-token": r"\bEZAK(?i)[a-z0-9]{54}\b",
|
|
180
|
+
"easypost-test-api-token": r"\bEZTK(?i)[a-z0-9]{54}\b",
|
|
181
|
+
"etsy-access-token": r"(?i)[\w.-]{0,50}?(?:(?-i:ETSY|[Ee]tsy))(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{24})",
|
|
182
|
+
"facebook-access-token": r"(?i)\b(\d{15,16}(\||%)[0-9a-z\-_]{27,40})",
|
|
183
|
+
"facebook-page-access-token": r"\b(EAA[MC](?i)[a-z0-9]{100,})",
|
|
184
|
+
"facebook-secret": r"(?i)[\w.-]{0,50}?(?:facebook)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{32})",
|
|
185
|
+
"fastly-api-token": r"(?i)[\w.-]{0,50}?(?:fastly)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{32})",
|
|
186
|
+
"finicity-api-token": r"(?i)[\w.-]{0,50}?(?:finicity)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{32})",
|
|
187
|
+
"finicity-client-secret": r"(?i)[\w.-]{0,50}?(?:finicity)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{20})",
|
|
188
|
+
"finnhub-access-token": r"(?i)[\w.-]{0,50}?(?:finnhub)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{20})",
|
|
189
|
+
"flickr-access-token": r"(?i)[\w.-]{0,50}?(?:flickr)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{32})",
|
|
190
|
+
|
|
191
|
+
# Flutterwave, Fly.io, Frame.io, Freemius, Freshbooks
|
|
192
|
+
"flutterwave-encryption-key": r"FLWSECK_TEST-(?i)[a-h0-9]{12}",
|
|
193
|
+
"flutterwave-public-key": r"FLWPUBK_TEST-(?i)[a-h0-9]{32}-X",
|
|
194
|
+
"flutterwave-secret-key": r"FLWSECK_TEST-(?i)[a-h0-9]{32}-X",
|
|
195
|
+
"flyio-access-token": r"\b((?:fo1_[\w-]{43}|fm1[ar]_[a-zA-Z0-9+\/]{100,}={0,3}|fm2_[a-zA-Z0-9+\/]{100,}={0,3}))",
|
|
196
|
+
"frameio-api-token": r"fio-u-(?i)[a-z0-9\-_=]{64}",
|
|
197
|
+
"freemius-secret-key": r"(?i)[\"']secret_key[\"']\s*=>\s*[\"'](sk_[\S]{29})[\"']",
|
|
198
|
+
"freshbooks-access-token": r"(?i)[\w.-]{0,50}?(?:freshbooks)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{64})",
|
|
199
|
+
|
|
200
|
+
# GitHub (5 Rules)
|
|
201
|
+
"github-app-token": r"(?:ghu|ghs)_[0-9a-zA-Z]{36}",
|
|
202
|
+
"github-fine-grained-pat": r"github_pat_\w{82}",
|
|
203
|
+
"github-oauth": r"gho_[0-9a-zA-Z]{36}",
|
|
204
|
+
"github-pat": r"ghp_[0-9a-zA-Z]{36}",
|
|
205
|
+
"github-refresh-token": r"ghr_[0-9a-zA-Z]{36}",
|
|
206
|
+
|
|
207
|
+
# GitLab (15 Rules)
|
|
208
|
+
"gitlab-cicd-job-token": r"glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}",
|
|
209
|
+
"gitlab-deploy-token": r"gldt-[0-9a-zA-Z_\-]{20}",
|
|
210
|
+
"gitlab-feature-flag-client-token": r"glffct-[0-9a-zA-Z_\-]{20}",
|
|
211
|
+
"gitlab-feed-token": r"glft-[0-9a-zA-Z_\-]{20}",
|
|
212
|
+
"gitlab-incoming-mail-token": r"glimt-[0-9a-zA-Z_\-]{25}",
|
|
213
|
+
"gitlab-kubernetes-agent-token": r"glagent-[0-9a-zA-Z_\-]{50}",
|
|
214
|
+
"gitlab-oauth-app-secret": r"gloas-[0-9a-zA-Z_\-]{64}",
|
|
215
|
+
"gitlab-pat": r"glpat-[\w-]{20}",
|
|
216
|
+
"gitlab-pat-routable": r"\bglpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b",
|
|
217
|
+
"gitlab-ptt": r"glptt-[0-9a-f]{40}",
|
|
218
|
+
"gitlab-rrt": r"GR1348941[\w-]{20}",
|
|
219
|
+
"gitlab-runner-authentication-token": r"glrt-[0-9a-zA-Z_\-]{20}",
|
|
220
|
+
"gitlab-runner-authentication-token-routable": r"\bglrt-t\d_[0-9a-zA-Z_\-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b",
|
|
221
|
+
"gitlab-scim-token": r"glsoat-[0-9a-zA-Z_\-]{20}",
|
|
222
|
+
"gitlab-session-cookie": r"_gitlab_session=[0-9a-z]{32}",
|
|
223
|
+
|
|
224
|
+
# Gitter, GoCardless, Grafana, Harness, HashiCorp
|
|
225
|
+
"gitter-access-token": r"(?i)[\w.-]{0,50}?(?:gitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9_-]{40})",
|
|
226
|
+
"gocardless-api-token": r"(?i)[\w.-]{0,50}?(?:gocardless)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(live_(?i)[a-z0-9\-_=]{40})",
|
|
227
|
+
"grafana-api-key": r"(?i)\b(eyJrIjoi[A-Za-z0-9]{70,400}={0,3})",
|
|
228
|
+
"grafana-cloud-api-token": r"(?i)\b(glc_[A-Za-z0-9+/]{32,400}={0,3})",
|
|
229
|
+
"grafana-service-account-token": r"(?i)\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})",
|
|
230
|
+
"harness-api-key": r"(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}",
|
|
231
|
+
"hashicorp-tf-api-token": r"(?i)[a-z0-9]{14}\.(?-i:atlasv1)\.[a-z0-9\-_=]{60,70}",
|
|
232
|
+
"hashicorp-tf-password": r"(?i)[\w.-]{0,50}?(?:administrator_login_password|password)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(\"[a-z0-9=_\-]{8,20}\")",
|
|
233
|
+
|
|
234
|
+
# Heroku, HubSpot, Infracost, Intercom, Intra42, JFrog, JWT, Kraken, KuCoin, LaunchDarkly, Linear, LinkedIn, Lob, Looker
|
|
235
|
+
"heroku-api-key": r"(?i)[\w.-]{0,50}?(?:heroku)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
236
|
+
"heroku-api-key-v2": r"\b((HRKU-AA[0-9a-zA-Z_-]{58}))",
|
|
237
|
+
"hubspot-api-key": r"(?i)[\w.-]{0,50}?(?:hubspot)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})",
|
|
238
|
+
"infracost-api-token": r"\b(ico-[a-zA-Z0-9]{32})",
|
|
239
|
+
"intercom-api-key": r"(?i)[\w.-]{0,50}?(?:intercom)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{60})",
|
|
240
|
+
"intra42-client-secret": r"\b(s-s4t2(?:ud|af)-(?i)[abcdef0123456789]{64})",
|
|
241
|
+
"jfrog-api-key": r"(?i)[\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{73})",
|
|
242
|
+
"jfrog-identity-token": r"(?i)[\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{64})",
|
|
243
|
+
"jwt": r"\b(ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9\/\\_-]{17,}\.(?:[a-zA-Z0-9\/\\_-]{10,}={0,2})?)",
|
|
244
|
+
"jwt-base64": r"\bZXlK[a-zA-Z0-9\/\\_+\-\r\n]{40,}={0,2}",
|
|
245
|
+
"kraken-access-token": r"(?i)[\w.-]{0,50}?(?:kraken)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9\/=_\+\-]{80,90})",
|
|
246
|
+
"kucoin-access-token": r"(?i)[\w.-]{0,50}?(?:kucoin)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{24})",
|
|
247
|
+
"kucoin-secret-key": r"(?i)[\w.-]{0,50}?(?:kucoin)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
248
|
+
"launchdarkly-access-token": r"(?i)[\w.-]{0,50}?(?:launchdarkly)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{40})",
|
|
249
|
+
"linear-api-key": r"lin_api_(?i)[a-z0-9]{40}",
|
|
250
|
+
"linear-client-secret": r"(?i)[\w.-]{0,50}?(?:linear)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{32})",
|
|
251
|
+
"linkedin-client-id": r"(?i)[\w.-]{0,50}?(?:linked[_-]?in)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{14})",
|
|
252
|
+
"linkedin-client-secret": r"(?i)[\w.-]{0,50}?(?:linked[_-]?in)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{16})",
|
|
253
|
+
"lob-api-key": r"(?i)[\w.-]{0,50}?(?:lob)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}((live|test)_[a-f0-9]{35})",
|
|
254
|
+
"lob-pub-api-key": r"(?i)[\w.-]{0,50}?(?:lob)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}((test|live)_pub_[a-f0-9]{31})",
|
|
255
|
+
"looker-client-id": r"(?i)[\w.-]{0,50}?(?:looker)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{20})",
|
|
256
|
+
"looker-client-secret": r"(?i)[\w.-]{0,50}?(?:looker)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{24})",
|
|
257
|
+
|
|
258
|
+
# Mailchimp, Mailgun, Mapbox, Mattermost, MaxMind, MessageBird, MS Teams, Netlify, New Relic
|
|
259
|
+
"mailchimp-api-key": r"(?i)[\w.-]{0,50}?(?:MailchimpSDK.initialize|mailchimp)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{32}-us\d\d)",
|
|
260
|
+
"mailgun-private-api-token": r"(?i)[\w.-]{0,50}?(?:mailgun)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(key-[a-f0-9]{32})",
|
|
261
|
+
"mailgun-pub-key": r"(?i)[\w.-]{0,50}?(?:mailgun)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(pubkey-[a-f0-9]{32})",
|
|
262
|
+
"mailgun-signing-key": r"(?i)[\w.-]{0,50}?(?:mailgun)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})",
|
|
263
|
+
"mapbox-api-token": r"(?i)[\w.-]{0,50}?(?:mapbox)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(pk\.[a-z0-9]{60}\.[a-z0-9]{22})",
|
|
264
|
+
"mattermost-access-token": r"(?i)[\w.-]{0,50}?(?:mattermost)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{26})",
|
|
265
|
+
"maxmind-license-key": r"\b([A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)",
|
|
266
|
+
"messagebird-api-token": r"(?i)[\w.-]{0,50}?(?:message[_-]?bird)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{25})",
|
|
267
|
+
"messagebird-client-id": r"(?i)[\w.-]{0,50}?(?:message[_-]?bird)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
268
|
+
"microsoft-teams-webhook": r"https://[a-z0-9]+\.webhook\.office\.com/webhookb2/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}",
|
|
269
|
+
"netlify-access-token": r"(?i)[\w.-]{0,50}?(?:netlify)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{40,46})",
|
|
270
|
+
"new-relic-browser-api-token": r"(?i)[\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(NRJS-[a-f0-9]{19})",
|
|
271
|
+
"new-relic-insert-key": r"(?i)[\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(NRII-[a-z0-9-]{32})",
|
|
272
|
+
"new-relic-user-api-id": r"(?i)[\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{64})",
|
|
273
|
+
"new-relic-user-api-key": r"(?i)[\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(NRAK-[a-z0-9]{27})",
|
|
274
|
+
|
|
275
|
+
# Notion, NPM, NuGet, NYTimes, Octopus, Okta, OpenShift, Package Managers
|
|
276
|
+
"notion-api-token": r"\b(ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})",
|
|
277
|
+
"npm-access-token": r"(?i)\b(npm_[a-z0-9]{36})\b",
|
|
278
|
+
"nuget-config-password": r"(?i)<add key=\"(?:(?:ClearText)?Password)\"\s*value=\"(.{8,})\"\s*/>",
|
|
279
|
+
"nytimes-access-token": r"(?i)[\w.-]{0,50}?(?:nytimes|new-york-times,|newyorktimes)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9=_\-]{32})",
|
|
280
|
+
"octopus-deploy-api-key": r"\b(API-[A-Z0-9]{26})",
|
|
281
|
+
"okta-access-token": r"[\w.-]{0,50}?(?i:[\w.-]{0,50}?(?:(?-i:[Oo]kta|OKTA))(?:[ \t\w.-]{0,20})[\s'\"]{0,3})(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(00[\w=\-]{40})",
|
|
282
|
+
"openshift-user-token": r"\b(sha256~[\w-]{43})",
|
|
283
|
+
"pypi-upload-token": r"pypi-AgEIcHlwaS5vcmc[\w-]{50,1000}",
|
|
284
|
+
"rubygems-api-token": r"\b(rubygems_[a-f0-9]{48})\b",
|
|
285
|
+
|
|
286
|
+
# Plaid, PlanetScale, Postman, Prefect, Private Key, Pulumi, RapidAPI, Readme, Scalingo
|
|
287
|
+
"plaid-api-token": r"(?i)[\w.-]{0,50}?(?:plaid)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
288
|
+
"plaid-client-id": r"(?i)[\w.-]{0,50}?(?:plaid)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{24})",
|
|
289
|
+
"plaid-secret-key": r"(?i)[\w.-]{0,50}?(?:plaid)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{30})",
|
|
290
|
+
"planetscale-api-token": r"\b(pscale_tkn_(?i)[\w=\.-]{32,64})",
|
|
291
|
+
"planetscale-oauth-token": r"\b(pscale_oauth_[\w=\.-]{32,64})",
|
|
292
|
+
"planetscale-password": r"(?i)\b(pscale_pw_(?i)[\w=\.-]{32,64})",
|
|
293
|
+
"postman-api-token": r"\b(PMAK-(?i)[a-f0-9]{24}\-[a-f0-9]{34})",
|
|
294
|
+
"prefect-api-token": r"\b(pnu_[a-zA-Z0-9]{36})",
|
|
295
|
+
"private-key": r"(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]{64,}?KEY(?: BLOCK)?-----",
|
|
296
|
+
"pulumi-api-token": r"\b(pul-[a-f0-9]{40})",
|
|
297
|
+
"rapidapi-access-token": r"(?i)[\w.-]{0,50}?(?:rapidapi)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9_-]{50})",
|
|
298
|
+
"readme-api-token": r"\b(rdme_[a-z0-9]{70})",
|
|
299
|
+
"scalingo-api-token": r"\b(tk-us-[\w-]{48})",
|
|
300
|
+
|
|
301
|
+
# Sendbird, SendGrid, Sendinblue, Sentry, SettleMint, Shippo, Shopify, Sidekiq
|
|
302
|
+
"sendbird-access-id": r"(?i)[\w.-]{0,50}?(?:sendbird)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
303
|
+
"sendbird-access-token": r"(?i)[\w.-]{0,50}?(?:sendbird)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{40})",
|
|
304
|
+
"sendgrid-api-token": r"\b(SG\.(?i)[a-z0-9=_\-\.]{66})",
|
|
305
|
+
"sendinblue-api-token": r"\b(xkeysib-[a-f0-9]{64}\-(?i)[a-z0-9]{16})",
|
|
306
|
+
"sentry-access-token": r"(?i)[\w.-]{0,50}?(?:sentry)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{64})",
|
|
307
|
+
"sentry-org-token": r"\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",
|
|
308
|
+
"sentry-user-token": r"\b(sntryu_[a-f0-9]{64})",
|
|
309
|
+
"settlemint-application-access-token": r"\b(sm_aat_[a-zA-Z0-9]{16})",
|
|
310
|
+
"settlemint-personal-access-token": r"\b(sm_pat_[a-zA-Z0-9]{16})",
|
|
311
|
+
"settlemint-service-access-token": r"\b(sm_sat_[a-zA-Z0-9]{16})",
|
|
312
|
+
"shippo-api-token": r"\b(shippo_(?:live|test)_[a-fA-F0-9]{40})",
|
|
313
|
+
"shopify-access-token": r"shpat_[a-fA-F0-9]{32}",
|
|
314
|
+
"shopify-custom-access-token": r"shpca_[a-fA-F0-9]{32}",
|
|
315
|
+
"shopify-private-app-access-token": r"shppa_[a-fA-F0-9]{32}",
|
|
316
|
+
"shopify-shared-secret": r"shpss_[a-fA-F0-9]{32}",
|
|
317
|
+
"sidekiq-secret": r"(?i)[\w.-]{0,50}?(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-f0-9]{8}:[a-f0-9]{8})",
|
|
318
|
+
"sidekiq-sensitive-url": r"(?i)\bhttps?://([a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)",
|
|
319
|
+
|
|
320
|
+
# Slack (10 Rules)
|
|
321
|
+
"slack-app-token": r"(?i)xapp-\d-[A-Z0-9]+-\d+-[a-z0-9]+",
|
|
322
|
+
"slack-bot-token": r"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",
|
|
323
|
+
"slack-config-access-token": r"(?i)xoxe.xox[bp]-\d-[A-Z0-9]{163,166}",
|
|
324
|
+
"slack-config-refresh-token": r"(?i)xoxe-\d-[A-Z0-9]{146}",
|
|
325
|
+
"slack-legacy-bot-token": r"xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}",
|
|
326
|
+
"slack-legacy-token": r"xox[os]-\d+-\d+-\d+-[a-fA-F\d]+",
|
|
327
|
+
"slack-legacy-workspace-token": r"xox[ar]-(?:\d-)?[0-9a-zA-Z]{8,48}",
|
|
328
|
+
"slack-user-token": r"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",
|
|
329
|
+
"slack-webhook-url": r"(?:https?://)?hooks\.slack\.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}",
|
|
330
|
+
|
|
331
|
+
# Snyk, Sonar, Sourcegraph, Square, Squarespace, Stripe, SumoLogic, Telegram, TravisCI, Twilio, Twitch
|
|
332
|
+
"snyk-api-token": r"(?i)[\w.-]{0,50}?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
333
|
+
"sonar-api-token": r"(?i)[\w.-]{0,50}?(?:sonar[_.-]?(login|token))(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}((?:squ_|sqp_|sqa_)?[a-z0-9=_\-]{40})",
|
|
334
|
+
"sourcegraph-access-token": r"(?i)\b(\b(sgp_(?:[a-fA-F0-9]{16}|local)_[a-fA-F0-9]{40}|sgp_[a-fA-F0-9]{40}|[a-fA-F0-9]{40})\b)",
|
|
335
|
+
"square-access-token": r"\b((?:EAAA|sq0atp-)[\w-]{22,60})",
|
|
336
|
+
"squarespace-access-token": r"(?i)[\w.-]{0,50}?(?:squarespace)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})",
|
|
337
|
+
"stripe-access-token": r"\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})",
|
|
338
|
+
"sumologic-access-id": r"[\w.-]{0,50}?(?i:[\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \t\w.-]{0,20})[\s'\"]{0,3})(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(su[a-zA-Z0-9]{12})",
|
|
339
|
+
"sumologic-access-token": r"(?i)[\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{64})",
|
|
340
|
+
"telegram-bot-api-token": r"(?i)[\w.-]{0,50}?(?:telegr)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9]{5,16}:(?-i:A)[a-z0-9_\-]{34})",
|
|
341
|
+
"travisci-access-token": r"(?i)[\w.-]{0,50}?(?:travis)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{22})",
|
|
342
|
+
"twilio-api-key": r"SK[0-9a-fA-F]{32}",
|
|
343
|
+
"twitch-api-token": r"(?i)[\w.-]{0,50}?(?:twitch)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{30})",
|
|
344
|
+
|
|
345
|
+
# Twitter (5 Rules)
|
|
346
|
+
"twitter-access-secret": r"(?i)[\w.-]{0,50}?(?:twitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{45})",
|
|
347
|
+
"twitter-access-token": r"(?i)[\w.-]{0,50}?(?:twitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})",
|
|
348
|
+
"twitter-api-key": r"(?i)[\w.-]{0,50}?(?:twitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{25})",
|
|
349
|
+
"twitter-api-secret": r"(?i)[\w.-]{0,50}?(?:twitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{50})",
|
|
350
|
+
"twitter-bearer-token": r"(?i)[\w.-]{0,50}?(?:twitter)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(A{22}[a-zA-Z0-9%]{80,100})",
|
|
351
|
+
|
|
352
|
+
# Typeform, Vault, Yandex, Zendesk
|
|
353
|
+
"typeform-api-token": r"(?i)[\w.-]{0,50}?(?:typeform)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(tfp_[a-z0-9\-_\.=]{59})",
|
|
354
|
+
"vault-batch-token": r"\b(hvb\.[\w-]{138,300})",
|
|
355
|
+
"vault-service-token": r"\b((?:hvs\.[\w-]{90,120}|s\.(?i:[a-z0-9]{24})))",
|
|
356
|
+
"yandex-access-token": r"(?i)[\w.-]{0,50}?(?:yandex)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2})",
|
|
357
|
+
"yandex-api-key": r"(?i)[\w.-]{0,50}?(?:yandex)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(AQVN[A-Za-z0-9_\-]{35,38})",
|
|
358
|
+
"yandex-aws-access-token": r"(?i)[\w.-]{0,50}?(?:yandex)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}(YC[a-zA-Z0-9_\-]{38})",
|
|
359
|
+
"zendesk-secret-key": r"(?i)[\w.-]{0,50}?(?:zendesk)(?:[ \t\w.-]{0,20})[\s'\"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'\"\s=]{0,5}([a-z0-9]{40})",
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
# =====================================================================
|
|
363
|
+
# 3. GITLEAKS OFFICIAL ALLOWLIST & STOPWORDS (False-Positive Suppression)
|
|
364
|
+
# =====================================================================
|
|
365
|
+
GITLEAKS_STOPWORDS = [
|
|
366
|
+
"000000",
|
|
367
|
+
"123456",
|
|
368
|
+
"abcdefghijklmnopqrstuvwxyz",
|
|
369
|
+
"014df517-39d1-4453-b7b3-9930c563627c",
|
|
370
|
+
"EXAMPLEKEY",
|
|
371
|
+
"dummy_secret",
|
|
372
|
+
"changeit",
|
|
373
|
+
"changeme",
|
|
374
|
+
"password",
|
|
375
|
+
"6fe4476ee5a1832882e326b506d14126",
|
|
376
|
+
"_ec2_",
|
|
377
|
+
"aaaaaa",
|
|
378
|
+
]
|
|
379
|
+
|
|
380
|
+
GITLEAKS_ALLOWLIST_REGEXES = [
|
|
381
|
+
r"(?i)^true|false|null$",
|
|
382
|
+
r"^(?i:a+|b+|c+|d+|e+|f+|g+|h+|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+|\*+|\.+)$",
|
|
383
|
+
r"^\$(?:\d+|{\d+})$",
|
|
384
|
+
r"^\$\{[A-Za-z0-9_.]+\}$",
|
|
385
|
+
r"^\{\{[ \t]*[\w ().|]+[ \t]*\}\}$",
|
|
386
|
+
r".+EXAMPLE$",
|
|
387
|
+
r"^/Users/(?i)[a-z0-9]+/[\w .-/]+$",
|
|
388
|
+
r"^/(?:bin|etc|home|opt|tmp|usr|var)/[\w ./-]+$",
|
|
389
|
+
]
|