mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
1 parent
973d74e592
commit
86cfe0848b
34 files changed
+232
-36
No files matched your search
@@ -81,15 +81,19 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) {
|
||||
|
||||
for i, line := range strings.Split(content, "\n") {
|
||||
for _, rule := range fs.cfg.Rules {
|
||||
if rule.AllowList.FileAllowed(filepath.Base(f.Name)) ||
|
||||
rule.AllowList.PathAllowed(f.Name) ||
|
||||
rule.AllowList.CommitAllowed(fs.commit.Hash.String()) {
|
||||
continue
|
||||
}
|
||||
|
||||
offender := rule.Inspect(line)
|
||||
|
||||
if offender == "" {
|
||||
continue
|
||||
}
|
||||
if fs.cfg.Allowlist.RegexAllowed(line) ||
|
||||
rule.AllowList.FileAllowed(filepath.Base(f.Name)) ||
|
||||
rule.AllowList.PathAllowed(f.Name) ||
|
||||
rule.AllowList.CommitAllowed(fs.commit.Hash.String()) {
|
||||
|
||||
if fs.cfg.Allowlist.RegexAllowed(line) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user