mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04: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
@@ -431,18 +431,6 @@ MatchLoop:
|
||||
// entropy is too low, skip this finding
|
||||
continue
|
||||
}
|
||||
// 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 add a
|
||||
// restriction on generic rules regex that requires the secret match group
|
||||
// contains both numbers and alphabetical characters, not just alphabetical characters.
|
||||
// What this bit of code does is check if the ruleid is prepended with "generic" and enforces the
|
||||
// secret contains both digits and alphabetical characters.
|
||||
// TODO: this should be replaced with stop words
|
||||
if strings.HasPrefix(r.RuleID, "generic") {
|
||||
if !containsDigit(finding.Secret) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
// check if the regexTarget is defined in the allowlist "regexes" entry
|
||||
// or if the secret is in the list of stopwords
|
||||
|
||||
Reference in new issue
Block a user