mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
1 parent
973d74e592
commit
86cfe0848b
34 files changed
+232
-36
No files matched your search
+1
-1
@@ -47,7 +47,7 @@ func (a *AllowList) RepoAllowed(repo string) bool {
|
||||
|
||||
// IgnoreDotGit appends a `.git$` rule to ignore all .git paths. This is used for --no-git scans
|
||||
func (a *AllowList) IgnoreDotGit() error {
|
||||
re, err := regexp.Compile(".git$")
|
||||
re, err := regexp.Compile(".git")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+1
-1
@@ -159,6 +159,6 @@ title = "gitleaks config"
|
||||
[allowlist]
|
||||
description = "Allowlisted files"
|
||||
files = ['''^\.?gitleaks.toml$''',
|
||||
'''(.*?)(jpg|gif|doc|pdf|bin)$''',
|
||||
'''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''',
|
||||
'''(go.mod|go.sum)$''']
|
||||
`
|
||||
@@ -79,6 +79,9 @@ func (r *Rule) HasFileOrPathLeakOnly(filePath string) bool {
|
||||
if len(r.Entropies) != 0 {
|
||||
return false
|
||||
}
|
||||
if r.AllowList.FileAllowed(filepath.Base(filePath)) || r.AllowList.PathAllowed(filePath) {
|
||||
return false
|
||||
}
|
||||
return r.HasFileLeak(filepath.Base(filePath)) || r.HasFilePathLeak(filePath)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user