Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Use pointer to config (#715)
Bill Rich5ad3bbde3713
diff --git a/main.go b/main.goindex a7dfb1a9f..452dd8ad9 100644--- a/main.go+++ b/main.go@@ -192,7 +192,7 @@ func run(state overseer.State) {defer os.RemoveAll(repoPath)}- g := func(c sources.Config) {+ g := func(c *sources.Config) {c.RepoPath = repoPathc.HeadRef = *gitScanBranchc.BaseRef = *gitScanSinceCommit@@ -208,7 +208,7 @@ func run(state overseer.State) {log.Fatal("You must specify at least one organization or repository.")}- github := func(c sources.Config) {+ github := func(c *sources.Config) {c.Endpoint = *githubScanEndpointc.Repos = *githubScanReposc.Orgs = *githubScanOrgs@@ -222,7 +222,7 @@ func run(state overseer.State) {logrus.WithError(err).Fatal("Failed to scan Github.")}case gitlabScan.FullCommand():- gitlab := func(c sources.Config) {+ gitlab := func(c *sources.Config) {c.Endpoint = *gitlabScanEndpointc.Token = *gitlabScanTokenc.Repos = *gitlabScanRepos@@ -232,7 +232,7 @@ func run(state overseer.State) {logrus.WithError(err).Fatal("Failed to scan GitLab.")}case filesystemScan.FullCommand():- fs := func(c sources.Config) {+ fs := func(c *sources.Config) {c.Directories = *filesystemDirectories}@@ -240,7 +240,7 @@ func run(state overseer.State) {logrus.WithError(err).Fatal("Failed to scan filesystem")}case s3Scan.FullCommand():- s3 := func(c sources.Config) {+ s3 := func(c *sources.Config) {c.Key = *s3ScanKeyc.Secret = *s3ScanSecretc.Buckets = *s3ScanBuckets@@ -250,7 +250,7 @@ func run(state overseer.State) {logrus.WithError(err).Fatal("Failed to scan S3.")}case syslogScan.FullCommand():- syslog := func(c sources.Config) {+ syslog := func(c *sources.Config) {c.Address = *syslogAddressc.Protocol = *syslogProtocolc.CertPath = *syslogTLSCertdiff --git a/pkg/sources/sources.go b/pkg/sources/sources.goindex 9a323883d..ea0d36c71 100644--- a/pkg/sources/sources.go+++ b/pkg/sources/sources.go@@ -96,12 +96,12 @@ type Config struct {}// NewConfig returns a new Config with optional values.-func NewConfig(opts ...func(Config)) Config {- c := Config{}+func NewConfig(opts ...func(*Config)) Config {+ c := &Config{}for _, opt := range opts {opt(c)}- return c+ return *c}// PercentComplete is used to update job completion percentages across sources