mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
adding stopwords (#849)
* adding stopwords * format readme, update default config
This commit is contained in:
1 parent
82f7d61593
commit
8481f0e9cd
64 files changed
+181
-109
No files matched your search
@@ -217,6 +217,12 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
|
||||
finding.Secret = secret
|
||||
}
|
||||
|
||||
// check if the secret is in the list of stopwords
|
||||
if rule.Allowlist.ContainsStopWord(finding.Secret) ||
|
||||
d.Config.Allowlist.ContainsStopWord(finding.Secret) {
|
||||
continue
|
||||
}
|
||||
|
||||
// check entropy
|
||||
entropy := shannonEntropy(finding.Secret)
|
||||
finding.Entropy = float32(entropy)
|
||||
|
||||
Reference in new issue
Block a user