Skip to content

Find, verify, and analyze leaked credentials

Make connection issues less jarring (#2730)

Dustin Decker0ce02fc827f5
diff --git a/pkg/detectors/falsepositives.go b/pkg/detectors/falsepositives.go
index 7559cfe1a..856c4ecf7 100644
--- a/pkg/detectors/falsepositives.go
+++ b/pkg/detectors/falsepositives.go
@@ -139,7 +139,6 @@ func FilterKnownFalsePositives(ctx context.Context, results []Result, falsePosit
switch result.DetectorType {
case detectorspb.DetectorType_CustomRegex:
filteredResults = append(filteredResults, result)
- break
case detectorspb.DetectorType_GCP,
detectorspb.DetectorType_URI,
detectorspb.DetectorType_AzureBatch,
@@ -149,7 +148,6 @@ func FilterKnownFalsePositives(ctx context.Context, results []Result, falsePosit
detectorspb.DetectorType_MongoDB,
detectorspb.DetectorType_JDBC:
filteredResults = append(filteredResults, result)
- break
default:
if result.Raw != nil {
if !IsKnownFalsePositive(string(result.Raw), falsePositives, wordCheck) {
diff --git a/pkg/output/plain.go b/pkg/output/plain.go
index 81afc832f..202e44cc4 100644
--- a/pkg/output/plain.go
+++ b/pkg/output/plain.go
@@ -17,12 +17,11 @@ import (
)
var (
- boldYellowPrinter = color.New(color.Bold, color.FgYellow)
- yellowPrinter = color.New(color.FgHiYellow)
- greenPrinter = color.New(color.FgHiGreen)
- boldGreenPrinter = color.New(color.Bold, color.FgHiGreen)
- whitePrinter = color.New(color.FgWhite)
- boldWhitePrinter = color.New(color.Bold, color.FgWhite)
+ yellowPrinter = color.New(color.FgYellow)
+ greenPrinter = color.New(color.FgHiGreen)
+ boldGreenPrinter = color.New(color.Bold, color.FgHiGreen)
+ whitePrinter = color.New(color.FgWhite)
+ boldWhitePrinter = color.New(color.Bold, color.FgWhite)
)
// PlainPrinter is a printer that prints results in plain text format.
@@ -49,13 +48,12 @@ func (p *PlainPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata)
if out.Verified {
boldGreenPrinter.Print("βœ… Found verified result πŸ·πŸ”‘\n")
- } else if out.VerificationError != nil {
- printer = yellowPrinter
- boldYellowPrinter.Print("⚠️ Found result - unable to verify due to error πŸ·πŸ”‘β—οΈ\n")
- printer.Printf("Verification Error: %s\n", out.VerificationError)
} else {
printer = whitePrinter
boldWhitePrinter.Print("Found unverified result πŸ·πŸ”‘β“\n")
+ if out.VerificationError != nil {
+ yellowPrinter.Printf("Verification issue: %s\n", out.VerificationError)
+ }
}
printer.Printf("Detector Type: %s\n", out.DetectorType)
printer.Printf("Decoder Type: %s\n", out.DecoderType)