Re: [PATCH 2/4] trace2: redact passwords from https:// URLs by default
- From
Jeff King <peff@peff.net>
- Date
- Nov 27, 2023, 21:50 UTC
- Message-ID
- <20231127215052.GD87495@coredump.intra.peff.net>
- In-Reply-To
- <CABPp-BELjVqVEB3oVx3fMzmvNfE1f7muLR_2k912_C+SaQtZtg@mail.gmail.com>
On Thu, Nov 23, 2023 at 10:59:20AM -0800, Elijah Newren wrote:
Show 10 quoted lines
> > Let's at least avoid logging such secrets via Trace2, much like we avoid > > logging secrets in `http.c`. Much like the code in `http.c` is guarded > > via `GIT_TRACE_REDACT` (defaulting to `true`), we guard the new code via > > `GIT_TRACE2_REDACT` (also defaulting to `true`). > > Training users is hard. I appreciate the changes here to make trace2 > not be a leak vector, but is it time to perhaps consider bigger safety > measures: At the clone/fetch level, automatically warn loudly whenever > such a URL is provided, accompanied with a note that in the future it > will be turned into a hard error?
Yes, the password in such a case ends up in the plaintext .git/config file, which is not great.
There's some discussion and patches here:
https://lore.kernel.org/git/nycvar.QRO.7.76.6.1905172121130.46@tvgsbejvaqbjf.bet/
I meant to follow up on them, but never did.
-Peff