Live data from Hacker News

Announcing Keyless SSL

blog.cloudflare.com

161–170 of 190 posts

Re: Announcing Keyless SSL

#161

Earlier quoted context omitted.

It is very obvious... In hindsight?

Not sure why all the negative reactions here... Was anyone else doing or providing this type of "Keyless SSL" setup? You'd think if this was a known technique, the mentioned banks would already have been asking for it, implementing it, or doing it. Personally, I think CloudFlare is one of the few companies on here doing innovating stuff, and solving real issues. And if not - if they've pulled the wool over my eyes -…

PKCS11 and Hardware Security Modules (HSM) have been around for a long time. There's in wide use in companies like NetFlix and Square including "over the network". This is not new.

Re: Announcing Keyless SSL

#162
post #116

So CloudFlare won't get your private key, but will still get to see unencrypted plaintext for all traffic? Sounds like a huge improvement...

Indeed. Imagine an internet user who uses online banking with one of these banks; registered his domains with Namecheap; keeps some bitcoins at Coinbase; pseudonymously frequents Reddit; and posts anonymously at 4chan every now and then. By merely passively eavesdropping on all traffic from and to your IP address, Cloudflare can build a profile that links your real world identity to all your Reddit posts you thought…

4chan's posting API is actually not (as of this very second) behind Cloudflare.

Re: Announcing Keyless SSL

#163
post #103

For those who want to understand how it works (it took me a minute, so I'll try to explain it simpler): In simplified terms, the server usually stores a public and private key, and sends the public key to the client. The client generates a random password, encrypts it with the server's public key, and sends it to the server. Only anyone with the private key can decrypt the message, and that should only be the server.…

Thanks for explaining this. I would also love to read your opinion. Would you be willing to share it in a separate comment? (And hopefully it doesn't incur any downvotes and readers understand it is just an opinion.)

Sure. TL;DR: I think it's mostly useless. From an engineering perspective this is a creative way to circumvent management's requirements ("our encryption keys must be kept on premises"), but otherwise I don't see the value.

Let's first see what the problem is with the old method, storing the private key on the Cloudflare server:

1. Cloudflare can read all traffic.

2. Cloudflare can read traffic they can intercept, even if it's not directed towards their server. Think public WiFi access points.

3. Anyone able to break into Cloudflare, physically or technically (or legally, hello NSA!), has the same capabilities.

Number two is a bit far-fetched without taking number 3 into account, except that there might be national security letters to obtain the private key, after which government agencies can use their own intercepts. Still slightly far-fetched, but a plausible concern if you're the bank that the next Edward Snowden just happened to use (Lavabit's private key needed to be handed over, disregarding all other customers' privacy).

Now we implement this new system, where you can only obtain the decryption for the encrypted session key (as sent by the client, e.g. a browser).

1. Cloudflare can still read all traffic.

2. They can no longer passively read any traffic, or hand over private keys to law enforcement. However, the encrypted session keys could still be queried at the keyserver. The keyserver would need to actively maintain a blacklist of session keys that are not in use at Cloudflare, e.g. by having webservers send them as they were used, and raise alarm flags if a false one comes up. But I'd need to work out this attack scenario further to be sure there is no loophole that could make it look like Cloudflare traffic even if it's direct (but intercepted by whomever) traffic. I think something like that might be possible, but I'd need to work it out to be sure.

3. Anyone hacking Cloudflare is now limited in the same way Cloudflare is (so the same as point number two).

So far the security concerns. Now as for speed and DDoS mitigation...

- Cloudflare now needs to query an external server (if it's in their datacenter, it can be pretty much considered under their control) for every https connection. Assuming there is a direct peering connection to a datacenter next-door, this would only be a couple of milliseconds in network latency, but so is DNS and building a TCP connection and fetching a page... it all adds up and in the end you notice that pages need to load, even if only for a sec.

- The SSL termination point is now nearer to the client, as Cloudflare has datacenters all around the world. You could in theory build the keyservers next to many of them, but then you're rolling a CDN for a CDN (a delivery network of content (keys) for a content delivery network (cloudflare)). Perhaps not a bad idea, but it just sounds a bit silly. All things considered, at best the connection gets only a tiny bit slower.

- Cloudflare is still useful for mitigating attacks, just like with normal http traffic. I mean, they can read the data, so it's more or less the same as with unencrypted http. The difference is the keyserver: they might run over capacity. Luckily you can now solve that problem by throwing money at it (you can deploy more keyservers, Cloudflare already has enough front-end servers to handle the requests). So it's now a money issue, not a technical one, which is how you want things to be.

- Session reuse makes this somewhat less of a pain, as the keyserver need not be queried for repeated https connections. We'd need to see numbers to know how much of a win this is, though. In any case, it's never faster than not having the keyserver.

So in this area it's still a win, but so was handing over your keys. Having keyservers makes it slightly less of a win.

---

In conclusion, you have three options:

- Don't use Cloudflare. Fastest website, but risk of DDoS.

- Old-style Cloudflare https setup: handing over your keys. DDoS risk mitigated.

- New technique: providing keyservers. Slightly slower than the old style, but with a tiny security advantage that might help with either management or rare kinds of high-profile attacks.

Disclaimer: I'm not a Cloudflare tech, I'm a software engineering and information security student (and a major nerd in general, I might add). I might be missing something, but many other comments seem to be saying similar things.

Re: Announcing Keyless SSL

#164
post #18

And my patch for OpenSSL that does the same thing: https://gist.github.com/indutny/1bda1561254f2d133b18 , ping me on email if you want to find out how to use it in your setup.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Here is an example of how it could be used (in my TLS terminator):

https://github.com/indutny/bud/compare/master...feature/asyn...

Basically, if you have ever used async SSL API, you should be aware of things like:

    SSL_ERROR_WANT_READ
    SSL_ERROR_WANT_WRITE
In addition to these two, my patch adds:

    SSL_ERROR_WANT_SIGN
    SSL_ERROR_WANT_RSA_DECRYPT
If one of these is returned - you may get the data that should be signed/decrypted with:

    SSL_get_key_ex_data()
    SSL_get_key_ex_len()
Get the key type (in case of SIGN):

    SSL_get_key_ex_type()
    // Returns EVP_PKEY_RSA, EVP_PKEY_ECC
And get signature digest nid with:

    SSL_get_key_ex_md()
Please be aware of the fact that `md` could be `NID_md5_sha1`, take a look at bud's code to figure out what should be done in this case (basically, you'll need to use raw `RSA_decrypt_private()`).

After performing sign/decrypt (which could happen in other thread, or on a different server) you should call:

    SSL_supply_key_ex()
to supply the result and continue handshake process. At this point `SSL_read()`/`SSL_write()` will start returning proper values.

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1

iQIcBAEBAgAGBQJUG2D2AAoJENcGPM4Zt+iQJdoQAKZxbcGpzHFktSbU3uDocy3R fywWmqkYnoJ5jWF3xn4Excv4dAGhMfb/7tm9nt9zyV8g0Qsu8ChqWTl+kgK+hj9o mV+3jhqPDWR2VhmAC3J5ZsCpNm3IW/iNgGiU+u/k9N2i0WHjYSoTHM/NooN5GIu2 KKhNXPw1Y05yxOZWmbUInMl/uscGWDtzylRNyJpfLFFu3JDQy1sBTKD6UAZC5ERY 7LUZ1TqVdk1DPY3Tf/j4IaB9Ds9teGLGj63J8upJhDjWHibFzV5bx6X+FjknUB9M xaebV4yfHZNRHseBu2ZqTQ2f2MNnXVisdzJRX6oyYeyq872MsJjAFhbFhFTi0sTI T8Y9n8cjuctbn+zTISVyVqEEBl8udWTY1t14SJ9lNcdU3xAf9OzEBVdORpUDqFl+ zteRC145o7gs7mEtJjyBpy8mhXB3mc13ZkC2qaJIyqkqAPODu/xlqCga7oaogHNy Q2wy0HUeX69Ra0ada3TcJQgB14qESj3Uvq1hcgFk7SEXBxkU5NJ2OcItvU1+emd7 hRlQvDqiiQcK9WgsdOIKZpovtT3FswhsIy0Tv77Nx9PY04urOTEgmhPJHveCJOQq i0apvI09YgimXs4Sd5h3rs9TsKrDtG0BG0jM1zfo5zbcKE2IbMpmzOc84MxkwUSl tPV48uw46UVpu4zOOByM =zJGs -----END PGP SIGNATURE-----

Re: Announcing Keyless SSL

#165

Earlier quoted context omitted.

Maybe that's the part I was missing. There was no link to more information in his (her?) HN profile.

> There was no link to more information in his (her?) HN profile. 'His' apparently. I didn't know either, but apparently he was the first to crack Cloudfare's Heartbleed challenge: http://blog.cloudflare.com/the-results-of-the-cloudflare-cha... His LinkedIn / twitter for reference: https://www.linkedin.com/in/indutny https://twitter.com/indutny

Let's be honest about it, this patch hasn't got any attention from OpenSSL team yet, but I heard that some people from the team are interested in it. Never got a response, but it looks correct to me.

Re: Announcing Keyless SSL

#166
post #34

Earlier quoted context omitted.

Do you guys have a "global" session ticket cache shared amongst endpoints? Or do you ensure the same user gets routed back to the same termination node? I'm quite curious about this.

Session Tickets are shared globally. Session IDs are shared intra-data center (so regionally). The former works with Chrome/Firefox. The latter with all other browsers.

That's really cool, thanks for responding. I imagined that possibility but never heard of anyone actually doing it(not to say they don't). Maybe I'll need to experiment around with Golang's TLS package :)

Re: Announcing Keyless SSL

#167
post #137
post #134

Earlier quoted context omitted.

And here's a similar patent from Akamai (via @cloudpundit) http://www.google.com/patents/US20130156189

Looks like the Akamai patent for basically the exact same process, filed 2012-12-14, priority date 2011-12-16 is still being examined... yet the CloudFlare patent filed 2013-03-07 was granted 2014-07-14. That's a really fast turnaround for CloudFlare, and not sure how the Akamai filing isn't prior art. Actually, the Akamai filing is referenced in the CloudFlare patent.

From what I can tell, the main difference is that the claims in CloudFlare's patent describe more of the SSL handshaking process and the subsequent handling of requests (all of which is exactly the same as in standard HTTPS proxying). They both claim exactly the same technique for a web proxy to handle SSL connections without having the private key, but I guess the USPTO decided the fact that CloudFlare described more of that process in their patent claims constituted a improvement on Akamai's invention for some weird reason.

Re: Announcing Keyless SSL

#168

So CloudFlare won't get your private key, but will still get to see unencrypted plaintext for all traffic? Sounds like a huge improvement...

previously they had your private key, so they could see unencrypted plaintext anyway.

Re: Announcing Keyless SSL

#169
post #163

Earlier quoted context omitted.

Thanks for explaining this. I would also love to read your opinion. Would you be willing to share it in a separate comment? (And hopefully it doesn't incur any downvotes and readers understand it is just an opinion.)

Sure. TL;DR: I think it's mostly useless. From an engineering perspective this is a creative way to circumvent management's requirements ("our encryption keys must be kept on premises"), but otherwise I don't see the value. Let's first see what the problem is with the old method, storing the private key on the Cloudflare server: 1. Cloudflare can read all traffic. 2. Cloudflare can read traffic they can intercept, ev…

One more thought occurred to me (I didn't see it mentioned around here?) that you keep some control of the relation with Cloudflare, you can pull the plug instantly at any moment you wish if need be, and because of that, they in theory must be more "on their toes" all the time, can't become spoiled too easily. Or at least should they become, you have some concrete leverage. Also if some competition for CF arrives, you now have the freedom to switch.

Re: Announcing Keyless SSL

#170
post #103

For those who want to understand how it works (it took me a minute, so I'll try to explain it simpler): In simplified terms, the server usually stores a public and private key, and sends the public key to the client. The client generates a random password, encrypts it with the server's public key, and sends it to the server. Only anyone with the private key can decrypt the message, and that should only be the server.…

Is this not subject to side channel attacks (for recovering the key)? Also, whats the point if you are letting a third party read all of your traffic at any rate?
Post reply on HN