4
0

twilio.go 677 B

1234567891011121314151617181920212223242526
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "regexp"
  5. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  6. "github.com/zricethezav/gitleaks/v8/config"
  7. )
  8. func Twilio() *config.Rule {
  9. // define rule
  10. r := config.Rule{
  11. RuleID: "twilio-api-key",
  12. Description: "Found a Twilio API Key, posing a risk to communication services and sensitive customer interaction data.",
  13. Regex: regexp.MustCompile(`SK[0-9a-fA-F]{32}`),
  14. Entropy: 3,
  15. Keywords: []string{"SK"},
  16. }
  17. // validate
  18. tps := []string{
  19. "twilioAPIKey := \"SK" + secrets.NewSecret(utils.Hex("32")) + "\"",
  20. }
  21. return utils.Validate(r, tps, nil)
  22. }