Skip to content

Commit

Permalink
feat: add algolia key to generator
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGurney committed May 6, 2022
1 parent ef7deb7 commit f3df0c5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/generate/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func main() {
configRules = append(configRules, rules.AdobeClientID())
configRules = append(configRules, rules.AdobeClientSecret())
configRules = append(configRules, rules.AgeSecretKey())
configRules = append(configRules, rules.AlgoliaApiKey())
configRules = append(configRules, rules.AlibabaAccessKey())
configRules = append(configRules, rules.AlibabaSecretKey())
configRules = append(configRules, rules.AsanaClientID())
Expand Down
23 changes: 23 additions & 0 deletions cmd/generate/config/rules/algolia.go
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit f3df0c5

Please sign in to comment.