gocardless.go 791 B

123456789101112131415161718192021222324252627
  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. )
  7. func GoCardless() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "gocardless-api-token",
  11. Description: "Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"gocardless"}, `live_(?i)[a-z0-9\-_=]{40}`, true),
  13. Keywords: []string{
  14. "live_",
  15. "gocardless",
  16. },
  17. }
  18. // validate
  19. tps := []string{
  20. utils.GenerateSampleSecret("gocardless", "live_"+secrets.NewSecret(utils.AlphaNumericExtended("40"))),
  21. }
  22. return utils.Validate(r, tps, nil)
  23. }