News for hackers. Stuff that matters.
Re:Forthcoming OpenSSL releases by oleganza on Monday July 06, 2015 @12:16PM (#9840181)
Every time some OpenSSL bug is announced, I remember my issues with TLS (I don't know if this bug is TLS-related or not).

Would be nice if TLS supported:

1) "hot" certificates with 24h ttl signed-off by a longer-living certificate on a more secure machine. Having 1-year certificate private key deployed on a web server is crazy. Especially since revocation does not really work.

2) Threshold multi-signature certificates for both CAs and end-user certificates.

3) CA certificates locked to specific TLDs (was there RFC about something like that already?) - so Russian CA cannot sign certificate for a Canadian TLD.

4) Ultimately, blockchain name pinning on DNS level.

The last three do not really relate to a case when bug in OpenSSL reveals a private key stored on web server.

Re:Forthcoming OpenSSL releases by chair6 on Monday July 06, 2015 @01:03PM (#9840531)
Regarding #1, check out Anchor - https://wiki.openstack.org/wiki/Security/Projects/Anchor - an ephemeral PKI system coming out of the OpenStack community.

In brief, it attempts to address weaknesses in PKI operations and specifically revocation capabilities by allowing issuance of short-lived certificates based on a set of validation rules. The README has some detail about the tool, http://git.openstack.org/cgit/stackforge/anchor/tree/README.....

A recent presentation is at https://www.youtube.com/watch?v=Q_ZhrQq-_YM.

Re:Forthcoming OpenSSL releases by viraptor on Monday July 06, 2015 @05:05PM (#9842180)
Just in case the stackforge link disappears, the project is being moved right now into OpenStack proper. There's no dependency though, so you can easily use it on its own.

We'll release version 1 soon, so the API will change just a little bit, but the main idea remains: issuing short lived certificates from a single location (or multiple, it works without changes in multi master mode).

If you have any configuration issues, get in touch, we're happy to hear about new use cases for this tool.

Re:Forthcoming OpenSSL releases by mugsie on Tuesday July 07, 2015 @02:28PM (#9847234)
There is still the issue of the CA that is in place for anchor - your users have to trust it.
Re:Forthcoming OpenSSL releases by viraptor on Tuesday July 07, 2015 @08:19PM (#9849016)
Yes, the main reason it was created is OpenStack deployments where Anchor is used for securing internal communications, so the PKI is an internal one (most likely).

We cannot change how the CAs work in public networks unfortunately, but if they do, we're going to be ready :)

Re:Forthcoming OpenSSL releases by nothrabannosir on Monday July 06, 2015 @12:50PM (#9840411)
The fact that 3) was not built-in from the start pains me to no end. It should be flying first-class with Priority Airlines, a penthouse in the Hilton bugtracker since 1996. Instead, it's #3 in someone's list somewhere in a forum in 2015.
Re:Forthcoming OpenSSL releases by antsar on Monday July 06, 2015 @12:54PM (#9840449)
AFAIK it was built-in from the start, as far as the X.509 protocol is concerned. Its just not used anywhere.

http://tools.ietf.org/html/rfc5280#section-4.2.1.10

Re:Forthcoming OpenSSL releases by nothrabannosir on Monday July 06, 2015 @04:34PM (#9842011)
Oh my God! What? How is this not a major, major thing? How are Mozilla and Google not pushing hard for government CAs to have these, like, stat? And for OpenSSL to actually check them?

I am bewildered. What happened? Is this just apathy?

http://blog.codekills.net/2012/04/08/adventures-in-x509-the-...

Unbelievable. This is SRV for HTTP all over again. The Betamax of the 21st century.

Re:Forthcoming OpenSSL releases by ab on Tuesday July 07, 2015 @09:18PM (#9849203)
Enforcement of nameConstraints is inconsistent at best.

I experimented with name constraints a couple years ago for a private CA project, with the idea that I could restrict the private CA to issuing only names within a chosen subdomain.

I remember being able to enforce nameConstraints on the subjectAltName, but I was never able to get it to enforce anything on the subject Common Name. In theory new certificates should always have a critical subjectAltName extension, but this makes it worthless in practice.

It's also possible that my X.509 foo is not strong enough, or that I was testing with an older version of OpenSSL that doesn't implement it.

http://blog.codekills.net/2012/04/08/adventures-in-x509-the-...

Re:Forthcoming OpenSSL releases by JoshTriplett on Monday July 06, 2015 @01:17PM (#9840623)
> 1) "hot" certificates with 24h ttl signed-off by a longer-living certificate on a more secure machine. Having 1-year certificate private key deployed on a web server is crazy. Especially since revocation does not really work.

This seems like the kind of thing that Let's Encrypt could be good at: if you have a fully automated renewal process, why have certificates last a long time?

Re:Forthcoming OpenSSL releases by amluto on Monday July 06, 2015 @01:22PM (#9840666)
It's the kind of thing that QUIC supports out of the box.
Re:Forthcoming OpenSSL releases by JoshTriplett on Monday July 06, 2015 @01:27PM (#9840709)
How so? What in QUIC makes it easier to have short-lived certificates?
Re:Forthcoming OpenSSL releases by nocarrier on Monday July 06, 2015 @01:08PM (#9840549)
Here's some techniques to address #1:

1. Store your private keys in a separate process, either on the same machine or a remote, more secure host. Offload private key operations to the private key service. This obviously requires an encrypted connection between your webserver and the private key service, but you get good gains in security from no longer having the private key in your public facing web server's address space.

2. Another technique you can add is to separate the data plane from the control plane on your public facing webserver--that way you have a stripped-down process that is just handling the low level reading and writing of buffers to the wire, and have a fast pipe connecting it to a separate process doing all the HTTP logic. That way, you can lock down the data plane service and make it harder to exploit since it has a much smaller surface area than a full fledged web server.

Re:Forthcoming OpenSSL releases by ams6110 on Monday July 06, 2015 @03:12PM (#9841469)
Your webserver needs access to the private key when it starts. Is it really a big enough gain to be worth it to move it to another server? If I root the webserver, I can presumably just read the key from that service.
Re:Forthcoming OpenSSL releases by xorcist on Monday July 06, 2015 @03:48PM (#9841739)
The webserver process does not need access to private keys, just access to the encryption service ("TLS offloading").
Re:Forthcoming OpenSSL releases by ams6110 on Monday July 06, 2015 @04:05PM (#9841838)
OK, so if my TLS temination host gets rooted.... I guess the assummption is that host is hardened and less likely to be exploited since it's just doing one well-defined thing?

My ignorance may be showing, how would I copmpletely isolate the private keys from the public-facing service? I suppose using an accelerator card would do it?

Re:Forthcoming OpenSSL releases by wolf550e on Monday July 06, 2015 @05:38PM (#9842348)
No accelerator card needed.

You run an "RSA signing server" that accepts connections only from the internal IP of your webserver (or maybe only TLS connections from across the internet but only if the client connecting to it has a client certificate signed by your own self-signed CA, but that depends on topology).

It runs a very simple app that accepts requests to sign something and responds with the <something> signed by your RSA private key. The code for this is very minimal and secure. You teach your web server to use this thing during TLS handshake, to sign the ephemeral key exchange.

If the web server is hacked, the hackers gain the ability to sign things with your private key, but they don't get the private key itself. They need to hack the "RSA signing service" server for that. They can't stockpile signed ephemeral key exchanges. After you detect the hack, snapshot and kill the hacked server, start a new one from clean backup, they lose the ability to impersonate your site.

CloudFlare have a writeup on their service that does this (TLS negotiation by their TLS terminator with only you holding the key): https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-tec...

Re:Forthcoming OpenSSL releases by nocarrier on Monday July 06, 2015 @06:33PM (#9842593)
This is an excellent explanation of how private key offloading works, thank you.

BTW, you can store private keys in a HSM on your private key server and that's an additional layer of protection, but nobody uses TLS accelerator cards anymore that I'm aware of. You can simply do the relevant crypto on commodity CPUs and still have plenty of throughput.

Re:Forthcoming OpenSSL releases by baudehlo on Monday July 06, 2015 @10:15PM (#9843286)
Though I guess what they could do in such a scenario is implement a service which uses the signing server and hope to run undetected. Yes?
Re:Forthcoming OpenSSL releases by wolf550e on Tuesday July 07, 2015 @05:07AM (#9844306)
Yes. My first idea to detect this is keep count of signatures performed on the private key holding server and count of tls handshakes on your webserver.
Re:Forthcoming OpenSSL releases by lmm on Monday July 06, 2015 @04:05PM (#9841841)
Does that actually help? If the attacker is running arbitrary code as the webserver, they can use the webserver's access to the service to MITM anyone trying to connect to you.
Re:Forthcoming OpenSSL releases by iancarroll on Monday July 06, 2015 @12:21PM (#9840218)
There is no limitation in TLS preventing you from cycling your keys every 24 hours. Most CAs let you do unlimited reissuance. It makes public key pinning hard (impossible?), though.
Re:Forthcoming OpenSSL releases by sneak on Monday July 06, 2015 @07:42PM (#9842814)
This doesn't really work without the certificate expiration date also being 24-48h in the future, though.

I think they reissue the same 1y+ validity cert...

Re:Forthcoming OpenSSL releases by iancarroll on Monday July 06, 2015 @07:53PM (#9842851)
Some allow manually specifying the expiration times.
Re:Forthcoming OpenSSL releases by skuhn on Tuesday July 07, 2015 @03:34AM (#9844068)
Entrust, for instance, allows you to purchase certs essentially on a subscription plan. You may have one valid cert for 3 years (and pay the reduced 3 year rate), and reissue it with 24 hour expirations every day.

I personally wouldn't go with an expiration that low because of the operational overhead, but a few weeks or a month is attractive. It still significantly limits the downside potential versus 1-3 year certs. Basically any cert (non-root) over 1 year should be considered against best practice at this point.

Re:Forthcoming OpenSSL releases by rakoo on Monday July 06, 2015 @12:53PM (#9840433)
> It makes public key pinning hard (impossible?), though.

In this case you don't pin the server's key but the "central" key.

Re:Forthcoming OpenSSL releases by kpcyrd on Monday July 06, 2015 @12:39PM (#9840310)
4: Namecoin supports this, if I recall correctly, but I recommend to pull this value out of your local blockchain instead of dns.
Re:Forthcoming OpenSSL releases by ad_hominem on Monday July 06, 2015 @12:55PM (#9840454)
I don't understand #1 - what prevents you from doing this today? When you generate a certificate you get to pick the expiration date; you are free to make it as short as you want. Don't intermediate certificates exist to implement this strategy?

edit: basically, what stops you from doing this?

Root CA root cert (20y expiration)

v

Root CA intermediate cert (10y expiration)

v

Your intermediate cert (1y expiration)

v

Your short-lived cert (24h expiration)

Re:Forthcoming OpenSSL releases by amluto on Monday July 06, 2015 @01:23PM (#9840672)
And who is going to issue you a reasonably-priced intermediate cert? Especially since PKIX name constraints don't actually work, so that intermediate cert would let you sign just about anything.
Re:Forthcoming OpenSSL releases by Hoff on Monday July 06, 2015 @01:55PM (#9840917)
For your own web servers and your own clients, use your own CA and your own certs.
Re:Forthcoming OpenSSL releases by eropple on Monday July 06, 2015 @02:04PM (#9840973)
This isn't a serious solution except for intranets--and this problem exists most pressingly on the internet to begin with.
Re:Forthcoming OpenSSL releases by erglkjahlkh on Monday July 06, 2015 @12:44PM (#9840372)
3) Does anyone have any reference to this?
Re:Forthcoming OpenSSL releases by antsar on Monday July 06, 2015 @12:53PM (#9840435)
Here's [0] the relevant section of the X.509 RFC (Name Constraints). Unfortunately, last time this was discussed on HN, someone mentioned that Name Constraints are not supported by all client software, making it unsafe to rely on them.

[0] http://tools.ietf.org/html/rfc5280#section-4.2.1.10

Re:Forthcoming OpenSSL releases by zokier on Monday July 06, 2015 @12:57PM (#9840469)
I'd imagine (based on very superficial knowledge) that DANE would achieve something to that effect. But it's pretty much dead because apparently DNSSEC wasn't all that great.
Re:Forthcoming OpenSSL releases by xorcist on Monday July 06, 2015 @03:56PM (#9841781)
Very short lived certificates instead of broken revocations is bascially what DNSSEC gives you.

(It's apparently "dead" around here, but then again so is IPv6...)

Re:Forthcoming OpenSSL releases by sebiw on Monday July 06, 2015 @12:40PM (#9840317)
4) would only make sense with signed DNS responses
Re:Forthcoming OpenSSL releases by Xylakant on Monday July 06, 2015 @12:40PM (#9840321)
1) could be solved by a HSM or a similar construction in software. The private key never ends up on the web server this way.
Re:Forthcoming OpenSSL releases by vbezhenar on Monday July 06, 2015 @01:23PM (#9840677)
#3: What about .com, .org, .name and many more domains? Who will control them?
Re:Forthcoming OpenSSL releases by dfc on Monday July 06, 2015 @12:37PM (#9840304)
What problem does #1 solve?
Re:Forthcoming OpenSSL releases by rakoo on Monday July 06, 2015 @12:49PM (#9840401)
It makes losing/leaking a private key less of a problem, because it restricts the leakage to a 24h window. It also makes (webserver) key revocation kind of useless, because the certificate is automatically invalid after 24h.