mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
updating generic regex and algoia regex (#875)
This commit is contained in:
1 parent
93e72c215d
commit
469cd22f61
3 files changed
+6
-7
No files matched your search
@@ -10,7 +10,7 @@ func AlgoliaApiKey() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Algolia API Key",
|
Description: "Algolia API Key",
|
||||||
RuleID: "algolia-api-key",
|
RuleID: "algolia-api-key",
|
||||||
Regex: generateUniqueTokenRegex(`[a-z0-9]{32}`),
|
Regex: generateSemiGenericRegex([]string{"algolia"}, `[a-z0-9]{32}`),
|
||||||
Keywords: []string{"algolia"},
|
Keywords: []string{"algolia"},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,4 +20,3 @@ func AlgoliaApiKey() *config.Rule {
|
|||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,9 +13,9 @@ func GenericCredential() *config.Rule {
|
|||||||
"key",
|
"key",
|
||||||
"api[^Version]",
|
"api[^Version]",
|
||||||
"token",
|
"token",
|
||||||
"pat",
|
|
||||||
"secret",
|
"secret",
|
||||||
"client",
|
"client",
|
||||||
|
"passwd",
|
||||||
"password",
|
"password",
|
||||||
"auth",
|
"auth",
|
||||||
}, `[0-9a-z\-_.=]{10,150}`),
|
}, `[0-9a-z\-_.=]{10,150}`),
|
||||||
@@ -26,7 +26,7 @@ func GenericCredential() *config.Rule {
|
|||||||
"token",
|
"token",
|
||||||
"secret",
|
"secret",
|
||||||
"client",
|
"client",
|
||||||
"pat",
|
"passwd",
|
||||||
"password",
|
"password",
|
||||||
"auth",
|
"auth",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Algolia API Key"
|
description = "Algolia API Key"
|
||||||
id = "algolia-api-key"
|
id = "algolia-api-key"
|
||||||
regex = '''\b((?i)[a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
regex = '''(?i)(?:algolia)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"algolia",
|
"algolia",
|
||||||
]
|
]
|
||||||
@@ -741,11 +741,11 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Generic API Key"
|
description = "Generic API Key"
|
||||||
id = "generic-api-key"
|
id = "generic-api-key"
|
||||||
regex = '''(?i)(?:key|api[^Version]|token|pat|secret|client|password|auth)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
regex = '''(?i)(?:key|api[^Version]|token|secret|client|passwd|password|auth)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||||
secretGroup = 1
|
secretGroup = 1
|
||||||
entropy = 3.5
|
entropy = 3.5
|
||||||
keywords = [
|
keywords = [
|
||||||
"key","api","token","secret","client","pat","password","auth",
|
"key","api","token","secret","client","passwd","password","auth",
|
||||||
]
|
]
|
||||||
[rules.allowlist]
|
[rules.allowlist]
|
||||||
stopwords= [
|
stopwords= [
|
||||||
|
|||||||
Reference in new issue
Block a user