Live data from Hacker News

GitHub commit search: “remove password”

github.com

121–130 of 266 posts

Re: GitHub commit search: “remove password”

#121

Earlier 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.

Split it to parts and concatenate it, then? $key = "BAAD" + "F00D" + "CAFE" + "BABE";

> But i'm more than fine with needing to "obfuscate" an API key or manage secrets correctly

Re: GitHub commit search: “remove password”

#122
post #99

There are so many of these. It gets a little scary when it veers from professional security to individual personal privacy https://github.com/search?p=2&q=smtp.gmail.com+pass&ref=sear...

I should be amazed at how prevalent this is but after almost two decades in IT/IS, it's no more than the equivalent to the Post-IT on a monitor, but more accessible. Dumb, but business as usual.

There's a sticker on top of our build machine---in a locked lab--with the password. I don't think this is that bad.

Re: GitHub commit search: “remove password”

#125

If you found a similar mistake in your repository, you can delete commit from history using: `git rebase --onto ^ `. Or if you want actually rewrite it, see git rebase -i` documentation.

Just a tiny tweak - a handy shortcut to

^

is

^!

I use it all the time with:

git diff ^!

Re: GitHub commit search: “remove password”

#127
post #90

For anyone wondering, if you want to remove a file or secret you've already committed, you can use BFG Repo-Cleaner to go through your commit history and completely remove any trace of it. https://rtyley.github.io/bfg-repo-cleaner/

+1. Requires Java but BFG Repo Cleaner is the only app I've ever felt worth installing the JVM for.

That's a pretty useless comment, don't you think?

Re: GitHub commit search: “remove password”

#129
post #34

Earlier quoted context omitted.

It is customer fault. However it should be pretty easy for them to set up a script to search github for this kind of stuff and automatically invalidate keys

And this would be a cool feature from github too. A link mentioning "we found something in your code that looks like a secret, please know people will use it."

GitLab has this: https://docs.gitlab.com/ee/push_rules/push_rules.html#preven... (enterprise edition, admittedly)

Re: GitHub commit search: “remove password”

#130
This made me realize an unexpected (to me) search behavior on Github. Basic/Default search will search commit history, but if I try to add advanced options I don't appear to get search history.

https://github.com/search?utf8=%E2%9C%93&q=remove+password+u...

Here I was trying to search for "remove password" just on repos for nicksagona (just happened to be one of the first users to display when you go to this thread's search).

That comes up with zero results. This leaves me wondering how I would run similar searches on repos that I'm involved with as a way of auditing to make sure none of them have compromised passwords that would need changed.

I would love to hear suggestions on how to do this.

Post reply on HN