Hello everybody. I think I'll just hold this. I'm Nick Sullivan and I'm going to talk to you about an open source project that I've been working on for a while with some of my colleagues related to cryptography. It's called CFSSL. So this is a truth, right? Everybody kind of knows this. When it comes to cryptography or anything else, if people have to put a little bit of extra mental effort into things, it's a challenge and people won't do it. In general, if you have an extra cognitive burden associated with an additional task that doesn't give you much of a benefit, you're not going to do it. So this is the argument, I guess, against PHP or PGP and why PGP has been not fully adopted by everybody. It's just a little bit tricky to use, right? But that's enough to make it too hard for some people, right? And about doing cryptography, exchanging messages between different people, what's the really mentally hard part about it? It's this idea of trust, right? So how do you know that this key that you have from someone else is really from there? Do you trust these key servers that they have out there with all these different keys on it? Are they reliable? Did you go to a crypto party and sign somebody's key? And how do you move your keys around from one device to another? And there's been quite a few products in the last little while that have been designed to help solve this key management problem. And by why I mean solve, I mean make it so that the lazy person doesn't have to think about it. So this does come back, come with some cryptographic drawbacks and all these solutions solve a lot of the problem in exchange for taking some stuff away. So this is about, you know, person-to-person, peer-to-peer communication. But what about the web? Well, so in December I gave a talk at Real World Crypto about HTTPS and all these major sites didn't have it. But the world is kind of coming along to the idea that HTTPS should be the default for the Internet. That every site, whether it's, whether you're uploading credit cards or just browsing anything, should be encrypted for everyone's privacy and security. And, you know, it's been about half a year since then. And, you know, it's been about half a year since then. And several big sites have, you know, taken the leap. But for the rest of them, they're going to have to figure it out soon. Because not only is Mozilla trying to deprecate non-secure HTTP, anything that you connect to a website over an insecure channel, they're trying to make it so that the browser will warn you and say, hey, this is insecure. And, you know, Chrome's doing the same thing, right? Marking HTTP as insecure. This is a plan, you see, transition plan in 2015. This is a transition plan in 2015. This is a transition plan in 2015. It hasn't really started yet. But it's coming. And they want to do it. So the Internet right now, very few sites are HTTPS. A lot of the major sites are. But, you know, small sites, it's really kind of hard. And people, there's just enough friction to getting SSL certificates and setting these things up, like with PGP, that people are sort of, like, why bother? So this is, like, a small plug for a project that we did at CloudFlare where we offered free internet access. And, you know, we're using the SSL. So if you have a site, use our service and you have an HTTPS certificate for free. And this is all well and good, right? So this protects you as a visitor to a website and a website as people going to it from having snoopers or interceptors anywhere along the path between the device to the website. But anybody who's building websites and services know that that's just the first, that's sort of, like, that's the wild west, the outside, the inside world. But there's really a whole other world behind it in the back end that you have to think about. So if you have a message that goes from, you know, your device to the website, what happens once it gets there? It could go over, you know, inside of a secure network to other services, database services, things like this. Or it could potentially go over the internet. And it's really not clear. So as a web developer, you should really consider your network to be untrusted. Consider that your network is hacked. And, you know, there's a lot of stuff going on. And this is one of those things that takes, it's a little bit of a mental jump and a leak, just like with setting up HTTPS for your site. And just like as a subset of people, developers are also lazy, right? So if there's any kind of burden, they, you know, they'll just give up and say, okay, well, you know, it's, we're all inside AWS, who cares? It's all safe. So if you have as a functional requirement for, you know, you know, you know, you know, you know, you know, you know, you know, you know, you can use, or a product, or a company, say, you know, encrypt all the things. It's, this is kind of like saying, encrypt all the emails. And you know, that's very vague. And when it comes to trust in key management, there's no real good standard solution for this. Just like with PGP, how do you trust the keys are coming from someone else? If you have multiple services in your data center, or over data centers, over back-ends, you know, storage is one issue. I'm gonna where are the keys? The dog ate the keys, right? And if you're going to have a website back end or communication that happens that's not between a browser and a server, you probably want to have a public key infrastructure. You want to make sure that things are encrypted in transit between processes, between applications. And doing this with open SSL and say other open source CAs like EJBCA are actually really hard to deal with. Nobody wants to think about that or look at it. ASN1 is horrible. And nobody wants to touch the open SSL command line and sort of integrate that into their development environment. And this actually came across for us with this project called Railgun which is a product that we use to accelerate communication between your server and CloudFlare CDN. So if you install a piece of software on your server, you can actually do some really nice things to speed that up. You don't have to use regular HTTPS. You can do smart differentials and all these sort of things. But you also want that connection there to be fully encrypted and trusted and, you know, PKI'd and mutually authenticated TLS is one of the many tools you can use to do that. But again, the question is, you're running a website. You're using it. You're using the service. You don't want to buy a certificate and try to install it or have to even think about these sort of things. This is a barrier to entry to get on to something like this. So, well, we decided just let's write our own CA software, right? And we chose Go, which is really fun to program in. That's not the main reason. But mostly the reason is that building APIs with it is incredibly simple and the crypto library in the standard library crypto is pretty robust. And it also doesn't have a lot of the cruft that, you know, open SSL has. It doesn't have heartbeat support, for example, and anything that you really wouldn't need in a TLS server. So, what we did was we built CFSSL as a CA server and it's fully kind of automated and you can use the JSON API and use it for certificates. So how does this work with, say, Railgun, for instance? If you have this Railgun instance on your website, you're trying to use Cloudflare, when it spins up, it runs this activation call and sends a certificate signing request to the CA and gets it back. And it's signed by a Cloudflare internal CA. So then from then on, any communication between Railgun and Cloudflare is completely mutually authenticated TLS. And in this case, you don't have to do anything really as a customer. You don't have to buy a certificate. You don't have to install it. You don't have to install things. This, that, and the other. All this burden of the cognitive burden of setting up cryptography is saved because it's just an API. It's just automated. And at this point, if you have Cloudflare in the origin, this back end part now becomes encrypted. And this model is something that makes sense to apply to your entire infrastructure. So if you have, say, API servers and TLS servers, you don't have to do anything else. You can use CFSSL as the CA to offer certificates for all of these. There's a client library and a client application for CFSSL that whenever one of your API servers, whether it's an ephemeral in a Docker container or a VM, it just spins up, asks for a certificate, and then it can go. And then these two servers can talk to each other over an encrypted connection. And so at that point, as a developer, you don't have to think about, is my network secure? Is any of my servers secure? Is my network secure? Is any sort of the underlying layers? Am I on a VPN? Do I trust my data center or anything like that? And that's one of the big advantages that CFSSL can give you. So deployment is also super nice because in Go, it's just a static binary. So build it, send it to wherever you want to run it, and, you know, go from there. And right now, in the open source, we have Docker definition, if that's your thing, if you want to do some containerized things. But, yeah, so that's kind of the thing. So CFSSL as a CA is something that we actually use in production and has been really, really useful for us. But another thing that we've noticed or another problem when it comes to PKI on websites is certificate errors. And we've run into this quite a lot with people setting up their own site. Different browsers trust different sets of CAs. So if Windows trusts different CAs, you know, if you're using a certificate authorities, then Android trusts different ones than whoever. And not only that, but Chrome now and Firefox have more restrictive policies around what type of signature algorithm you have. So given a certificate, you may not know this, but you can construct multiple different chains of trust for the same certificate all the way down. So, for example, in this one, this is our leaf certificate. There's two different interfaces. There's one on the left and one on the right. There's two intermediates that have the same public key that are signed with one shot one, one shot two. And they kind of root down to different certificate authorities. And depending on what browsers want to see your site, one of these chains might work, one of them might not. So we built a tool in CFSSL called the bundler in which you give it a certificate and say, do I want the most modern up to date chain? I don't care about backwards compatibility with old devices. Or do I want the most compatible possible chain that will work everywhere? So it will either give you the one on the left or the one on the right. And this is kind of automated. It follows the AIA record inside a certificate which points to where it's CA is. So it's actually really nice. You want to set up a certificate that you bought from a CA and you don't know what the right chain is, you just throw it through bundler and it will get it for you. So after a couple of days, after weighing the pros and cons of open sourcing this, about a year ago we said, yeah, this is something that the world could use. Let's do it. Let's put it out there. And this is last July. And I guess to our surprise, like a lot of people started using it. And these are unconfirmed but sort of just people from these different places have said, hey, we are using this inside either the bundler or the CA. And it actually, if anyone was listening previously to the Let's Encrypt talk, CFSSL makes the core of what their CA is. So CFSSL is right at the middle of what they're using for their CA. And, you know, it's been a year so I'm happy to announce the version 1.1 of CFSSL. We just tagged this this week. And it has some really nice features that are useful and that people have asked for since we originally came out with this. And one of the main ones is HSM support. And big shout out to Richard Barnes from Mozilla for helping out with this one. But yeah, you can use CFSSL without having to store your key on a disk. If you have your CA on a trusted box, that's good. But it's not as good as having it in a piece of hardware that's tamper resistant. So you can now use CFSSL with HSMs. You can use it to support multiple CA's at the same time. It does OCSP as well with, you know, the, you know, the, you know, the, you know, this remote mode where you can authenticate with it. And we introduced a nice web UI. So people like interacting with these type of tools on the command line or with, via an API. But if you want to get it used by more broadly in an organization, web UI is really the way to go. And if you, if you install CFSSL and run it and you go to local host colon 8888, then the UI pops up and you can use the different options. And here's kind of a full list of the changes. It's impossible to read from here. But we've fixed some things. We added some things. And it's looking really good. So the other thing that we did was we built a web, well we put it online. So CFSSL.org is the home of this development project. And if you go there, you can kind of, you can actually test out the features because we have a version of this running. And let me... show you right now. So bundle. So for example, you can point this to any website and say what flavor of certificate you want. Force means just don't even listen to us, just whatever certificate chain you want. But ubiquitous is the most compatible and then there's most optimal. You can kind of point it to a site and say, yeah, give me the certificate chain and then this will give you your list of certificates and then your list of warnings here for which browsers will and will not support it. So for example, this one has shot 2 and Windows XP SP 2. If you're not using Chrome or Firefox, it won't like it. Same with Android 2.2. And this website is also ECDSA, which means there's a whole host of browsers that won't be able to use it as well. So that's it. Thank you. That's the demo. And those are the basic two features of CFSSL is the sign and the bundler. But there is one more thing. What good is a TLS and PKI library if you're not going to use it to do the most important part, which is testing, right? If you're setting up TLS servers, you need to have them configured correctly and you need to use the right cipher suites and you need to have everything set up so that it is secure. You don't want to use SSL 3 for instance. You don't want to use SSL 3 for instance or you don't want to use export ciphers. There's a lot of different things that make TLS useful. The flexibility. But that also lets you hamstring yourself with having a bad implementation. So we added this feature called CFSSL scan. And what this does is you point it at a server and it does a scan, kind of like SSL labs does. So if you have a public website and you use SSL labs, you type your host name and it will scan it and say, okay, yes, it supports the cipher suites, these TLS versions, this, that and the other thing. But it's actually not able to do this inside of an infrastructure. So it only works for things that are on the public web. What CFSSL scan is is a stand-alone application. So you can take this go app, send it inside your infrastructure and point it at different IPs and say, okay, is this correct or not? And it's modular so that if there are any new vulnerabilities that come out, like something like a heart bleed or a TLS poodle or something like that, you can just add them in as individual scans to this. So this is also part of the open source thing. So let me demo this real quick. So this is what it looks like. So I recently scanned, so CloudFlare.com with CFSSL.org, and it has your DNS connectivity, TCP dial, TLS session, whether you support session resumption and then down here it has this whole array of which cipher suites you support. And it is somewhat opinionated. So it will tell you if you have a cipher suite that is sort of less than optimal. But it will also sort of tell you which elliptic curves you do support and all these sort of things. So CloudFlare.com is a great way to scan. And let's see, this is CFSSL.org. This one has only ECDHE, so elliptic curve certificates. And if you go to the Paris hotel and say scan the internal captive portal network, you'll see that there's some bad things. The chains don't validate and it automatically downgrades your TLS session to 1.0. So this is CFSSL.org. So this is CFSSL. scan. And hopefully people will contest this out. You can go right now on CFSSL.org and try it. Although I don't encourage you to really use this as your basis because it's running on sort of a small instance. The best way to go about this is to do what I have here which is just run it locally and you can run a scan. So if you have access to a wide network, you can actually run this from all sorts of different places around the globe to see if TLS configurations look the same. And it works really well if So this is also useful for inside and outside of countries with different firewall parameters to see if things match up correctly. And yeah, so that's what CFSSL is right now. So certificate authority, chain builder, and TLS scanner. This is the core team is me, Kyle, and Jacob and these are all systems engineers at CloudFlare. And for 101, I'd like to thank all these contributors, especially Taren Stock. Where are you, Taren? For the UI. He's supposed to be here. He sort of got that in earlier today. And yeah, so that's it. CFSSL, thanks. Now does anybody have any questions? Do we have support for issuing publishers? So you're asking if we scan a site, do we publish those to a CT log or can we add that? Oh, right. So if you're using CFSSL as a CA, right now there's no support for publishing to a CT log. It's usually used for internal stuff. But that is a good suggestion for a future product. And yeah, if you are running your own internal PKI, it's an interesting idea to have certificate transparency to make sure that certificates are issued as you expect them to. Yes. So the scanner takes a look at everything. It sort of identifies weak key sizes, weak key algorithms. And if you have different extent of the system, you will see that. So if you have extensions, say if your certificate is not valid for server authentication and only for client authentication, it will tell you that. So right now this is sort of the back end piece of it. And we don't have authentication built in. So you would have to put your own authentication module in front of it. Right now it's as a CA with the web UI. In the API we have an HMAC based authentication scheme you can use and we're looking to extend that to more standardized authentication mechanisms. Anybody else? Okay. Well, thanks a lot to DEF CON and see you again soon.