mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
* chore(generate): make utils public * chore(generate): change validate log messages * chore(generate): split functions into files * chore(config): add warning for public funcs
24 lines
710 B
Go
24 lines
710 B
Go
package rules
|
|
|
|
import (
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func AlgoliaApiKey() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
Description: "Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",
|
|
RuleID: "algolia-api-key",
|
|
Regex: utils.GenerateSemiGenericRegex([]string{"algolia"}, `[a-z0-9]{32}`, true),
|
|
Keywords: []string{"algolia"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
"algolia_key := " + secrets.NewSecret(utils.Hex("32")),
|
|
}
|
|
return utils.Validate(r, tps, nil)
|
|
}
|