Slashdot Mirror


Github Kills Search After Hundreds of Private Keys Exposed

mask.of.sanity writes "Github has killed its search function to safeguard users who were caught out storing keys and passwords in public repositories. 'Users found that quite a large number of users who had added private keys to their repositories and then pushed the files up to GitHub. Searching on id_rsa, a file which contains the private key for SSH logins, returned over 600 results. Projects had live configuration files from cloud services such as Amazon Web Services and Azure with the encryption keys still included. Configuration and private key files are intended to be kept secret, since if it falls into wrong hands, that person can impersonate the user (or at least, the user's machine) and easily connect to that remote machine.' Search links popped up throughout Twitter pointing to stored keys, including what was reportedly account credentials for the Google Chrome source code repository. The keys can still be found using search engines, so check your repos."

37 of 176 comments (clear)

  1. At least... by Anonymous Coward · · Score: 5, Funny

    they've been seen by 'many eye balls'.

    That's good right?

    1. Re:At least... by ArsenneLupin · · Score: 4, Funny

      But on the other hand, you certainly wouldn't object to any gals exposing their pubic "locks"...

  2. This is why developers are not sysadmins by h4rr4r · · Score: 3, Insightful

    This is why developers are not sysadmins.

    These kinds of repositories need to learn that and not let these folks do this sort of thing. If would be simple to use a regex to filter out the posting of these sorts of files. Maybe Devs should even be charged a couple dollars to get a decent review of these things.

    1. Re:This is why developers are not sysadmins by Anonymous Coward · · Score: 5, Insightful

      No. This is actually completely absurd. A developer that cannot grasp the concept that private keys have to be kept private, cannot be trusted to do anything but screw up the most basic security provisions when writing code.

      They should get a kick in the ass, such as three months without any sort of commit privileges, and mandatory code review for an year. THAT should be enough to make it stick, and impress on them the real gravity of their failure. Otherwise, they will just chalk it up as "an annoyance done by those uninteresting people who should learn to code before they go pestering code-gods".

    2. Re:This is why developers are not sysadmins by h4rr4r · · Score: 4, Interesting

      Sysadmins should also know how to code. Nothing better than showing them their screwup and the solution to it.

      Plus, since all sysadmins, real ones anyway, are already competent in several scripting languages it is not that hard a skill to add if all you need to do is be better than bottom of the barrel programmers.

    3. Re:This is why developers are not sysadmins by h4rr4r · · Score: 2

      The best system I have seen is not allow devs any access to production environments. All pushes done by sysadmin and dev boxes identical to production.

    4. Re:This is why developers are not sysadmins by ArsenneLupin · · Score: 5, Insightful
      In some of these instances, all of ~/.ssh/ did actually end up in the project directory. Or maybe they used their entire home directory as the project root? Stoopid, stoopid people.

      (Yes, there is also a nice ~/.ssh/config file, so that you also know which locks those key fits...)

    5. Re:This is why developers are not sysadmins by Raumkraut · · Score: 3, Insightful

      I've seen several people comment that they have their home directory config files under version control. If you're using git for that, it's a fairly simple next step to then "backup" the repo to github.
      "It's only config files; nobody would be interested in those."

    6. Re:This is why developers are not sysadmins by segedunum · · Score: 2

      The first thing you learn is that your private SSH keys are sacrosanct. Most developers seems to just go through a howto on how to generate a SSH key and don't think about anything after that. They're probably all using node.js or something.........

    7. Re:This is why developers are not sysadmins by nschubach · · Score: 2

      Duh... it's so they don't have to remember their passwords to get their configuration and RSA keys back!

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    8. Re:This is why developers are not sysadmins by 19thNervousBreakdown · · Score: 2

      This is why key management should be part of the operating system, and every piece of software that doesn't use those APIs should be suspect.

      It's simply too big a subject to expect everyone who is in danger of falling prey to something similar (everyone who uses a computer) to manage on their own. If you know where every individual piece of software you run stores every single key, you are a very, very rare person. You're also probably mistaken.

      Even if we started down the path, it would take a long time, that's no question. But I can think of no other alternative that has even an ounce of realistic chance of success.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
    9. Re:This is why developers are not sysadmins by KingMotley · · Score: 3, Interesting

      I dunno about that here. Ever since they rolled out Sophos Full Disk Encryption on every desktop and server here, it's contributed more to downtime than any virus/malware ever has. I think literally every person in this office has had to have their machine completely rebuilt after it got corrupted somehow, and that includes our testing servers as well.

      All I can say is, thank god our production servers are out of our company's control. They haven't had any issues, but then again, they also don't have Sophos malware on them either.

    10. Re:This is why developers are not sysadmins by ArsenneLupin · · Score: 2

      They had some when I posted this. Looks like the "candidate" (or github admins?) have cleaned them up...

    11. Re:This is why developers are not sysadmins by 1s44c · · Score: 3, Insightful

      Developers are the best sysadmins you can have, since they're actually somewhat competent.
      It's just that they've got better things to do and are paid more.

      Developers are normally careless sysadmins. Sysadmins are usually inept programmers. Someone that really can do both well is a great asset.

      Good sysadmins get paid about the same as good developers. At least that's my experience.

  3. Search engines by ArsenneLupin · · Score: 5, Informative
    On google, the following search string still turns up a goldmine...:

    site:github.com inurl:id_dsa

    Idiots...

    1. Re:Search engines by robmv · · Score: 4, Funny

      Stop, Google will shutdown search because of that

    2. Re:Search engines by ArsenneLupin · · Score: 2

      Actually, in the glory old days of SQL injection, google did shut down search for certain patterns (such as inurl:cfm inurl:page_id or inurl:asp inurl:password). If you did too many searches for these, you got a captcha to prove that you were not a "bot"...

    3. Re:Search engines by tlhIngan · · Score: 4, Interesting

      Heck, Google disabled searching number ranges after some enterprising folks used them to harvest credit card numbers - doing searches for numbers between 4000000000000000 and 5999999999999999 which will get back lists of credit cards (Visa/MC) that Google indexed because someone put the list up.

  4. I just saw this, sort of by slashmydots · · Score: 5, Interesting

    I was cruising ebay yesterday and saw that one of the laptops had their windows license keys exposed in pictures in a readable format. I poked around some more and found that isn't terribly uncommon. Some people just don't think no matter what website it is.

  5. Re:Deserving by GameboyRMH · · Score: 5, Insightful

    Exactly, GitHub shouldn't disable a site feature to protect the stupid.

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel
  6. Re:Proof... by VortexCortex · · Score: 2

    I'm sorry, were you under the assumption that idiots can't write code?

  7. overreaction? by __aaltlg1547 · · Score: 3, Insightful

    Seems like the wrong response. Instead of killing search, why not just erase the keys files and lock out the accounts of the offending devs?

    1. Re:overreaction? by h4rr4r · · Score: 3, Insightful

      Because some of these might be test keys or place holders. If the key is not valid on any system and is just test data, it should not be a big deal to post publicly.

  8. Stupid people... by Lisias · · Score: 3, Insightful

    These stupid people should be had their accounts suspended.

    People should be accountable for their actions, and these idiots are potentially compromising third party data security!

    ICO didn't fined Sony for the information leak on that Anonymous attack? Why in hell GITHUB user's should be less accountable for things THEY ARE FSCKING COMMITING in their accounts?

    --
    Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
  9. github did not take search down because of this by Anonymous Coward · · Score: 2, Informative

    According to their twitter and status pages, the search is currently unoperational due to problems with their search cluster. They recently released changes to their search including, I believe, a move to ElasticSearch. The linked article says as much, too, so yet another fail in a slashdot summary.

  10. Nothing has changed... by 140Mandak262Jamuna · · Score: 5, Funny
    Back in the days when I was the root (of all evil according my fellow grad students) of our lab, one of the constant problems was people blindly doing chmod 777 .* on the $home. They have .emacs or .profile or .cshrc that was customized ages ago by some grad student, and they want to share it with a new student. Somehow they stumbled on to "chmod 777 .*" as a solution to all their file sharing problems. Now this "magic command" was also being blindly passed around without worrying about security implications. Oh, yeah, they think they are clever and tape the login credentials to the underside of the keyboard and laugh at secretaries who tape it to their monitors.

    Looks like these grad students have all growned up and uploading it all to the cloud.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    1. Re:Nothing has changed... by h4rr4r · · Score: 2

      When people did stuff like that in my sysadmin classes we were encouraged to teach them a lesson. Far better to edit their login script to log them right back out than delete their homedir contents, or change their path so they got other versions of common programs. Probably the meanest was to make it so instead of calling the work submission script it called rm on whatever they were trying to submit as their classwork.

    2. Re:Nothing has changed... by Frohboy · · Score: 2

      A subtler prank that I pulled on a friend who left himself logged in to one of the public undergrad labs (where there was the risk that an actual asshole would delete your stuff, send email as you, or something similarly cruel) was to add "echo 'sleep 1' >> .cshrc" to the end of his .cshrc before logging him out. I chuckled to myself, and then forgot about it.

      A week later, when it was 5 minutes before a submission deadline and he was yelling at the terminal to finish logging in (since it was taking 2-3 minutes for the prompt to appear by that point), I realized that I had probably gone too far.

    3. Re:Nothing has changed... by WankersRevenge · · Score: 4, Funny

      Yeah ... I was "that guy". The first time I installed Linux in 2000, I was annoyed that I needed "permission" to write to a directory outside of my home directory. I was coming from a Windows world, after all.

      I solved this "problem" by chmod 777 the entire filesystem. Hah. Problem solved. Needless to say, I couldn't start the machine back up again. I'm guessing it killed itself from the shear embarrassment. After that, I decided it may be in my best interest to read the manual.

      I'll do that one of these days :)

    4. Re:Nothing has changed... by xaxa · · Score: 3, Interesting

      Someone in my class installed a game in the officially-public network share. He was writing an AI for it, for a project. Other students found it, and played it.

      It had taken a lot of hacking to get the game to run on Linux, and he was annoyed other students had played it without putting in that effort. So, he altered the 'start.sh' script to generate an ssh key, add the public part to the user's authorized_hosts file, and move the private key somewhere obscure.

      He then got bored with the AI project.

      Some time later, while helping in a tutorial, I was showing a student how to set up an SSH key. The authorized_keys file already contained about 20 entries. The AI guy was sitting at the next computer, and told me what he'd done (I knew him quite well, but he hadn't told me what he'd done until now). He found over 200 private keys in the obscure place. He deleted them, chown -R go-rwx'd the game, and we thought that was the end of it...

      About a year later, Debian had that OpenSSL bug. The sysadmins ran a script across everyone's authorized_keys file, and removed any entries from keys generated by Debian OpenSSL. The email ended (I still have it):

      By the way: some of you have FAR TOO MANY authorized_keys ENTRIES
        and we seriously recommend that you radically shrink these down.
        As I said, we recommend kerberos tickets or ssh-agent instead!

      ...so I don't think they knew how they got there.

    5. Re:Nothing has changed... by Mathematiker · · Score: 2

      chmod'ing 777 kills the setuserid-bit.

      This means that programs like "su" or "ping" or "passwd" break.

      Also, some important daemons probably check whether their required files are world-writable and refuse continuing...

    6. Re:Nothing has changed... by Darinbob · · Score: 2

      I hate that attitude though. I told a friend once that I didn't use authentication with X windows because no one is ever going to bother to interfere and I didn't care if anyone was snooping. So he went out and decided to pop up random pictures on my screen and post messages until I relented. So I wasted a lot of time learning all about authentication and configuring it correctly, not to keep out adversaries but to keep out friends...

  11. Not so many by Shimbo · · Score: 3, Insightful

    Hundreds of keys from a million accounts; less than one in a thousand developers screwed up. Call a doctor at once! Then ask him about outliers in large populations.

  12. A big mess to clean up by NightHwk1 · · Score: 4, Informative

    git rm id_rsa*; git commit -a -m "problem solved\!"

    Not quite. They're already out there. The keys are still in the revision history. People have forked and cloned it.

    Hopefully the developers who created these keys know that besides removing them from the repo, the keys can no longer be used. They must be removed from every .ssh/authorized_keys file, every service like Github that uses them for deploying code, etc.

  13. Proof Github took search down? by gajop · · Score: 2

    This doesn't suggest github took anything down on purpose: https://status.github.com/messages.
    Seems to me they were just experiencing some technical difficulties from all the people sharing those search links and having a laugh at the stupids...
    I skimmed over the github site and didn't find anything that would suggest otherwise at least.
    Of course I didn't read the articles because they seem badly misinformed and confuse private keys with passwords.

  14. Re:Deserving by ilsaloving · · Score: 2

    I have to say I agree. We need to stop coddling people who do mindblowingly stupid things.

    Let them post their private keys. Let them learn the hard way what happens.

    Same with people who steady a scalding cup of coffee by putting it between their legs, while driving no less.

    I don't even WANT to know what prompted the warning label on a toilet brush that stated, "Not to be used for personal hygiene".

    Bring back lawn darts, kinder eggs and buckyballs, remove the warning labels from everything, and add a law that prevents people from being allowed to sue after doing something dumb (where 'dumb' is decided on by a jury of peers) and let the problem sort itself out.