Skip to content

Commit

Permalink
fix: filter secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-syn committed Aug 7, 2024
1 parent 32cbfda commit 00d38c6
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pkg/crawler/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,21 @@ func SecretsMatch(url, body string, secretsFile *[]string) []scanner.SecretMatch

if len(res) > 0 {
for _, resSecret := range res {
sec := scanner.Secret{
Name: resSecret.DetectorType.String(),
Description: resSecret.DetectorType.String(),
Regex: "",
FalsePositives: []string{},
Poc: "",
if resSecret.Verified {
sec := scanner.Secret{
Name: resSecret.DetectorType.String(),
Description: resSecret.DetectorType.String(),
Regex: "",
FalsePositives: []string{},
Poc: "",
}
secretFound := scanner.SecretMatched{Secret: sec, URL: url, Match: string(resSecret.Raw)}

// prevent concurent write
sem.Acquire(ctx, 1)
secrets = append(secrets, secretFound)
sem.Release(1)
}
secretFound := scanner.SecretMatched{Secret: sec, URL: url, Match: string(resSecret.Raw)}

// prevent concurent write
sem.Acquire(ctx, 1)
secrets = append(secrets, secretFound)
sem.Release(1)
}
}
}(trufflehogScanner)
Expand Down

0 comments on commit 00d38c6

Please sign in to comment.