git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* RFC: "git config -l" should not expose sensitive information
@ 2012-12-17 11:35 Toralf Förster
  2012-12-20 15:04 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Toralf Förster @ 2012-12-17 11:35 UTC (permalink / raw)
  To: git

often the output is requested in help forums - and a
"git config -l | wgetpaste" exposes parameters like sendmail.smtppass -
so hide those variables in the output (if not explicitly wanted) would
makes sense, or ?

-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-17 11:35 RFC: "git config -l" should not expose sensitive information Toralf Förster
@ 2012-12-20 15:04 ` Jeff King
  2012-12-20 15:49   ` Aaron Schrab
  2012-12-20 15:51   ` Michael Haggerty
  0 siblings, 2 replies; 10+ messages in thread
From: Jeff King @ 2012-12-20 15:04 UTC (permalink / raw)
  To: Toralf Förster; +Cc: git

On Mon, Dec 17, 2012 at 12:35:54PM +0100, Toralf Förster wrote:

> often the output is requested in help forums - and a
> "git config -l | wgetpaste" exposes parameters like sendmail.smtppass -
> so hide those variables in the output (if not explicitly wanted) would
> makes sense, or ?

But if we change "git config -l", won't that break all of the
non-exposing uses that rely on seeing all of the variables (e.g., it is
perfectly fine for a porcelain to parse "git config -l" rather than
making several calls to "git config"; IIRC, git-cola does this).

The problem seems to be that people are giving bad advice to tell people
to post "git config -l" output without looking at. Maybe we could help
them with a "git config --share-config" option that dumps all config,
but sanitizes the output. It would need to have a list of sensitive keys
(which does not exist yet), and would need to not just mark up things
like smtppass, but would also need to pull credential information out of
remote.*.url strings. And maybe more (I haven't thought too long on it).

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:04 ` Jeff King
@ 2012-12-20 15:49   ` Aaron Schrab
  2012-12-20 15:52     ` Jeff King
  2012-12-20 16:20     ` Toralf Förster
  2012-12-20 15:51   ` Michael Haggerty
  1 sibling, 2 replies; 10+ messages in thread
From: Aaron Schrab @ 2012-12-20 15:49 UTC (permalink / raw)
  To: Jeff King; +Cc: Toralf Förster, git

At 10:04 -0500 20 Dec 2012, Jeff King <peff@peff.net> wrote:
>The problem seems to be that people are giving bad advice to tell 
>people to post "git config -l" output without looking at. Maybe we 
>could help them with a "git config --share-config" option that dumps 
>all config, but sanitizes the output. It would need to have a list of 
>sensitive keys (which does not exist yet), and would need to not just 
>mark up things like smtppass, but would also need to pull credential 
>information out of remote.*.url strings. And maybe more (I haven't 
>thought too long on it).

If such an option is added, it is likely to cause more people to think 
that there is no need to examine the output before sharing it.  But, I 
don't think that the sanitizing could ever be sufficient to guarantee 
that.

Tools outside of the core git tree may add support for new config keys 
which are meant to contain sensitive information, and there would be no 
way for `git config` to know about those.

Even for known sensitive keys, the person entering it might have made a 
typo in the name (e.g.  smptpass) preventing it from being recognized as 
sensitive by the software, but easily recognizable as such by a human.

There's also the problem of varying opinions on what is considered as 
sensitive.  You mention credential information in URLs, but some people 
may consider the entire URL as something which they would not want to 
expose.

I think that attempting to do this would only result in a false sense of 
security.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:04 ` Jeff King
  2012-12-20 15:49   ` Aaron Schrab
@ 2012-12-20 15:51   ` Michael Haggerty
  2012-12-20 15:54     ` Jeff King
  2012-12-20 18:49     ` Junio C Hamano
  1 sibling, 2 replies; 10+ messages in thread
From: Michael Haggerty @ 2012-12-20 15:51 UTC (permalink / raw)
  To: Jeff King; +Cc: Toralf Förster, git

On 12/20/2012 04:04 PM, Jeff King wrote:
> On Mon, Dec 17, 2012 at 12:35:54PM +0100, Toralf Förster wrote:
>> often the output is requested in help forums - and a
>> "git config -l | wgetpaste" exposes parameters like sendmail.smtppass -
>> so hide those variables in the output (if not explicitly wanted) would
>> makes sense, or ?
> 
> But if we change "git config -l", won't that break all of the
> non-exposing uses that rely on seeing all of the variables (e.g., it is
> perfectly fine for a porcelain to parse "git config -l" rather than
> making several calls to "git config"; IIRC, git-cola does this).
> 
> The problem seems to be that people are giving bad advice to tell people
> to post "git config -l" output without looking at. Maybe we could help
> them with a "git config --share-config" option that dumps all config,
> but sanitizes the output. It would need to have a list of sensitive keys
> (which does not exist yet), and would need to not just mark up things
> like smtppass, but would also need to pull credential information out of
> remote.*.url strings. And maybe more (I haven't thought too long on it).

I think the problem is yet another step earlier: why do we build tools
that encourage people to store passwords in plaintext in a configuration
file that is by default world-readable?

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:49   ` Aaron Schrab
@ 2012-12-20 15:52     ` Jeff King
  2012-12-20 18:37       ` Junio C Hamano
  2012-12-20 16:20     ` Toralf Förster
  1 sibling, 1 reply; 10+ messages in thread
From: Jeff King @ 2012-12-20 15:52 UTC (permalink / raw)
  To: git; +Cc: Toralf Förster

On Thu, Dec 20, 2012 at 10:49:15AM -0500, Aaron Schrab wrote:

> At 10:04 -0500 20 Dec 2012, Jeff King <peff@peff.net> wrote:
> >The problem seems to be that people are giving bad advice to tell
> >people to post "git config -l" output without looking at. Maybe we
> >could help them with a "git config --share-config" option that
> >dumps all config, but sanitizes the output. It would need to have a
> >list of sensitive keys (which does not exist yet), and would need
> >to not just mark up things like smtppass, but would also need to
> >pull credential information out of remote.*.url strings. And maybe
> >more (I haven't thought too long on it).
> 
> If such an option is added, it is likely to cause more people to
> think that there is no need to examine the output before sharing it.
> But, I don't think that the sanitizing could ever be sufficient to
> guarantee that.
> 
> Tools outside of the core git tree may add support for new config
> keys which are meant to contain sensitive information, and there
> would be no way for `git config` to know about those.

Good point. I was a little on the fence already because any time you
have a "prevent known bad" list in a security setting, it is guaranteed
to go out of date and screw you. But the presence of third-party tools
means it does not even have to get out of date. It will always be
complete.

> I think that attempting to do this would only result in a false sense
> of security.

Yeah. Thanks for a dose of sanity. I was really trying not to say "the
given advice is bad, and we cannot help those people". But I think you
are right; the only sensible path is for the user to inspect the output
before posting it.

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:51   ` Michael Haggerty
@ 2012-12-20 15:54     ` Jeff King
  2012-12-20 18:49     ` Junio C Hamano
  1 sibling, 0 replies; 10+ messages in thread
From: Jeff King @ 2012-12-20 15:54 UTC (permalink / raw)
  To: Michael Haggerty; +Cc: Toralf Förster, git

On Thu, Dec 20, 2012 at 04:51:37PM +0100, Michael Haggerty wrote:

> > The problem seems to be that people are giving bad advice to tell people
> > to post "git config -l" output without looking at. Maybe we could help
> > them with a "git config --share-config" option that dumps all config,
> > but sanitizes the output. It would need to have a list of sensitive keys
> > (which does not exist yet), and would need to not just mark up things
> > like smtppass, but would also need to pull credential information out of
> > remote.*.url strings. And maybe more (I haven't thought too long on it).
> 
> I think the problem is yet another step earlier: why do we build tools
> that encourage people to store passwords in plaintext in a configuration
> file that is by default world-readable?

Agreed. Most of it is hysterical raisins. We did not have any portable
secure storage for a long time. These days we have the credential helper
subsystem, which send-email can and should be using.

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:49   ` Aaron Schrab
  2012-12-20 15:52     ` Jeff King
@ 2012-12-20 16:20     ` Toralf Förster
  1 sibling, 0 replies; 10+ messages in thread
From: Toralf Förster @ 2012-12-20 16:20 UTC (permalink / raw)
  To: Jeff King, git

yep - understood


On 12/20/2012 04:49 PM, Aaron Schrab wrote:
> At 10:04 -0500 20 Dec 2012, Jeff King <peff@peff.net> wrote:
>> The problem seems to be that people are giving bad advice to tell
>> people to post "git config -l" output without looking at. Maybe we
>> could help them with a "git config --share-config" option that dumps
>> all config, but sanitizes the output. It would need to have a list of
>> sensitive keys (which does not exist yet), and would need to not just
>> mark up things like smtppass, but would also need to pull credential
>> information out of remote.*.url strings. And maybe more (I haven't
>> thought too long on it).
> 
> If such an option is added, it is likely to cause more people to think
> that there is no need to examine the output before sharing it.  But, I
> don't think that the sanitizing could ever be sufficient to guarantee that.
> 
> Tools outside of the core git tree may add support for new config keys
> which are meant to contain sensitive information, and there would be no
> way for `git config` to know about those.
> 
> Even for known sensitive keys, the person entering it might have made a
> typo in the name (e.g.  smptpass) preventing it from being recognized as
> sensitive by the software, but easily recognizable as such by a human.
> 
> There's also the problem of varying opinions on what is considered as
> sensitive.  You mention credential information in URLs, but some people
> may consider the entire URL as something which they would not want to
> expose.
> 
> I think that attempting to do this would only result in a false sense of
> security.
> 


-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:52     ` Jeff King
@ 2012-12-20 18:37       ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2012-12-20 18:37 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Toralf Förster

Jeff King <peff@peff.net> writes:

> Yeah. Thanks for a dose of sanity. I was really trying not to say "the
> given advice is bad, and we cannot help those people". But I think you
> are right; the only sensible path is for the user to inspect the output
> before posting it.

True.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 15:51   ` Michael Haggerty
  2012-12-20 15:54     ` Jeff King
@ 2012-12-20 18:49     ` Junio C Hamano
  2012-12-20 22:31       ` Andrew Ardill
  1 sibling, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2012-12-20 18:49 UTC (permalink / raw)
  To: Michael Haggerty; +Cc: Jeff King, Toralf Förster, git

Michael Haggerty <mhagger@alum.mit.edu> writes:

> I think the problem is yet another step earlier: why do we build tools
> that encourage people to store passwords in plaintext in a configuration
> file that is by default world-readable?

True.  This particular one mentioned in the thread predates
credential helpers, so it is not faire to say "encourage".
We didn't and we don't.

Care to do a patch to deprecate sendemail.smtppass (i.e. give
warnings to users when it is used) and perhaps replace it with
something based on the credential store or something?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: RFC: "git config -l" should not expose sensitive information
  2012-12-20 18:49     ` Junio C Hamano
@ 2012-12-20 22:31       ` Andrew Ardill
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Ardill @ 2012-12-20 22:31 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Michael Haggerty, Jeff King, Toralf Förster,
	git@vger.kernel.org

On 21 December 2012 02:49, Aaron Schrab <aaron@schrab.com> wrote:
> Tools outside of the core git tree may add support for new config keys which
> are meant to contain sensitive information, and there would be no way for
> `git config` to know about those.

I understand that we've come down mostly on the 'users must check
before sending' side of things, but this point isn't necessarily true.

It wouldn't be too hard to create a config setting with a list of
'sensitive' keys filled with sensible defaults. It would be the job of
the 3rd party to add the relevant keys to this config file. This
wouldn't help with old 3rd party tools but would provide a way to
'hide' things automatically. A user could of course configure this
themselves (though one would think most who knew how wouldn't need
to).

On 21 December 2012 02:52, Jeff King <peff@peff.net> wrote:
>> I think that attempting to do this would only result in a false sense
>> of security.
>
> Yeah. Thanks for a dose of sanity. I was really trying not to say "the
> given advice is bad, and we cannot help those people". But I think you
> are right; the only sensible path is for the user to inspect the output
> before posting it.

One thing that a new option could provide (or maybe even the existing
option if it detects an interactive session) is to prompt the user to
review the content before outputting it. This is a nice way of helping
users who don't know that there might be sensitive information in the
output. Are there any use cases where prompting the user would be
annoying when using this command?

Regards,

Andrew Ardill

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-20 22:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-17 11:35 RFC: "git config -l" should not expose sensitive information Toralf Förster
2012-12-20 15:04 ` Jeff King
2012-12-20 15:49   ` Aaron Schrab
2012-12-20 15:52     ` Jeff King
2012-12-20 18:37       ` Junio C Hamano
2012-12-20 16:20     ` Toralf Förster
2012-12-20 15:51   ` Michael Haggerty
2012-12-20 15:54     ` Jeff King
2012-12-20 18:49     ` Junio C Hamano
2012-12-20 22:31       ` Andrew Ardill

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).