trufflehog icon indicating copy to clipboard operation
trufflehog copied to clipboard

Not working against --mirror repos

Open BeanBagKing opened this issue 3 years ago • 1 comments

Summary

Repositories cloned locally with the --mirror option (e.g. git clone --mirror https://github.com/trufflesecurity/trufflehog) do not work with ./trufflehog git file:///home/bbk/trufflehog.git. I'm honestly not sure if this is a bug or feature request, but I feel like it's more likely that it's somewhat that should work and functionality with this flag was overlooked, and therefore a bug.

TruffleHog Version

trufflehog 3.10.3 (Windows and Linux)

Trace Output

https://gist.github.com/BeanBagKing/3edfeecf22cfb7f5bbdf9b7f920543f5

Expected Behavior

Trufflehog should work against repos cloned with --mirror

Actual Behavior

Trufflehog reports could open repo: <file name> repository does not exist

Steps to Reproduce

  1. Download a repo with the --mirror option ( git clone --mirror https://github.com/trufflesecurity/trufflehog)
  2. Run Trufflehog against that repo (./trufflehog git file://<repo path>)

Environment

  • OS: Windows 11 and Kali Linux (both up-to-date as of 9/17/2022)

Additional Context

N/A

References

I brought this up in Slack: https://trufflehog-community.slack.com/archives/CK5PWLESK/p1663363640337329 I could find no other Issues or comments referencing --mirror, thus the reason that, upon consideration, I think this may be an overlooked issue (bug) and not a feature to be added (as git ffile:// does work against cloned repos in other cases).

  • #0000

BeanBagKing avatar Sep 17 '22 16:09 BeanBagKing

It looks like bare repos are not supported. Could you clone without --mirror instead?

dustin-decker avatar Oct 06 '22 16:10 dustin-decker

@dustin-decker in my case it's bare repos at GitLab side to use trufflehog with GitLab's pre-receive hooks. I cannot use another type of repos in this case.

savely-krasovsky avatar Jul 14 '23 15:07 savely-krasovsky

@BeanBagKing @dustin-decker added support in #1499

savely-krasovsky avatar Jul 15 '23 18:07 savely-krasovsky

closing as this issue has been resolved. followed the gist in the description without issue

zricethezav avatar Aug 25 '23 20:08 zricethezav