From 165df09348a759ab937b2d1d0576fccc3a08f255 Mon Sep 17 00:00:00 2001 From: Zach Rice Date: Fri, 11 Mar 2022 16:25:22 -0600 Subject: [PATCH] cleanup --- detect/detect.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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