mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
limit leak len to 200 characters
This commit is contained in:
1 parent
ef38b69c39
commit
ace8de93a9
2 files changed
+9
-6
No files matched your search
+1
-6
@@ -123,12 +123,8 @@ func InspectString(content string, c *object.Commit, repo *Repo, filename string
|
||||
for _, line := range strings.Split(content, "\n") {
|
||||
entropyTripped := trippedEntropy(line, rule)
|
||||
if entropyTripped && !ruleContainRegex(rule) {
|
||||
_line := line
|
||||
if len(_line) > maxLineLen {
|
||||
_line = line[0 : maxLineLen-1]
|
||||
}
|
||||
repo.Manager.SendLeaks(manager.Leak{
|
||||
Line: _line,
|
||||
Line: line,
|
||||
Offender: fmt.Sprintf("Entropy range %+v", rule.Entropy),
|
||||
Commit: c.Hash.String(),
|
||||
Repo: repo.Name,
|
||||
@@ -226,7 +222,6 @@ func InspectString(content string, c *object.Commit, repo *Repo, filename string
|
||||
line = strings.ReplaceAll(line, offender, "REDACTED")
|
||||
offender = "REDACTED"
|
||||
}
|
||||
|
||||
repo.Manager.SendLeaks(manager.Leak{
|
||||
Line: line,
|
||||
Offender: offender,
|
||||
|
||||
Reference in new issue
Block a user