mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 11:44:23 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ae1def963 | ||
|
|
6517900e5a |
No files matched your search
@@ -209,7 +209,7 @@ commits = [ "commit-A", "commit-B"]
|
||||
paths = ['''one-file-path-regex''']
|
||||
regexes = ['''one-regex-within-the-already-matched-regex''']
|
||||
```
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/v8/config/gitleaks.toml) for examples and advice on writing regular expressions for secret detection.
|
||||
Refer to the default [gitleaks config](https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml) for examples and advice on writing regular expressions for secret detection.
|
||||
|
||||
### Tips on Writing Regular Expressions
|
||||
Gitleaks rules are defined by regular expressions and entropy ranges.
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gitleaks/go-gitdiff/gitdiff"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -39,6 +40,7 @@ func GitLog(source string, logOpts string) (<-chan *gitdiff.File, error) {
|
||||
}
|
||||
|
||||
go listenForStdErr(stderr)
|
||||
time.Sleep(50 * time.Millisecond) // HACK: to avoid https://github.com/zricethezav/gitleaks/issues/722
|
||||
|
||||
return gitdiff.Parse(stdout)
|
||||
}
|
||||
@@ -66,6 +68,7 @@ func GitDiff(source string, staged bool) (<-chan *gitdiff.File, error) {
|
||||
}
|
||||
|
||||
go listenForStdErr(stderr)
|
||||
time.Sleep(50 * time.Millisecond) // HACK: to avoid https://github.com/zricethezav/gitleaks/issues/722
|
||||
|
||||
return gitdiff.Parse(stdout)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user