twilio.go 707 B

1234567891011121314151617181920212223
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. "github.com/zricethezav/gitleaks/v8/regexp"
  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 := utils.GenerateSampleSecrets("twilio", "SK"+secrets.NewSecret(utils.Hex("32")))
  19. return utils.Validate(r, tps, nil)
  20. }