Просмотр исходного кода

Add support for GitLab routable tokens #1655

This commit adds increases the entropy.

For the specification see:
https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/routable_tokens/#proposal

Issue: https://github.com/gitleaks/gitleaks/issues/1655
Nicholas Wittstruck 1 год назад
Родитель
Сommit
86fecfb2da
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      cmd/generate/config/rules/gitlab.go
  2. 1 1
      config/gitleaks.toml

+ 2 - 2
cmd/generate/config/rules/gitlab.go

@@ -120,14 +120,14 @@ func GitlabPatRoutable() *config.Rule {
 		RuleID:      "gitlab-pat-routable",
 		Description: "Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure.",
 		Regex:       regexp.MustCompile(`glpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}`),
-		Entropy:     3,
+		Entropy:     4,
 		Keywords:    []string{"glpat-"},
 	}
 
 	// validate
 	tps := utils.GenerateSampleSecrets("gitlab", "glpat-"+secrets.NewSecret(utils.AlphaNumeric("27"))+"."+secrets.NewSecret(utils.AlphaNumeric("2"))+secrets.NewSecret(utils.AlphaNumeric("7")))
 	fps := []string{
-		"glpat-XXXXXXXXXXXXXXXXXXX",
+		"glpat-xxxxxxxx-xxxxxxxxxxxxxxxxxx.xxxxxxxxx",
 	}
 	return utils.Validate(r, tps, fps)
 }

+ 1 - 1
config/gitleaks.toml

@@ -2141,7 +2141,7 @@ keywords = ["glpat-"]
 id = "gitlab-pat-routable"
 description = "Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure."
 regex = '''glpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}'''
-entropy = 3
+entropy = 4
 keywords = ["glpat-"]
 
 [[rules]]