finnhub.go 715 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 FinnhubAccessToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "finnhub-access-token",
  11. Description: "Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"finnhub"}, utils.AlphaNumeric("20"), true),
  13. Keywords: []string{
  14. "finnhub",
  15. },
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("finnhub", secrets.NewSecret(utils.AlphaNumeric("20")))
  19. return utils.Validate(r, tps, nil)
  20. }