mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13: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
|
// check entropy
|
||||||
finding.Entropy = float32(shannonEntropy(secret))
|
entropy := shannonEntropy(finding.Secret)
|
||||||
if rule.EntropySet() && finding.Entropy <= float32(rule.Entropy) {
|
finding.Entropy = float32(entropy)
|
||||||
|
if rule.EntropySet() && entropy <= rule.Entropy {
|
||||||
// entropy is too low, skip this finding
|
// entropy is too low, skip this finding
|
||||||
return findings
|
return findings
|
||||||
}
|
}
|
||||||
|
|
||||||
findings = append(findings, finding)
|
findings = append(findings, finding)
|
||||||
}
|
}
|
||||||
return findings
|
return findings
|
||||||
|
|||||||
Reference in new issue
Block a user