twilio.go 497 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "regexp"
  4. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. )
  7. func Twilio() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Twilio API Key",
  11. RuleID: "twilio-api-key",
  12. Regex: regexp.MustCompile(`SK[0-9a-fA-F]{32}`),
  13. Keywords: []string{"twilio"},
  14. }
  15. // validate
  16. tps := []string{
  17. "twilioAPIKey := \"SK" + secrets.NewSecret(hex("32")) + "\"",
  18. }
  19. return validate(r, tps, nil)
  20. }