mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 13:34:23 +01:00
feat: add algolia key support (#866)
* feat: add algolia key support * feat: add algolia key to generator * chore: update algolia regex to match gen
This commit is contained in:
1 parent
865478bcdc
commit
93e72c215d
3 files changed
+32
No files matched your search
@@ -19,6 +19,7 @@ func main() {
|
|||||||
configRules = append(configRules, rules.AdobeClientID())
|
configRules = append(configRules, rules.AdobeClientID())
|
||||||
configRules = append(configRules, rules.AdobeClientSecret())
|
configRules = append(configRules, rules.AdobeClientSecret())
|
||||||
configRules = append(configRules, rules.AgeSecretKey())
|
configRules = append(configRules, rules.AgeSecretKey())
|
||||||
|
configRules = append(configRules, rules.AlgoliaApiKey())
|
||||||
configRules = append(configRules, rules.AlibabaAccessKey())
|
configRules = append(configRules, rules.AlibabaAccessKey())
|
||||||
configRules = append(configRules, rules.AlibabaSecretKey())
|
configRules = append(configRules, rules.AlibabaSecretKey())
|
||||||
configRules = append(configRules, rules.AsanaClientID())
|
configRules = append(configRules, rules.AsanaClientID())
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package rules
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||||
|
"github.com/zricethezav/gitleaks/v8/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AlgoliaApiKey() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
Description: "Algolia API Key",
|
||||||
|
RuleID: "algolia-api-key",
|
||||||
|
Regex: generateUniqueTokenRegex(`[a-z0-9]{32}`),
|
||||||
|
Keywords: []string{"algolia"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
"algolia_key := " + secrets.NewSecret(hex("32")),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
|
|
||||||
@@ -42,6 +42,14 @@ keywords = [
|
|||||||
"age-secret-key-1",
|
"age-secret-key-1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
description = "Algolia API Key"
|
||||||
|
id = "algolia-api-key"
|
||||||
|
regex = '''\b((?i)[a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||||
|
keywords = [
|
||||||
|
"algolia",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
description = "Alibaba AccessKey ID"
|
description = "Alibaba AccessKey ID"
|
||||||
id = "alibaba-access-key-id"
|
id = "alibaba-access-key-id"
|
||||||
|
|||||||
Reference in new issue
Block a user