This commit is contained in:
Zach Rice committed 2022-03-11 16:25:22 -06:00
1 parent 7bca6e757b
commit 165df09348
1 file changed
+3 -3
+3 -3
View File
@@ -170,12 +170,12 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
}
// check entropy
finding.Entropy = float32(shannonEntropy(secret))
if rule.EntropySet() && finding.Entropy <= float32(rule.Entropy) {
entropy := shannonEntropy(finding.Secret)
finding.Entropy = float32(entropy)
if rule.EntropySet() && entropy <= rule.Entropy {
// entropy is too low, skip this finding
return findings
}
findings = append(findings, finding)
}
return findings