Computers are supposed to be good at what imperfect humans are not. This only proves how primitive the tool is. That is, for example, if Gmail can ask "it looks like you forgot the attachment" why can't Git say "this is a public repo and you're about to commit and push passwords. Are you sure?" It's going to be easier to fix the tool than it is to make humans be perfect.
GitHub commit search: “remove password”
61–70 of 266 posts
Re: GitHub commit search: “remove password”
#62Re: GitHub commit search: “remove password”
#63Re: GitHub commit search: “remove password”
#64Computers are supposed to be good at what imperfect humans are not. This only proves how primitive the tool is. That is, for example, if Gmail can ask "it looks like you forgot the attachment" why can't Git say "this is a public repo and you're about to commit and push passwords. Are you sure?" It's going to be easier to fix the tool than it is to make humans be perfect.
How would git know that it's a password/key/whatever?
In comparison Gmail doesn't catch all cases either, if you say something like "here are" instead of I've attached it misses it.
Re: GitHub commit search: “remove password”
#65http://stackoverflow.com/questions/1139762/ignore-files-that...
The other alternative I can think of is to hide sensitive values in environment variables
Re: GitHub commit search: “remove password”
#66Earlier quoted context omitted.
Indeed; but these actions complement each other.
if you revoke the credentials, removing them from the git history serves no purpose but disrupts everybody that has a clone of the repo. So you're doing harm for little benefit other than covering up the incident. A net loss, if you ask me.
E: Oh, and just to preempt this, even saying "i use only random passwords with no pattern" is useful information, as is having a ballpark password length.
Re: GitHub commit search: “remove password”
#67Computers are supposed to be good at what imperfect humans are not. This only proves how primitive the tool is. That is, for example, if Gmail can ask "it looks like you forgot the attachment" why can't Git say "this is a public repo and you're about to commit and push passwords. Are you sure?" It's going to be easier to fix the tool than it is to make humans be perfect.
How would git know that it's a password/key/whatever?
Passwords, look for variables with the name password, passwd assigned strings.
Like Gmails attachment, it'll get stuff wrong, just make it easy to continue on.
Re: GitHub commit search: “remove password”
#68How do you guys, handle this problem? I use either `git-crypt` [1] or `ansible-vault` [2]. 1: https://github.com/AGWA/git-crypt 2: http://docs.ansible.com/ansible/playbooks_vault.html
Re: GitHub commit search: “remove password”
#69Earlier quoted context omitted.
They do this for all of their own API keys already. They not only notify you but instantly invalidate a key pushed to a public repo. Annoyingly there is no way to turn it off even when you explicitly want to share an API key knowingly. But i'm more than fine with needing to "obfuscate" an API key or manage secrets correctly knowing it saves TONS of people.
Why would you ever want to share a valid Github API key publicly?
Re: GitHub commit search: “remove password”
#70Computers are supposed to be good at what imperfect humans are not. This only proves how primitive the tool is. That is, for example, if Gmail can ask "it looks like you forgot the attachment" why can't Git say "this is a public repo and you're about to commit and push passwords. Are you sure?" It's going to be easier to fix the tool than it is to make humans be perfect.
Git would have to first decide whether a file is a textfile or binary file, a decision that can be done reasonably well heuristically but that is undecidable in the general case. Then it has to parse text files for a long, curated list of known keywords that are only used for storing API keys and are not (usually) used in normal code. I'm not sure if that's even feasable.
And then of course git has no concept of "public" and "private" repos, so the entire task can't be handled well by git.