diff --git a/detect/detect.go b/detect/detect.go index 347daffd..05db2229 100644 --- a/detect/detect.go +++ b/detect/detect.go @@ -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