trufflehog icon indicating copy to clipboard operation
trufflehog copied to clipboard

Feat: bitbucket app

Open x-stp opened this issue 5 months ago • 2 comments

fork off brandonjyan:bitbucketapppassword which lived here https://github.com/trufflesecurity/trufflehog/pull/1498

The previous complex logic has been replaced with a clean, single-pass approach using a unified credentialPatterns slice for simplicity and performance.

The entire detector has been brought up to current project standards, attempt w/ cleaner regex with named capture groups and improved resource handling.

xxlarge bench is 2x faster.

Checklist:

  • [ ✔️ ] Tests passing (make test-community)?

  • [ ✔️ ] Lint passing (make lint this requires golangci-lint)?

x-stp avatar Jun 07 '25 18:06 x-stp

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 07 '25 18:06 CLAassistant

ran some benchmarks where OLD == https://github.com/trufflesecurity/trufflehog/pull/1498

Benchmark Size GCP (Fastest) Bitfinex Hugging Face Bitbucket NEW Bitbucket OLD
xsmall 585.6 1,156 599.2 923.8 507.1
small 681.6 1,435 986.4 6,125 10,420
medium 1,280 3,721 4,845 67,149 129,749
large 6,524 24,868 42,898 777,381 1,525,966
xlarge 60,241 240,401 414,083 7,247,065 17,305,812
xxlarge 748,382 2,563,427 4,265,669 75,731,043 145,927,025

still not really satisfied as these regexes are quite slow.

@amanfcp, thx for the pointers, I tried to port the feedback in while going through some more recently added detectors. This should be ready for a fresh look when you have a moment; though I am not a fan of the slow regexes.

x-stp avatar Jun 11 '25 21:06 x-stp

Thanks @x-stp for incorporating the pointers. Can you please resolve the conflicts?

amanfcp avatar Jun 23 '25 11:06 amanfcp

detector code already lacks uniformity across various files, we should try to stick to the core format as much as we can.

bugbaba avatar Jul 16 '25 05:07 bugbaba

detector code already lacks uniformity across various files, we should try to stick to the core format as much as we can.

Hi @bugbaba

I will go over the comments soon and get back to you.

Thanks!

x-stp avatar Jul 16 '25 05:07 x-stp