the smartest filter

This commit is contained in:
Zachary Rice committed 2025-10-07 09:21:44 -05:00
1 parent 5f737c311b
commit 6eaf12267b
3 files changed
+13 -10

No files matched your search

+6 -10
View File
@@ -550,16 +550,6 @@ func (d *Detector) detectRule(fragment Fragment, currentRaw string, r config.Rul
}
}
// check if this is a generic rule
if r.SmartFilter {
if !d.passesSmartFilter(finding.Secret) {
// logger.Info().
// Str("finding", finding.Secret).
// Msg("skipping finding: fails smart filter")
continue
}
}
// check if the result matches any of the global allowlists.
if isAllowed, event := checkFindingAllowed(logger, finding, fragment, currentLine, d.Config.Allowlists); isAllowed {
event.Msg("skipping finding: global allowlist")
@@ -571,6 +561,12 @@ func (d *Detector) detectRule(fragment Fragment, currentRaw string, r config.Rul
event.Msg("skipping finding: rule allowlist")
continue
}
if r.SmartFilter {
if !d.passesSmartFilter(finding.Secret) {
continue
}
}
findings = append(findings, finding)
}