Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
move clenaup outside the engine (#2475)
ahrav41301bec8a41
diff --git a/main.go b/main.goindex b9e7ba4ef..390b1d338 100644--- a/main.go+++ b/main.go@@ -569,6 +569,10 @@ func run(state overseer.State) {logFatal(err, "engine failed to finish execution")}+ if err := cleantemp.CleanTempArtifacts(ctx); err != nil {+ ctx.Logger().Error(err, "error cleaning temp artifacts")+ }+metrics := e.GetMetrics()// Print results.logger.Info("finished scanning",diff --git a/pkg/engine/engine.go b/pkg/engine/engine.goindex 31d813545..0670b8a0c 100644--- a/pkg/engine/engine.go+++ b/pkg/engine/engine.go@@ -16,7 +16,6 @@ import (lru "github.com/hashicorp/golang-lru""google.golang.org/protobuf/proto"- "github.com/trufflesecurity/trufflehog/v3/pkg/cleantemp""github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/config""github.com/trufflesecurity/trufflehog/v3/pkg/context"@@ -541,10 +540,6 @@ func (e *Engine) Finish(ctx context.Context) error {close(e.results) // Detector workers are done, close the results channel and call it a day.e.WgNotifier.Wait() // Wait for the notifier workers to finish notifying results.- if err := cleantemp.CleanTempArtifacts(ctx); err != nil {- ctx.Logger().Error(err, "error cleaning temp artifacts")- }-e.metrics.ScanDuration = time.Since(e.metrics.scanStartTime)return err