finicity.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 FinicityClientSecret() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",
  11. RuleID: "finicity-client-secret",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"finicity"}, utils.AlphaNumeric("20"), true),
  13. Keywords: []string{"finicity"},
  14. }
  15. // validate
  16. tps := []string{
  17. utils.GenerateSampleSecret("finicity", secrets.NewSecret(utils.AlphaNumeric("20"))),
  18. }
  19. return utils.Validate(r, tps, nil)
  20. }
  21. func FinicityAPIToken() *config.Rule {
  22. // define rule
  23. r := config.Rule{
  24. Description: "Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",
  25. RuleID: "finicity-api-token",
  26. Regex: utils.GenerateSemiGenericRegex([]string{"finicity"}, utils.Hex("32"), true),
  27. Keywords: []string{"finicity"},
  28. }
  29. // validate
  30. tps := []string{
  31. utils.GenerateSampleSecret("finicity", secrets.NewSecret(utils.Hex("32"))),
  32. }
  33. return utils.Validate(r, tps, nil)
  34. }