kucoin.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 KucoinAccessToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "kucoin-access-token",
  11. Description: "Found a Kucoin Access Token, risking unauthorized access to cryptocurrency exchange services and transactions.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"kucoin"}, utils.Hex("24"), true),
  13. Keywords: []string{
  14. "kucoin",
  15. },
  16. }
  17. // validate
  18. tps := []string{
  19. utils.GenerateSampleSecret("kucoin", secrets.NewSecret(utils.Hex("24"))),
  20. }
  21. return utils.Validate(r, tps, nil)
  22. }
  23. func KucoinSecretKey() *config.Rule {
  24. // define rule
  25. r := config.Rule{
  26. RuleID: "kucoin-secret-key",
  27. Description: "Discovered a Kucoin Secret Key, which could lead to compromised cryptocurrency operations and financial data breaches.",
  28. Regex: utils.GenerateSemiGenericRegex([]string{"kucoin"}, utils.Hex8_4_4_4_12(), true),
  29. Keywords: []string{
  30. "kucoin",
  31. },
  32. }
  33. // validate
  34. tps := []string{
  35. utils.GenerateSampleSecret("kucoin", secrets.NewSecret(utils.Hex8_4_4_4_12())),
  36. }
  37. return utils.Validate(r, tps, nil)
  38. }