Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Add metrics for command invocation (#3185)
Miccah97f8a4834b15
diff --git a/main.go b/main.goindex 62375ebf2..0dbf1f8d1 100644--- a/main.go+++ b/main.go@@ -299,7 +299,8 @@ func main() {}if !*noUpdate {- updateCfg.Fetcher = updater.Fetcher(usingTUI)+ topLevelCmd, _, _ := strings.Cut(cmd, " ")+ updateCfg.Fetcher = updater.Fetcher(topLevelCmd, usingTUI)}if version.BuildVersion == "dev" {updateCfg.Fetcher = nildiff --git a/pkg/updater/updater.go b/pkg/updater/updater.goindex 3e2516196..b8ad42020 100644--- a/pkg/updater/updater.go+++ b/pkg/updater/updater.go@@ -19,12 +19,13 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/version")-func Fetcher(tui bool) fetcher.Interface {- return &OSS{TUI: tui}+func Fetcher(cmd string, tui bool) fetcher.Interface {+ return &OSS{Cmd: cmd, TUI: tui}}type OSS struct {Interval time.Duration+ Cmd stringTUI boolUpdated bool}@@ -41,6 +42,7 @@ type FormData struct {OS stringArch stringCurrentVersion string+ Cmd stringTUI boolTimezone stringBinary string@@ -58,6 +60,7 @@ func (g *OSS) Fetch() (io.Reader, error) {OS: runtime.GOOS,Arch: runtime.GOARCH,CurrentVersion: version.BuildVersion,+ Cmd: g.Cmd,TUI: g.TUI,Timezone: zone,Binary: "trufflehog",