mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
Add support for GitLab Runner Tokens (Routable) (#1820)
This commit adds support for GitLabs routable runner tokens. For the specification see: https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/routable_tokens/#proposal Issue: https://github.com/gitleaks/gitleaks/issues/1819 Co-authored-by: Nicholas Wittstruck <1283061+nwittstruck@users.noreply.github.com>
This commit is contained in:
1 parent
7fac002325
commit
ee6b383523
3 files changed
+25
No files matched your search
@@ -111,6 +111,7 @@ func main() {
|
||||
rules.GitlabPipelineTriggerToken(),
|
||||
rules.GitlabRunnerRegistrationToken(),
|
||||
rules.GitlabRunnerAuthenticationToken(),
|
||||
rules.GitlabRunnerAuthenticationTokenRoutable(),
|
||||
rules.GitlabScimToken(),
|
||||
rules.GitlabSessionCookie(),
|
||||
rules.GitterAccessToken(),
|
||||
|
||||
@@ -177,6 +177,23 @@ func GitlabRunnerAuthenticationToken() *config.Rule {
|
||||
return utils.Validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func GitlabRunnerAuthenticationTokenRoutable() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "gitlab-runner-authentication-token-routable",
|
||||
Description: "Discovered a GitLab Runner Authentication Token (Routable), posing a risk to CI/CD pipeline integrity and unauthorized access.",
|
||||
Regex: regexp.MustCompile(`\bglrt-t\d_[0-9a-zA-Z_\-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b`),
|
||||
Entropy: 4,
|
||||
Keywords: []string{"glrt-"},
|
||||
}
|
||||
|
||||
tps := utils.GenerateSampleSecrets("gitlab", "glrt-t"+secrets.NewSecret(utils.Numeric("1"))+"_"+secrets.NewSecret(utils.AlphaNumeric("27"))+"."+secrets.NewSecret(utils.AlphaNumeric("2"))+secrets.NewSecret(utils.AlphaNumeric("7")))
|
||||
fps := []string{
|
||||
"glrt-tx_xxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxx",
|
||||
}
|
||||
|
||||
return utils.Validate(r, tps, fps)
|
||||
}
|
||||
|
||||
func GitlabScimToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "gitlab-scim-token",
|
||||
|
||||
@@ -2220,6 +2220,13 @@ regex = '''glrt-[0-9a-zA-Z_\-]{20}'''
|
||||
entropy = 3
|
||||
keywords = ["glrt-"]
|
||||
|
||||
[[rules]]
|
||||
id = "gitlab-runner-authentication-token-routable"
|
||||
description = "Discovered a GitLab Runner Authentication Token (Routable), posing a risk to CI/CD pipeline integrity and unauthorized access."
|
||||
regex = '''\bglrt-t\d_[0-9a-zA-Z_\-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b'''
|
||||
entropy = 4
|
||||
keywords = ["glrt-"]
|
||||
|
||||
[[rules]]
|
||||
id = "gitlab-scim-token"
|
||||
description = "Discovered a GitLab SCIM Token, posing a risk to unauthorized access for a organization or instance."
|
||||
|
||||
Reference in new issue
Block a user