plaid.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package rules
  2. import (
  3. "fmt"
  4. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. )
  7. func PlaidAccessID() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "plaid-client-id",
  11. Description: "Uncovered a Plaid Client ID, which could lead to unauthorized financial service integrations and data breaches.",
  12. Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("24"), true),
  13. Entropy: 3.5,
  14. Keywords: []string{
  15. "plaid",
  16. },
  17. }
  18. // validate
  19. tps := []string{
  20. generateSampleSecret("plaid", secrets.NewSecret(alphaNumeric("24"))),
  21. }
  22. return validate(r, tps, nil)
  23. }
  24. func PlaidSecretKey() *config.Rule {
  25. // define rule
  26. r := config.Rule{
  27. RuleID: "plaid-secret-key",
  28. Description: "Detected a Plaid Secret key, risking unauthorized access to financial accounts and sensitive transaction data.",
  29. Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("30"), true),
  30. Entropy: 3.5,
  31. Keywords: []string{
  32. "plaid",
  33. },
  34. }
  35. // validate
  36. tps := []string{
  37. generateSampleSecret("plaid", secrets.NewSecret(alphaNumeric("30"))),
  38. }
  39. return validate(r, tps, nil)
  40. }
  41. func PlaidAccessToken() *config.Rule {
  42. // define rule
  43. r := config.Rule{
  44. RuleID: "plaid-api-token",
  45. Description: "Discovered a Plaid API Token, potentially compromising financial data aggregation and banking services.",
  46. Regex: generateSemiGenericRegex([]string{"plaid"},
  47. fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12()), true),
  48. Keywords: []string{
  49. "plaid",
  50. },
  51. }
  52. // validate
  53. tps := []string{
  54. generateSampleSecret("plaid", secrets.NewSecret(fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12()))),
  55. }
  56. return validate(r, tps, nil)
  57. }