mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Reduce noise when running entropy checks
When there's a word on a line with high entropy, we check if the line matches any of the regex configured on the `lineregexes` element of the `entropy` section. If so, it's marked as a leaked. This has reduced the number of leaks found with entropy enabled up to 80%
This commit is contained in:
1 parent
b902d7310a
commit
ea49078ffd
2 files changed
+53
-15
No files matched your search
+2
-2
@@ -590,7 +590,7 @@ func TestAuditRepo(t *testing.T) {
|
||||
testOpts: Options{
|
||||
Entropy: 4.7,
|
||||
},
|
||||
numLeaks: 6,
|
||||
numLeaks: 2,
|
||||
},
|
||||
{
|
||||
repo: leaksRepo,
|
||||
@@ -611,7 +611,7 @@ func TestAuditRepo(t *testing.T) {
|
||||
{
|
||||
repo: leaksRepo,
|
||||
description: "toml entropy range",
|
||||
numLeaks: 298,
|
||||
numLeaks: 58,
|
||||
configPath: path.Join(configsDir, "entropy"),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user