mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Feature: Adding the ability to extend configuration files (#926)
* init * working on default and path config extensions * adding trace log level, consolidating some code * cleaning things up, updating generate package * fix tests * formatting * adding tests for extend * extend not extends * formatting * only allow usedefault or path to be set * update readme * add note about allowlists * more readme, expand env var for path * actually dont support env var. ez attack
This commit is contained in:
1 parent
0d471653b5
commit
31650f01e7
17 files changed
+1073
-834
No files matched your search
+1
-1
@@ -136,7 +136,7 @@ func (d *Detector) DetectString(content string) []report.Finding {
|
||||
}
|
||||
|
||||
// detectRule scans the given fragment for the given rule and returns a list of findings
|
||||
func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Finding {
|
||||
func (d *Detector) detectRule(fragment Fragment, rule config.Rule) []report.Finding {
|
||||
var findings []report.Finding
|
||||
|
||||
// check if filepath or commit is allowed for this rule
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ func filter(findings []report.Finding, redact bool) []report.Finding {
|
||||
|
||||
genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1)
|
||||
betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1)
|
||||
log.Debug().Msgf("skipping %s finding (%s), %s rule takes precendence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
|
||||
log.Trace().Msgf("skipping %s finding (%s), %s rule takes precendence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
|
||||
include = false
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user