mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
1 parent
973d74e592
commit
86cfe0848b
34 files changed
+232
-36
No files matched your search
+9
-6
@@ -7,11 +7,11 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v7/config"
|
||||
"github.com/zricethezav/gitleaks/v7/options"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
@@ -36,7 +36,6 @@ func NewNoGitScanner(opts options.Options, cfg config.Config) *NoGitScanner {
|
||||
log.Error(err)
|
||||
return nil
|
||||
}
|
||||
|
||||
return ngs
|
||||
}
|
||||
|
||||
@@ -95,13 +94,17 @@ func (ngs *NoGitScanner) Scan() (Report, error) {
|
||||
lineNumber++
|
||||
for _, rule := range ngs.cfg.Rules {
|
||||
line := scanner.Text()
|
||||
|
||||
if rule.AllowList.FileAllowed(filepath.Base(p)) ||
|
||||
rule.AllowList.PathAllowed(p) {
|
||||
continue
|
||||
}
|
||||
|
||||
offender := rule.Inspect(line)
|
||||
if offender == "" {
|
||||
continue
|
||||
}
|
||||
if ngs.cfg.Allowlist.RegexAllowed(line) ||
|
||||
rule.AllowList.FileAllowed(filepath.Base(p)) ||
|
||||
rule.AllowList.PathAllowed(p) {
|
||||
if ngs.cfg.Allowlist.RegexAllowed(line) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user