mattermost.go 737 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 MattermostAccessToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "mattermost-access-token",
  11. Description: "Identified a Mattermost Access Token, which may compromise team communication channels and data privacy.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"mattermost"}, utils.AlphaNumeric("26"), true),
  13. Keywords: []string{
  14. "mattermost",
  15. },
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("mattermost", secrets.NewSecret(utils.AlphaNumeric("26")))
  19. return utils.Validate(r, tps, nil)
  20. }