* wip keywords optimization

* update readme

* limit concurrency to 4

* update readme
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-04-05 11:50:50 -05:00
1 parent 237b03af18
commit b0a958f55e
6 files changed
+182 -40

No files matched your search

+11
View File
@@ -154,6 +154,17 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
return findings
}
containsKeyword := false
for _, k := range rule.Keywords {
if strings.Contains(fragment.Raw, k) {
containsKeyword = true
break
}
}
if !containsKeyword && len(rule.Keywords) != 0 {
return findings
}
matchIndices := rule.Regex.FindAllStringIndex(fragment.Raw, -1)
for _, matchIndex := range matchIndices {
// extract secret from match