mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
refactor(generic-api-key): remove hard-coded 'magic' (#1600)
This commit is contained in:
1 parent
748076d976
commit
c4526b2c55
4 files changed
+11
-23
No files matched your search
@@ -39,6 +39,13 @@ func GenericCredential() *config.Rule {
|
||||
},
|
||||
Entropy: 3.5,
|
||||
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.
|
||||
Regexes: []*regexp.Regexp{
|
||||
regexp.MustCompile(`^[a-zA-Z_.-]+$`),
|
||||
},
|
||||
},
|
||||
{
|
||||
Description: "Allowlist for Generic API Keys",
|
||||
MatchCondition: config.AllowlistMatchOr,
|
||||
|
||||
Reference in new issue
Block a user