mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Standardize/alphabetize rules, add cmd/generate/config package (#840)
This commit is contained in:
1 parent
e784980515
commit
606bb1a13b
62 files changed
+2959
-642
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func Gitlab() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Gitlab Personal Access Token",
|
||||
RuleID: "gitlab-pat",
|
||||
Regex: regexp.MustCompile(`glpat-[0-9a-zA-Z\-\_]{20}`),
|
||||
Keywords: []string{"glpat-"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{"gitlabPAT := \"glpat-" + sampleAlphaNumeric20Token + "\""}
|
||||
return validate(r, tps)
|
||||
}
|
||||
Reference in new issue
Block a user