rapidapi.go 679 B

123456789101112131415161718192021222324252627
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func RapidAPIAccessToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "rapidapi-access-token",
  10. Description: "Uncovered a RapidAPI Access Token, which could lead to unauthorized access to various APIs and data services.",
  11. Regex: generateSemiGenericRegex([]string{"rapidapi"},
  12. alphaNumericExtendedShort("50"), true),
  13. Keywords: []string{
  14. "rapidapi",
  15. },
  16. }
  17. // validate
  18. tps := []string{
  19. generateSampleSecret("rapidapi",
  20. secrets.NewSecret(alphaNumericExtendedShort("50"))),
  21. }
  22. return validate(r, tps, nil)
  23. }