mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
smart filter
This commit is contained in:
1 parent
4fb43823ef
commit
5f737c311b
7 files changed
+199
-6
No files matched your search
+5
-3
@@ -45,9 +45,10 @@ type ViperConfig struct {
|
||||
// TODO: Remove this in 9.x.
|
||||
AllowList *viperRuleAllowlist
|
||||
|
||||
Allowlists []*viperRuleAllowlist
|
||||
Required []*viperRequired
|
||||
SkipReport bool
|
||||
Allowlists []*viperRuleAllowlist
|
||||
Required []*viperRequired
|
||||
SkipReport bool
|
||||
SmartFilter bool
|
||||
}
|
||||
// Deprecated: this is a shim for backwards-compatibility.
|
||||
// TODO: Remove this in 9.x.
|
||||
@@ -141,6 +142,7 @@ func (vc *ViperConfig) Translate() (Config, error) {
|
||||
Keywords: vr.Keywords,
|
||||
Tags: vr.Tags,
|
||||
SkipReport: vr.SkipReport,
|
||||
SmartFilter: vr.SmartFilter,
|
||||
}
|
||||
|
||||
// Parse the rule allowlists, including the older format for backwards compatibility.
|
||||
|
||||
@@ -626,6 +626,7 @@ keywords = [
|
||||
"secret",
|
||||
"token",
|
||||
]
|
||||
smartFilter=true
|
||||
[[rules.allowlists]]
|
||||
regexes = [
|
||||
'''^[a-zA-Z_.-]+$''',
|
||||
|
||||
@@ -52,6 +52,8 @@ type Rule struct {
|
||||
RequiredRules []*Required
|
||||
|
||||
SkipReport bool
|
||||
|
||||
SmartFilter bool
|
||||
}
|
||||
|
||||
type Required struct {
|
||||
|
||||
Reference in new issue
Block a user