mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
adding a ton of stopwords to the generic rule only as that is the loudest rule (#851)
This commit is contained in:
1 parent
8481f0e9cd
commit
f93e5dc844
12 files changed
+3003
-44
No files matched your search
@@ -28,14 +28,6 @@ const (
|
||||
secretSuffix = `)(?:['|\"|\n|\r|\s|\x60]|$)`
|
||||
)
|
||||
|
||||
var DefaultStopWords = []string{
|
||||
"client",
|
||||
"endpoint",
|
||||
"vpn",
|
||||
"_ec2_",
|
||||
"aws_",
|
||||
}
|
||||
|
||||
func generateSemiGenericRegex(identifiers []string, secretRegex string) *regexp.Regexp {
|
||||
var sb strings.Builder
|
||||
sb.WriteString(caseInsensitive)
|
||||
@@ -73,13 +65,10 @@ func validate(r config.Rule, truePositives []string, falsePositives []string) *c
|
||||
d := detect.NewDetector(config.Config{
|
||||
Rules: []*config.Rule{&r},
|
||||
Keywords: keywords,
|
||||
Allowlist: config.Allowlist{
|
||||
StopWords: DefaultStopWords,
|
||||
},
|
||||
})
|
||||
for _, tp := range truePositives {
|
||||
if len(d.DetectString(tp)) != 1 {
|
||||
log.Fatal().Msgf("Failed to validate (tp) %s", r.RuleID)
|
||||
log.Fatal().Msgf("Failed to validate (tp) %s %s", r.RuleID, tp)
|
||||
}
|
||||
}
|
||||
for _, fp := range falsePositives {
|
||||
|
||||
Reference in new issue
Block a user