mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
1 parent
973d74e592
commit
86cfe0848b
34 files changed
+232
-36
No files matched your search
+7
-4
@@ -103,14 +103,17 @@ func (cs *CommitScanner) Scan() (Report, error) {
|
||||
// Check the actual content
|
||||
for _, line := range strings.Split(chunk.Content(), "\n") {
|
||||
for _, rule := range cs.cfg.Rules {
|
||||
if rule.AllowList.FileAllowed(filepath.Base(to.Path())) ||
|
||||
rule.AllowList.PathAllowed(to.Path()) ||
|
||||
rule.AllowList.CommitAllowed(cs.commit.Hash.String()) {
|
||||
continue
|
||||
}
|
||||
offender := rule.Inspect(line)
|
||||
if offender == "" {
|
||||
continue
|
||||
}
|
||||
if cs.cfg.Allowlist.RegexAllowed(line) ||
|
||||
rule.AllowList.FileAllowed(filepath.Base(to.Path())) ||
|
||||
rule.AllowList.PathAllowed(to.Path()) ||
|
||||
rule.AllowList.CommitAllowed(cs.commit.Hash.String()) {
|
||||
|
||||
if cs.cfg.Allowlist.RegexAllowed(line) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user