Live data from Hacker News

Tell HN: Github has dozens of public s3 passwords

news.ycombinator.com

1–10 of 31 posts

Tell HN: Github has dozens of public s3 passwords

#1
I almost pushed my s3 credentials to a public github repo for the third time in one day.

So, I got curious. Are there people out there who forget cover their tracks?

A quick search shows quite a few 'open' buckets out there. What's the best way to warn these folks? What other credentials are lurking out there?

Here's the search: http://github.com/search?langOverride=&language=&q=S3+Base.establish_connection&repo=&start_value=1&type=Code&x=0&y=0

And the first open bucket I found: http://github.com/prakashraman/jammmin/blob/a668672c69fafdb8317fec4fb19b7abb0b318e1a/app/scripts/s3_connect.rb

Re: Tell HN: Github has dozens of public s3 passwords

#3
It's something that almost happened to me too. A git repository for a project that at first, in the prototype-stage, had credentials hard-coded, but inevitably moved on to be config-file-driven.

I concocted the following command to change all mentions of a specific word to another word, in a git repository:

  git filter-branch --tree-filter "find . -type f -exec sed -i -e 's/originalpassword/newpassword/g' {} \;"
Use this to check if there are any mentions of some word, e.g. your password, in the repository:

  git filter-branch --tree-filter "grep -r originalpassword * || true"

Re: Tell HN: Github has dozens of public s3 passwords

#9
post #8

Yeah, this is a typical mistake, I've pushed Django's secret keys and even twitter credentials. PS: I do it all the time on my private repos but I try to not do it on the public ones.

In case of django there is a nice workaround in using a non-git localsettings.py file.

Just put "from localsettings import *" in your settings-file, and keep all deployment-specific settings in the localsettings-file

Post reply on HN