RFC: "git config -l" should not expose sensitive information
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 ?
Signature · 3 lines
MfG/Sincerely Toralf Förster pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
Quoted 4 lines · Toralf Förster
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
Quoted 1 line · Jeff King
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.
Quoted 10 lines · Aaron Schrab
Quoted 8 lines · Jeff King
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).
Quoted 8 lines
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 configto 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.
Quoted 2 lines
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
Quoted 4 lines · Jeff King
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.
yep - understood
Quoted 30 lines · Aaron Schrab
Quoted 8 lines · Jeff King
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 configto 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.
Signature · 3 lines
MfG/Sincerely Toralf Förster pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
Quoted 11 lines · Jeff King
Quoted 4 lines · Toralf Förster
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).
Quoted 7 lines
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
Signature · 3 lines
Michael Haggerty [email protected] http://softwareswirl.blogspot.com/
Quoted 11 lines · Michael Haggerty
Quoted 7 lines
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
Quoted 3 lines · Michael Haggerty
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?
Quoted 3 lines · Aaron Schrab
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 configto 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).
Quoted 7 lines · Jeff King
Quoted 2 lines
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