Skip to content

Find, verify, and analyze leaked credentials

Add terminal output for analyze, if detector support it (#3959)

Kashif Khan00ba5a6cd56a
diff --git a/pkg/output/plain.go b/pkg/output/plain.go
index d62eea8ab..283cab997 100644
--- a/pkg/output/plain.go
+++ b/pkg/output/plain.go
@@ -100,6 +100,12 @@ func (p *PlainPrinter) Print(_ context.Context, r *detectors.ResultWithMetadata)
for _, k := range aggregateDataKeys {
printer.Printf("%s: %v\n", cases.Title(language.AmericanEnglish).String(k), aggregateData[k])
}
+
+ // if analysis info is not nil, means the detector added key for analyzer and result is verified
+ if r.Result.AnalysisInfo != nil && r.Result.Verified {
+ printer.Printf("Analyze: Run `trufflehog analyze` to analyze this key's permissions\n")
+ }
+
fmt.Println("")
return nil
}