Skip to content

Commit

Permalink
skip content checks for path only rules
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav committed Mar 29, 2022
1 parent 0b07625 commit e0745ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions detect/detect.go
Expand Up @@ -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)
for _, matchIndex := range matchIndices {
// extract secret from match
Expand Down

0 comments on commit e0745ad

Please sign in to comment.