trufflehog icon indicating copy to clipboard operation
trufflehog copied to clipboard

Optionally exclude sources from binary

Open rgmz opened this issue 7 months ago • 4 comments

Description:

Inspired by https://trufflesecurity.com/blog/introducing-trufflehog-s-burp-suite-extension-a-techical-deep-dive:

Extension size bloat: TruffleHog is ~170Mb.

Pros

  • Significantly reduces how long it takes to run go build due to sources I don't use
  • Lets me build an 80Mb binary (saving between 50-70Mb)
$ go build -tags "no_circleci,no_docker,no_elasticsearch,no_gcs,no_git,no_github,no_gitlab,no_huggingface,no_jenkins,no_postman,no_s3,no_syslog,no_travisci" -ldflags="-s -w"
$ ls -lh ./trufflehog
-rwxr-xr-x. 1 user user 80M Mar 13 22:39 ./trufflehog

Cons

  • Awkward; adds a separate _disabled.go file for each source
  • Niche feature

Checklist:

  • [ ] Tests passing (make test-community)?
  • [x] Lint passing (make lint this requires golangci-lint)?

rgmz avatar Mar 14 '25 02:03 rgmz