twitch.go 625 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func TwitchAPIToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "twitch-api-token",
  10. Description: "Discovered a Twitch API token, which could compromise streaming services and account integrations.",
  11. Regex: generateSemiGenericRegex([]string{"twitch"}, alphaNumeric("30"), true),
  12. Keywords: []string{
  13. "twitch",
  14. },
  15. }
  16. // validate
  17. tps := []string{
  18. generateSampleSecret("twitch", secrets.NewSecret(alphaNumeric("30"))),
  19. }
  20. return validate(r, tps, nil)
  21. }