mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
shannon entropy for base64 and hex, more options
This commit is contained in:
1 parent
8f352bd840
commit
bc26e979c5
5 files changed
+79
-46
No files matched your search
@@ -85,14 +85,8 @@ func getLeaks(repoName string, opts *Options) []LeakElem {
|
||||
gitLeakReceiverWG sync.WaitGroup
|
||||
gitLeaks = make(chan LeakElem)
|
||||
report []LeakElem
|
||||
concurrency = 10
|
||||
)
|
||||
|
||||
if opts.Concurrency != 0 {
|
||||
concurrency = opts.Concurrency
|
||||
}
|
||||
|
||||
semaphoreChan := make(chan struct{}, concurrency)
|
||||
semaphoreChan := make(chan struct{}, opts.Concurrency)
|
||||
|
||||
go func(commitWG *sync.WaitGroup, gitLeakReceiverWG *sync.WaitGroup) {
|
||||
for gitLeak := range gitLeaks {
|
||||
@@ -143,7 +137,7 @@ func getLeaks(repoName string, opts *Options) []LeakElem {
|
||||
}
|
||||
|
||||
for _, line := range lines {
|
||||
leakPrs = checkShannonEntropy(line, opts.EntropyCutoff)
|
||||
leakPrs = checkShannonEntropy(line, opts.B64EntropyCutoff, opts.HexEntropyCutoff)
|
||||
if leakPrs {
|
||||
if opts.Strict && containsStopWords(line) {
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user