|
@@ -84,7 +84,7 @@ func DetectFindings(cfg config.Config, b []byte, filePath string, commit string)
|
|
|
// extract secret from secret group if set
|
|
// extract secret from secret group if set
|
|
|
if r.SecretGroup != 0 {
|
|
if r.SecretGroup != 0 {
|
|
|
groups := r.Regex.FindStringSubmatch(secret)
|
|
groups := r.Regex.FindStringSubmatch(secret)
|
|
|
- if len(groups)-1 > r.SecretGroup || len(groups) == 0 {
|
|
|
|
|
|
|
+ if len(groups) <= r.SecretGroup || len(groups) == 0 {
|
|
|
// Config validation should prevent this
|
|
// Config validation should prevent this
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
@@ -108,13 +108,6 @@ func DetectFindings(cfg config.Config, b []byte, filePath string, commit string)
|
|
|
return dedupe(findings)
|
|
return dedupe(findings)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func limit(s string) string {
|
|
|
|
|
- if len(s) > 500 {
|
|
|
|
|
- return s[:500] + "..."
|
|
|
|
|
- }
|
|
|
|
|
- return s
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
func printFinding(f report.Finding) {
|
|
func printFinding(f report.Finding) {
|
|
|
var b []byte
|
|
var b []byte
|
|
|
b, _ = json.MarshalIndent(f, "", " ")
|
|
b, _ = json.MarshalIndent(f, "", " ")
|