|
|
@@ -7,7 +7,7 @@ import (
|
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
|
)
|
|
|
|
|
|
-func Gitlab() *config.Rule {
|
|
|
+func GitlabPat() *config.Rule {
|
|
|
// define rule
|
|
|
r := config.Rule{
|
|
|
Description: "GitLab Personal Access Token",
|
|
|
@@ -22,3 +22,35 @@ func Gitlab() *config.Rule {
|
|
|
}
|
|
|
return validate(r, tps, nil)
|
|
|
}
|
|
|
+
|
|
|
+func GitlabPipelineTriggerToken() *config.Rule {
|
|
|
+ // define rule
|
|
|
+ r := config.Rule{
|
|
|
+ Description: "GitLab Pipeline Trigger Token",
|
|
|
+ RuleID: "gitlab-ptt",
|
|
|
+ Regex: regexp.MustCompile(`glptt-[0-9a-f]{40}`),
|
|
|
+ Keywords: []string{"glptt-"},
|
|
|
+ }
|
|
|
+
|
|
|
+ // validate
|
|
|
+ tps := []string{
|
|
|
+ generateSampleSecret("gitlab", "glptt-"+secrets.NewSecret(hex("40"))),
|
|
|
+ }
|
|
|
+ return validate(r, tps, nil)
|
|
|
+}
|
|
|
+
|
|
|
+func GitlabRunnerRegistrationToken() *config.Rule {
|
|
|
+ // define rule
|
|
|
+ r := config.Rule{
|
|
|
+ Description: "GitLab Runner Registration Token",
|
|
|
+ RuleID: "gitlab-rrt",
|
|
|
+ Regex: regexp.MustCompile(`GR1348941[0-9a-zA-Z\-\_]{20}`),
|
|
|
+ Keywords: []string{"GR1348941"},
|
|
|
+ }
|
|
|
+
|
|
|
+ // validate
|
|
|
+ tps := []string{
|
|
|
+ generateSampleSecret("gitlab", "GR1348941"+secrets.NewSecret(alphaNumeric("20"))),
|
|
|
+ }
|
|
|
+ return validate(r, tps, nil)
|
|
|
+}
|