gitlab.go 443 B

123456789101112131415161718192021
  1. package rules
  2. import (
  3. "regexp"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func Gitlab() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "Gitlab Personal Access Token",
  10. RuleID: "gitlab-pat",
  11. Regex: regexp.MustCompile(`glpat-[0-9a-zA-Z\-\_]{20}`),
  12. Keywords: []string{"glpat-"},
  13. }
  14. // validate
  15. tps := []string{"gitlabPAT := \"glpat-" + sampleAlphaNumeric20Token + "\""}
  16. return validate(r, tps)
  17. }