beamer.go 733 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 Beamer() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",
  11. RuleID: "beamer-api-token",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"beamer"},
  13. `b_[a-z0-9=_\-]{44}`, true),
  14. Keywords: []string{"beamer"},
  15. }
  16. // validate
  17. tps := []string{
  18. utils.GenerateSampleSecret("beamer", "b_"+secrets.NewSecret(utils.AlphaNumericExtended("44"))),
  19. }
  20. return utils.Validate(r, tps, nil)
  21. }