Open rgmz opened 1 year ago
This seems trivial to implement:
# assuming the origin is GitHub, which can be checked with `git ls-remote`
git fetch origin "+refs/pull/*:refs/heads/pull/*"
can this behaviour be confirmed to be present in TruffleHog?
Community Note
Description
This article featured on HackerNews reminded me that both GitHub and GitLab have refs for (merge|pull) requests that — to my knowledge — aren't pulled by default. This is especially juicy for TruffleHog because PRs may contain commits or alternate history with valid secrets that technically no longer exist in the repository.
GitHub
GitLab
Others
Problem to be Addressed
Find valid secrets that may be hidden in old PR histories.
Description of the Preferred Solution
Off the top of my head, I do not have any ideas on how to tackle this. It seems that you need to manually query for (
git ls-remote
) and checkout each ref in a detached state. The history will not show up viagit log
otherwise.Scanning refs could result in the same commits being scanned twice. I am not sure if this would produce duplicate results, or if we already deduplicate results.
Additional Context
N/A
References
N/A