mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
Add option to check string entropy
Strings with high entropy have a good probability of being a secret.
This commit is contained in:
1 parent
08498600d1
commit
1cb15242fd
3 files changed
+87
-26
No files matched your search
@@ -560,6 +560,14 @@ func TestAuditRepo(t *testing.T) {
|
||||
numLeaks: 0,
|
||||
configPath: path.Join(configsDir, "repo"),
|
||||
},
|
||||
{
|
||||
repo: leaksRepo,
|
||||
description: "leaks present with entropy",
|
||||
testOpts: Options{
|
||||
Entropy: 4.7,
|
||||
},
|
||||
numLeaks: 7,
|
||||
},
|
||||
}
|
||||
|
||||
whiteListCommits = make(map[string]bool)
|
||||
@@ -686,6 +694,14 @@ func TestOptionGuard(t *testing.T) {
|
||||
description: "single search regex gaurd",
|
||||
expectedErrMsg: "",
|
||||
},
|
||||
{
|
||||
testOpts: Options{
|
||||
GithubOrg: "fakeOrg",
|
||||
Entropy: 9,
|
||||
},
|
||||
description: "Invalid entropy level guard",
|
||||
expectedErrMsg: "The maximum level of entropy is 8",
|
||||
},
|
||||
}
|
||||
g := goblin.Goblin(t)
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in new issue
Block a user