mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
* Enhance secret descriptions in gitleaks.toml * adjust the rule configuration descriptions * missing spaces in gitleaks.toml
25 lines
587 B
Go
25 lines
587 B
Go
package rules
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func Twilio() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
Description: "Found a Twilio API Key, posing a risk to communication services and sensitive customer interaction data.",
|
|
RuleID: "twilio-api-key",
|
|
Regex: regexp.MustCompile(`SK[0-9a-fA-F]{32}`),
|
|
Keywords: []string{"twilio"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
"twilioAPIKey := \"SK" + secrets.NewSecret(hex("32")) + "\"",
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|