mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Minor false positive improvements (#1758)
* feat(generic): add 'keypress' to allowlist * feat(privatekey): ignore empty/impossible matches * feat(config): ignore 'secrets' that are file paths * fix(sentry): handle special character at end Prevent common test error of 'Failed to Validate. True positive was not detected by regex.' because the generated value didn't play nicely with word boundary.
This commit is contained in:
1 parent
2020e6a9ab
commit
3fa5a3a954
6 files changed
+41
-12
No files matched your search
@@ -24,6 +24,8 @@ regexes = [
|
||||
'''^%[+\-# 0]?[bcdeEfFgGoOpqstTUvxX]$''',
|
||||
'''^\{\d{0,2}}$''',
|
||||
'''^@(?:[A-Z_]+|[a-z_]+)@$''',
|
||||
'''^/Users/(?i)[a-z0-9]+/[\w .-/]+$''',
|
||||
'''^/(?:bin|etc|home|opt|tmp|usr|var)/[\w ./-]+$''',
|
||||
]
|
||||
paths = [
|
||||
'''gitleaks\.toml''',
|
||||
@@ -586,7 +588,7 @@ regexes = [
|
||||
[[rules.allowlists]]
|
||||
regexTarget = "match"
|
||||
regexes = [
|
||||
'''(?i)(?:access(?:ibility|or)|access[_.-]?id|random[_.-]?access|api[_.-]?(?:id|name|version)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(?:credentials?[_.-]?id|withCredentials)|(?:bucket|foreign|hot|idx|natural|primary|pub(?:lic)?|schema|sequence)[_.-]?key|key[_.-]?(?:alias|board|code|frame|id|length|mesh|name|pair|ring|selector|signature|size|stone|storetype|word|up|down|left|right)|key[_.-]?vault[_.-]?(?:id|name)|keyVaultToStoreSecrets|key(?:store|tab)[_.-]?(?:file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(?:secret)[_.-]?(?:length|name|size)|UserSecretsId|(?:io\.jsonwebtoken[ \t]?:[ \t]?[\w-]+)|(?:api|credentials|token)[_.-]?(?:endpoint|ur[il])|public[_.-]?token|(?:key|token)[_.-]?file|(?-i:(?:[A-Z_]+=\n[A-Z_]+=|[a-z_]+=\n[a-z_]+=)(?:\n|\z))|(?-i:(?:[A-Z.]+=\n[A-Z.]+=|[a-z.]+=\n[a-z.]+=)(?:\n|\z)))''',
|
||||
'''(?i)(?:access(?:ibility|or)|access[_.-]?id|random[_.-]?access|api[_.-]?(?:id|name|version)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(?:credentials?[_.-]?id|withCredentials)|(?:bucket|foreign|hot|idx|natural|primary|pub(?:lic)?|schema|sequence)[_.-]?key|key[_.-]?(?:alias|board|code|frame|id|length|mesh|name|pair|press(?:ed)?|ring|selector|signature|size|stone|storetype|word|up|down|left|right)|key[_.-]?vault[_.-]?(?:id|name)|keyVaultToStoreSecrets|key(?:store|tab)[_.-]?(?:file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(?:secret)[_.-]?(?:length|name|size)|UserSecretsId|(?:io\.jsonwebtoken[ \t]?:[ \t]?[\w-]+)|(?:api|credentials|token)[_.-]?(?:endpoint|ur[il])|public[_.-]?token|(?:key|token)[_.-]?file|(?-i:(?:[A-Z_]+=\n[A-Z_]+=|[a-z_]+=\n[a-z_]+=)(?:\n|\z))|(?-i:(?:[A-Z.]+=\n[A-Z.]+=|[a-z.]+=\n[a-z.]+=)(?:\n|\z)))''',
|
||||
]
|
||||
stopwords = [
|
||||
"000000",
|
||||
@@ -2683,7 +2685,7 @@ keywords = ["pnu_"]
|
||||
[[rules]]
|
||||
id = "private-key"
|
||||
description = "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption."
|
||||
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*?KEY(?: BLOCK)?-----'''
|
||||
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]{64,}?KEY(?: BLOCK)?-----'''
|
||||
keywords = ["-----begin"]
|
||||
|
||||
[[rules]]
|
||||
@@ -2774,7 +2776,7 @@ keywords = ["sentry"]
|
||||
[[rules]]
|
||||
id = "sentry-org-token"
|
||||
description = "Found a Sentry.io Organization Token, risking unauthorized access to error tracking services and sensitive application data."
|
||||
regex = '''\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}\b'''
|
||||
regex = '''\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\z)'''
|
||||
entropy = 4.5
|
||||
keywords = ["sntrys_eyjpyxqio"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user