mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
1 parent
94f5950d68
commit
c637b129ec
8 files changed
+29
-55
No files matched your search
+16
-17
@@ -20,11 +20,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
diffAddPrefix = "+"
|
||||
diffAddFilePrefix = "+++ b"
|
||||
diffAddPrefix = "+"
|
||||
diffAddFilePrefix = "+++ b"
|
||||
diffAddFilePrefixSlash = "+++ b/"
|
||||
diffLineSignature = " @@"
|
||||
defaultLineNumber = -1
|
||||
diffLineSignature = " @@"
|
||||
defaultLineNumber = -1
|
||||
)
|
||||
|
||||
// CheckRules accepts bundle and checks each rule defined in the config against the bundle's content.
|
||||
@@ -76,18 +76,18 @@ func (repo *Repo) CheckRules(bundle *Bundle) {
|
||||
if !ruleContainRegex(rule) {
|
||||
repo.Manager.SendLeaks(manager.Leak{
|
||||
LineNumber: defaultLineNumber,
|
||||
Line: "N/A",
|
||||
Offender: "Filename/path offender: " + filename,
|
||||
Commit: bundle.Commit.Hash.String(),
|
||||
Repo: repo.Name,
|
||||
Message: bundle.Commit.Message,
|
||||
Rule: rule.Description,
|
||||
Author: bundle.Commit.Author.Name,
|
||||
Email: bundle.Commit.Author.Email,
|
||||
Date: bundle.Commit.Author.When,
|
||||
Tags: strings.Join(rule.Tags, ", "),
|
||||
File: filename,
|
||||
Operation: diffOpToString(bundle.Operation),
|
||||
Line: "N/A",
|
||||
Offender: "Filename/path offender: " + filename,
|
||||
Commit: bundle.Commit.Hash.String(),
|
||||
Repo: repo.Name,
|
||||
Message: bundle.Commit.Message,
|
||||
Rule: rule.Description,
|
||||
Author: bundle.Commit.Author.Name,
|
||||
Email: bundle.Commit.Author.Email,
|
||||
Date: bundle.Commit.Author.When,
|
||||
Tags: strings.Join(rule.Tags, ", "),
|
||||
File: filename,
|
||||
Operation: diffOpToString(bundle.Operation),
|
||||
})
|
||||
} else {
|
||||
//otherwise we check if it matches Content regex
|
||||
@@ -393,4 +393,3 @@ func isFilePathWhiteListed(filepath string, allowlist []config.Allowlist) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user