News for hackers. Stuff that matters.
Re:A Case of Stolen Source Code by briandoll on Wednesday May 17, 2017 @02:42PM (#14361515)
One way to protect against this is to not have SSH keys on your laptop. I've been using Kryptonite https://krypt.co/ lately, which is sort of like two-factor for SSH keys.
Re:A Case of Stolen Source Code by dkuntz2 on Wednesday May 17, 2017 @03:40PM (#14362106)
That doesn't seem especially more secure. You're just trading away trusting yourself to another company.

You can get a similar ssh 2fa setup with Google Authenticator's PAM module (https://github.com/google/google-authenticator-libpam), and maintain full control over your infrastructure.

Re:A Case of Stolen Source Code by pfg on Wednesday May 17, 2017 @04:18PM (#14362415)
Kryptonite is more like a GPG smartcard (or YubiKey) of sorts (with some security trade-offs for the arguably better UX). The key never leaves your mobile device. Backdoors and bugs are still a possibility of course (when aren't they?), and you probably wouldn't wan to run this on an outdated mobile device.

Of course, all you're doing with any of this is preventing your key from leaking. A sufficiently motivated attacker could just backdoor your ssh/git binary and access things through that instead, but it's still a good defense-in-depth mechanism, IMO.

Re:A Case of Stolen Source Code by danjoc on Wednesday May 17, 2017 @08:21PM (#14363974)
>Kryptonite is more like a GPG smartcard (or YubiKey)

Can it do full disk encryption? Works with GPG agent? PIV? PKCS11? OTP? U2F?

>arguably better UX

Requires battery. Not waterproof. Not crushproof.

>The key never leaves your mobile device.

Can't backup the key? I need to buy two iPhones to have a backup in case one is lost?

Re:A Case of Stolen Source Code by pfg on Thursday May 18, 2017 @08:02AM (#14366503)
> Can it do full disk encryption? Works with GPG agent? PIV? PKCS11? OTP? U2F?

My understanding is that the only use-case is SSH right now, but that could change, I guess.

> Requires battery. Not waterproof. Not crushproof.

Those are all valid. OTOH, it doesn't require yet another device that can be forgotten or lost, it's far easier to set up (compared to YubiKeys or other smartcards), and it's free.

> Can't backup the key? I need to buy two iPhones to have a backup in case one is lost?

That's correct. They plan to add paper backups and syncing via QR, IIRC. A second (regular) key that's kept offline would do as well.

(FWIW, I use YubiKeys for GPG/SSH/OTP/U2F as well, but I'd definitely recommend this to anyone looking for a cheaper or more usable alternative.)

Re:A Case of Stolen Source Code by danjoc on Thursday May 18, 2017 @02:28PM (#14369756)
>it doesn't require yet another device that can be forgotten or lost

iPhones can be lost too.

>it's far easier to set up

Yubikey can do U2F and OTP out of the package with no setup required.

While it can be easier (I wrote a nice shell script for myself), I don't consider setting up a Yubikey for SSH hard for the type of person who uses SSH,

https://developers.yubico.com/PIV/Guides/

It's literally copy/pasting a few lines out of Yubico's docs into a shell.

>it's free

So is the Yubikey software.

>They plan to add paper backups and syncing via QR, IIRC.

I would consider that a fatal flaw. Once the private key is on the device, it should not be easy to recover it from the device.

Re:A Case of Stolen Source Code by pfg on Thursday May 18, 2017 @03:23PM (#14370259)
> iPhones can be lost too.

emphasis on yet another. One more thing to keep track of. Not everyone likes to have their (door) keys hanging off their notebooks all day.

> Yubikey can do U2F and OTP out of the package with no setup required.

Yes, but we're talking about git/ssh here.

> While it can be easier (I wrote a nice shell script for myself), I don't consider setting up a Yubikey for SSH hard for the type of person who uses SSH,

That's not my experience, but it suppose it might depend on who you know/work with, or in what area you work.

> So is the Yubikey software.

I was talking about the free beer kind of free, but it's not accurate to say YubiKey is all free (libre) either, it depends on the product. There was quite a controversy a while back[1]. Personally, I'm fine with closed-source security products. Ideological reasons aside, I don't think making decisions based on whether the code is open source makes sense.

> I would consider that a fatal flaw. Once the private key is on the device, it should not be easy to recover it from the device.

I wouldn't say it's a fatal flaw. You rely on your phone's security to manage access to signing operations anyway, so if an attacker has access to the app, you're pretty much screwed either way. Again, there are trade-offs, but it's a step-up from keeping keys on-device.

[1]: https://www.yubico.com/2016/05/secure-hardware-vs-open-sourc...

Re:A Case of Stolen Source Code by danjoc on Monday May 22, 2017 @01:48AM (#14391268)
>Not everyone likes to have their (door) keys hanging off their notebooks all day.

As if a whole phone is better... That's not a requirement with a yubikey anyway. Mine hangs on a lanyard on a dust plug. Many people have yubikey nanos and basically leave them plugged in their laptop all the time.

>I was talking about the free beer kind of free, but it's not accurate to say YubiKey is all free (libre)

Kryptonite is not libre. It's not even free. It's all rights reserved.

https://github.com/kryptco/kryptonite-ios/blob/master/LICENS...

Yubico piv tool is 2 clause BSD, which is GPL compatible.

>Personally, I'm fine with closed-source security products.

So is RMS, assuming device software is fixed. See his comments on microwave ovens. Yubikey fits this description. Firmware is not updatable, for better security. Anyone who is trying to make a controversy out of what yubico is doing is either more extreme than RMS, dumb, or a competitor.

Re:A Case of Stolen Source Code by mynameisvlad on Wednesday May 17, 2017 @10:41PM (#14364476)
The parent comment literally said arguably, as in, can be argued and is based on personal choice.

And, although I'm not the commenter, it doesn't read anywhere near it trying to imply Kryptonite is a replacement for Yubikey. They were replying to someone comparing it to the 2FA PAM module, and explaining it's more like a smartcard or Yubikey in that it stores the key, rather than add a second verification outside the key.

Re:A Case of Stolen Source Code by danjoc on Wednesday May 17, 2017 @11:07PM (#14364565)
I asked the questions because I'd like to know the answer. I'm not arguing passive aggressively.

I looked at the source repo, and at a glance, it looks like the app stores the key pair on the iOS keychain. My guess is that means the key can be removed from the device if the user chooses to do so, or if the user give access to the keychain to another application. Perhaps I'm wrong about that. I keep hearing "The key never leaves the device" repeated, and I'd mainly like to know how that guarantee is made.

Re:A Case of Stolen Source Code by pfg on Thursday May 18, 2017 @08:04AM (#14366518)
The app uses kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly[1]. Quoting the relevant iOS documentation[2]:

> After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.

[1]: https://github.com/kryptco/kryptonite-ios/blob/42c71d6381def...

[2]: https://developer.apple.com/reference/security/ksecattracces...

Re:A Case of Stolen Source Code by gruez on Wednesday May 17, 2017 @03:26PM (#14361948)
That doesn't fix the problem either. The attacker could instead wait until a legitimate request piggy back off that and you'll be none the wiser.
Re:A Case of Stolen Source Code by jhugg on Wednesday May 17, 2017 @03:04PM (#14361728)
You can encrypt SSH keys with passwords too.
Re:A Case of Stolen Source Code by hdhzy on Wednesday May 17, 2017 @03:21PM (#14361884)
Yes, but passwords can be keylogged and SSH keys on a hardware token (like yubikey) can't. Also if you've got touch-to-use enabled on the token you can't even use the key without physically touching the token.
Re:A Case of Stolen Source Code by agrinman on Wednesday May 17, 2017 @04:18PM (#14362414)
Any user-level process can actually obtain your decrypted private-key: https://blog.krypt.co/why-store-an-ssh-key-with-kryptonite-9...
Re:A Case of Stolen Source Code by clarry on Thursday May 18, 2017 @06:18AM (#14366056)
AddKeysToAgent defaults to no. Ptrace might also be disabled, depending on system. I would be more concerned about keyloggers, or any tricks that result in me running something else than the real ssh client (e.g. custom program somewhere in PATH).
Re:A Case of Stolen Source Code by mintplant on Wednesday May 17, 2017 @03:14PM (#14361829)
This relies on the security of my phone OS, which I trust much less than my desktop's.
Re:A Case of Stolen Source Code by hdhzy on Wednesday May 17, 2017 @03:23PM (#14361902)
I wonder why is that? Apps on the phone are by default sandboxed and there is no way to get root (instead of running the exploit).
Re:A Case of Stolen Source Code by mintplant on Wednesday May 17, 2017 @06:48PM (#14363475)
Lack of updates from OEMs, and a general lack of attention to security on the part of the same, at least on Android. Many devices still haven't received the patch for last month's Broadcom vulnerability, for example.
Re:A Case of Stolen Source Code by libeclipse on Wednesday May 17, 2017 @03:25PM (#14361929)
I have a Nexus 6P, and I'd trust the security on it a million times more than on my Arch-Linux desktop.
Re:A Case of Stolen Source Code by danielrhodes on Thursday May 18, 2017 @01:56AM (#14365103)
If you store things in the secure enclave of the device on iOS, it is likely much more secure.