mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
feat(rule): validate & sort rule when generating (#1817)
This commit is contained in:
1 parent
107a41827b
commit
cfdeb0d7e0
18 files changed
+145
-115
No files matched your search
@@ -36,7 +36,7 @@ func GenericCredential() *config.Rule {
|
||||
"token",
|
||||
},
|
||||
Entropy: 3.5,
|
||||
Allowlists: []config.Allowlist{
|
||||
Allowlists: []*config.Allowlist{
|
||||
{
|
||||
// NOTE: this is a goofy hack to get around the fact there golang's regex engine does not support positive lookaheads.
|
||||
// Ideally we would want to ensure the secret contains both numbers and alphabetical characters, not just alphabetical characters.
|
||||
@@ -281,7 +281,7 @@ jdbc.snowflake.url=`,
|
||||
}
|
||||
|
||||
func newPlausibleSecret(regex string) string {
|
||||
allowList := config.Allowlist{StopWords: DefaultStopWords}
|
||||
allowList := &config.Allowlist{StopWords: DefaultStopWords}
|
||||
// attempt to generate a random secret,
|
||||
// retrying until it contains at least one digit and no stop words
|
||||
// TODO: currently the DefaultStopWords list contains many short words,
|
||||
|
||||
Reference in new issue
Block a user