4
0

duffel.go 769 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 Duffel() *config.Rule {
  9. // define rule
  10. r := config.Rule{
  11. RuleID: "duffel-api-token",
  12. Description: "Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",
  13. Regex: regexp.MustCompile(`duffel_(?:test|live)_(?i)[a-z0-9_\-=]{43}`),
  14. Entropy: 2,
  15. Keywords: []string{"duffel_"},
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("duffel", "duffel_test_"+secrets.NewSecret(utils.AlphaNumericExtended("43")))
  19. return utils.Validate(r, tps, nil)
  20. }