coinbase.go 770 B

123456789101112131415161718192021222324
  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 CoinbaseAccessToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "coinbase-access-token",
  11. Description: "Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"coinbase"},
  13. utils.AlphaNumericExtendedShort("64"), true),
  14. Keywords: []string{
  15. "coinbase",
  16. },
  17. }
  18. // validate
  19. tps := utils.GenerateSampleSecrets("coinbase", secrets.NewSecret(utils.AlphaNumericExtendedShort("64")))
  20. return utils.Validate(r, tps, nil)
  21. }