adding stopwords (#849)

* adding stopwords

* format readme, update default config
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-04-21 08:31:58 -05:00
1 parent 82f7d61593
commit 8481f0e9cd
64 files changed
+181 -109

No files matched your search

+6
View File
@@ -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)