mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 21:44:23 +01:00
Define multiple allowlists per rule (#1496)
* feat: multiple rule allowlists * feat(config): add allowlist 'condition'
This commit is contained in:
1 parent
8ea608595c
commit
aabe381539
26 files changed
+778
-247
No files matched your search
@@ -16,13 +16,15 @@ func NugetConfigPassword() *config.Rule {
|
||||
Path: regexp.MustCompile(`(?i)nuget\.config$`),
|
||||
Keywords: []string{"<add key="},
|
||||
Entropy: 1,
|
||||
Allowlist: config.Allowlist{
|
||||
Regexes: []*regexp.Regexp{
|
||||
// samples from https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file
|
||||
regexp.MustCompile(`33f!!lloppa`),
|
||||
regexp.MustCompile(`hal\+9ooo_da!sY`),
|
||||
// exclude environment variables
|
||||
regexp.MustCompile(`^\%\S.*\%$`),
|
||||
Allowlists: []config.Allowlist{
|
||||
{
|
||||
Regexes: []*regexp.Regexp{
|
||||
// samples from https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file
|
||||
regexp.MustCompile(`33f!!lloppa`),
|
||||
regexp.MustCompile(`hal\+9ooo_da!sY`),
|
||||
// exclude environment variables
|
||||
regexp.MustCompile(`^\%\S.*\%$`),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user