mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
skip content checks for path only rules
This commit is contained in:
1 parent
0b07625567
commit
e0745adbd2
1 file changed
+5
@@ -149,6 +149,11 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if path only rule, skip content checks
|
||||||
|
if rule.Regex == nil {
|
||||||
|
return findings
|
||||||
|
}
|
||||||
|
|
||||||
matchIndices := rule.Regex.FindAllStringIndex(fragment.Raw, -1)
|
matchIndices := rule.Regex.FindAllStringIndex(fragment.Raw, -1)
|
||||||
for _, matchIndex := range matchIndices {
|
for _, matchIndex := range matchIndices {
|
||||||
// extract secret from match
|
// extract secret from match
|
||||||
|
|||||||
Reference in new issue
Block a user