Add option to check string entropy

Strings with high entropy have a good probability of being a secret.
This commit is contained in:
Cristhian Amaya committed 2018-10-08 16:08:04 +02:00
1 parent 08498600d1
commit 1cb15242fd
3 files changed
+87 -26

No files matched your search

+16
View File
@@ -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 {