trufflehog
trufflehog copied to clipboard
Not working against --mirror repos
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
- Download a repo with the --mirror option (
git clone --mirror https://github.com/trufflesecurity/trufflehog) - 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
It looks like bare repos are not supported. Could you clone without --mirror instead?
@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.
@BeanBagKing @dustin-decker added support in #1499
closing as this issue has been resolved. followed the gist in the description without issue