Too many comments here recommend to clean up the commit and just hide the mistake under the rug. This is wrong. If you leak a password to any public location, there is only one reasonable course of action: CHANGE IT! Don't even bother rewriting the commit. Focus on changing that password right away, and while you're at it, figure out a better way to manage your secrets outside of your source code in the future. Mista…
GitHub commit search: “remove password”
151–160 of 266 posts
Re: GitHub commit search: “remove password”
#152How 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
Advantage of this approach is it encrypts the values individually instead of per file. This way the secrets files are git/review friendly.
Re: GitHub commit search: “remove password”
#153I liked this one: https://github.com/squared-one/omniauth-unsplash/commit/072b... "... It's not really removing any password, is it? But hey, why not use the momentum ... wheeeeeeeeeeeeeeeeee!"
- protected $password = '12root34';
+ protected $password = '';
"I'm a bit disappointed now that putting 'protected' in front of the password doesn't protect it ;)"Re: GitHub commit search: “remove password”
#154https://github.com/search?&q=mysqli_connect+http&type=Code
https://github.com/search?q="rds.amazonaws.com"&type=Code
etc...
Re: GitHub commit search: “remove password”
#155Earlier quoted context omitted.
I once pushed my Amazon S3 key to GitHub accidentally. Realized instantly what I'd done, and while in the process of feverishly regenerating a new key, my cell phone rings. It's Amazon telling me I pushed my S3 key to GH.
Whoa, that's actually amazing. Wonder how they got alerted and reacted so fast.
Re: GitHub commit search: “remove password”
#156Too many comments here recommend to clean up the commit and just hide the mistake under the rug. This is wrong. If you leak a password to any public location, there is only one reasonable course of action: CHANGE IT! Don't even bother rewriting the commit. Focus on changing that password right away, and while you're at it, figure out a better way to manage your secrets outside of your source code in the future. Mista…
If you leaked the password in the git repository, change it as @jvehent just commented.
Re: GitHub commit search: “remove password”
#157Earlier quoted context omitted.
How would git know that it's a password/key/whatever?
Key is easy. The high entropy should tip you off. 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”
#158Too many comments here recommend to clean up the commit and just hide the mistake under the rug. This is wrong. If you leak a password to any public location, there is only one reasonable course of action: CHANGE IT! Don't even bother rewriting the commit. Focus on changing that password right away, and while you're at it, figure out a better way to manage your secrets outside of your source code in the future. Mista…
But what if your codebase is used in thousands of places that you don't control? You can't always change it. The real lesson is - don't put passwords in your code.
Re: GitHub commit search: “remove password”
#159Too many comments here recommend to clean up the commit and just hide the mistake under the rug. This is wrong. If you leak a password to any public location, there is only one reasonable course of action: CHANGE IT! Don't even bother rewriting the commit. Focus on changing that password right away, and while you're at it, figure out a better way to manage your secrets outside of your source code in the future. Mista…
The first thing you should be doing is making the password useless by changing it. Doing anything else is entirely irresponsible. Sure, remove the file in question after that... but you can't treat the old password as anything other than public knowledge at that point.