gocardless.go 703 B

1234567891011121314151617181920212223242526
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func GoCardless() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "gocardless-api-token",
  10. Description: "Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",
  11. Regex: generateSemiGenericRegex([]string{"gocardless"}, `live_(?i)[a-z0-9\-_=]{40}`, true),
  12. Keywords: []string{
  13. "live_",
  14. "gocardless",
  15. },
  16. }
  17. // validate
  18. tps := []string{
  19. generateSampleSecret("gocardless", "live_"+secrets.NewSecret(alphaNumericExtended("40"))),
  20. }
  21. return validate(r, tps, nil)
  22. }