mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
cleanup
This commit is contained in:
1 parent
7bca6e757b
commit
165df09348
1 file changed
+3
-3
+3
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user