twitch.go 704 B

1234567891011121314151617181920212223
  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 TwitchAPIToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "twitch-api-token",
  11. Description: "Discovered a Twitch API token, which could compromise streaming services and account integrations.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"twitch"}, utils.AlphaNumeric("30"), true),
  13. Keywords: []string{
  14. "twitch",
  15. },
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("twitch", secrets.NewSecret(utils.AlphaNumeric("30")))
  19. return utils.Validate(r, tps, nil)
  20. }