Live data from Hacker News

Why Deleting Sensitive Information from GitHub Doesn't Save You

jordan-wright.github.io

11–20 of 91 posts

Re: Why Deleting Sensitive Information from GitHub Doesn't Save You

#11
If you ever put anything out on the Internet, not just to GitHub, consider it to be public information. Forever. You might be able to convince archive.org to remove it, but there are hundreds of players out there who aren't as ethical.

Ben Franklin figured this out many years ago:

   Three can keep a secret,
   if two of them are dead.

Re: Why Deleting Sensitive Information from GitHub Doesn't Save You

#14
> In this post, I’m going to show exactly how hackers instantly harvest information committed to public Github repositories...

A few days ago I published my blog to GitHub, with my MailGun API key in the config file (stupid mistake, I know). In less than 12 hours, spammers had harvested the key AND sent a few thousand emails with my account, using my entire monthly limit.

Thankfully I was using the free MailGun account, which is limited to only 10,000 emails/month, so there was no material damage. Their tech support was awesome in immediately blocking the account and notifying me, and then quickly helping to unblock the account after keys and passwords were changed, and repo made private.

I was exactly wondering how they were able to harvest GitHub content so quickly; it couldn't be web scrapping or a random search. This article explains well how to drink from GitHub's events firehose and the GHTorrent project, so everything makes sense now. Thanks for posting it.

EDIT: This other post[1] describes a similar situation. There are some folks monitoring ALL GitHub commits and getting psswords as they are commited, on the fly.

[1] http://www.devfactor.net/2014/12/30/2375-amazon-mistake/

Re: Why Deleting Sensitive Information from GitHub Doesn't Save You

#17
post #15

Always use environment variables. They are probably the best way to safeguard your API keys.

I've always wondered the proper way to deal with this, and this makes total sense. How would you typically set such an environment variable? In bash init?

Re: Why Deleting Sensitive Information from GitHub Doesn't Save You

#18
post #15

Always use environment variables. They are probably the best way to safeguard your API keys.

I've always wondered the proper way to deal with this, and this makes total sense. How would you typically set such an environment variable? In bash init?

It depends on language. In node, you can set environment variables in the code with process.env and Python with os.environ and then use those to specify the values on the command line. In fact, even services like Heroku will let you edit these from their web-based client.
Post reply on HN