Podcast
Root Causes 226: The Six Benefits of SSH Certificates
Hosted by
Jason Soroko
Fellow
Original broadcast date
May 24, 2022
In this third episode in our series on SSH keys, we identify the six main benefits of SSH certificates and how they mitigate the problems with SSH identified in earlier episodes.
Podcast transcript
Lightly edited for flow and brevity.
TCTim CallanSo, this is the third in our series of podcasts walking through the concept of SSH keys and SSH certificates. So, a little bit of background for the listener. In our Episode 221, What Are SSH Keys?, we do exactly that. We define what SSH is and what SSH keys are and how they work and how they’re used. In our Episode 224, we discussed the five problems with SSH keys, and we go into some depth in explaining what they are and how they happen. And now, in this episode, we want to describe SSH certificates and the six benefits of them which will also be another way of saying how they directly mitigate those five problems. Isn’t that right, Jason?
TCTim CallanWell maybe we’ll do them in the order I have them written down then, if that’s okay?
TCTim CallanThese are six. That works. Again, if you need to, if you want any background on this, go listen to those other episodes then come back and listen to us. If you listen to those other episodes or you think you get SSH, let’s jump into it. So, first of all, we talked about the difficulties that come with raw keys and a certificate, of course, is essentially keys in an envelope with rules. Is that a fair, if over-simplified, explanation?
I’d like to talk about this in context of authentication and the number one benefit I would say, Tim, is trust. In other words, if you go back to SSH just with the raw key pair, we talked about one of the problems earlier, I’ll connect this, that trust on first use, where you get that big notification that – it’s not an error message, it’s essentially a declaration of, there’s no guarantee that what you’re connecting to is what you think it is. You better do your homework. Whereas, with certificate-based SSH Authentication, you’re not having to do that homework. That homework has been done for you, presumably by the centralized trust system. In other words, if the thing you’re connecting to possesses a public and private key pair, and it’s going to trade that private key pair with you at the point of trust and first use with this new scenario authentication, you have immensely more confidence that you are speaking to the actual server that you’re actually intending to speak to. And so, no more big warning message at the beginning, Tim. That’s a huge thing for SSH.
TCTim CallanNot to be in any way obscure about it, what we’re talking about here is by virtue of the fact that it has a certificate, that means that it has a certificate chain. At the top of that chain there is a Certificate Authority, and your system can be set up to know what that CA is, to know what that root is. So, it won’t just take just any cert. It’s going to take a cert with a root that you’ve chosen to trust. And that’s monumentally different. That’s complete different from a public or private key pair, which has no chain at all. There’s nothing, there’s no meta information attached to it in any way to say where this came from, who is this from, who is vouching for it. All it knows is, do the keys match, and that is the only thing it knows.
Therefore, it’s the certificate itself that allows for itself to be signed, and that signing is part of what you could call a policy. In other words, you shouldn’t trust it unless it is signed by that central authority. And so, therefore, your trust of the centralized authority is essentially what allows trust to be spread across all of the different parties.
TCTim CallanAnd that CA in this scenario, in this use case, operated and managed and controlled by the enterprise that ultimately is using these keys for access. And you, like your IT department would own that CA?
TCTim CallanAbsolutely. It’s perfect. Otherwise, again, there’s just none of that is there. It’s just, does this key work? That’s the only thing you know. Trust. Extraordinarily important. What’s the second one on the list?
TCTim CallanExpiration. So, if you’ve listened to the other podcasts, in my opinion, the worst problem with SSH keys is that they last forever. Like, these other things you’ve listed, they’re bad, but just the fact that they last forever, they’re like these bombs that are out there in the world. They’re like these landmines that no one ever found, and you never know when one day you’re going to be walking through a grassy field, happy as a clam, and you’re going to blow off your foot. And the fact that they never expire - -
TCTim CallanI was just going to ask, what do you think is a sensible expiry date for an SSH certificate? Like, if you were setting up a PKI, and I know it might, very much might depend on context and usage, but just give us some thoughts. If you were setting it up, what kinds of expiry dates would you be thinking about?
Perfection would be as soon as I’ve done my job - whatever my task is that I used this SSH certificate for, I would actually like this certificate to no longer be usable as soon as I’ve done my job. And so, therefore, what is ideal in that case? Because you may know how long it’s going to take, you might not know how long it’s going to take. I would say what a lot of people are doing is saying, ok, well, is that a day, is that two days? And what the problem is, some people, within a 24-hour period might still be – they may have the certificate issued to them 24 hours ahead of time, they’re doing a job, and then right at the 24-hour mark, they might still be doing their job, and the certificate expires. So that’s the big chicken and egg problem that we run into, and so therefore, I don’t think it’s a one-day type of scenario.
TCTim CallanBut you’re getting us into the ballpark. It’s days, not weeks, not months, certainly not years. It’s days.
TCTim CallanEven then, if you’re making it a week and it turns out that a lot of time you only needed two days - I understand you have some exposure time, but, compare that to just everything is good for a year. And, under those circumstances, the amount of exposure you have is just so much, so vastly less than it would have been otherwise.
TCTim CallanIf we start to imagine that this whole thing is being automated by a system with sophisticated capabilities and rules, then you can exactly imagine that. When you’re going to start the job, that’s when it’s issued that way you maximize your time. The other thing you could do under those circumstances is it could vary based on circumstances. It could be based on the user or the task or the environment, and for all those things, you might say, for this set of criteria we’re going to issue a one-day cert, for this set of criteria we’re going to issue a one-week cert because we think, work probably takes more time, and the risk is lower. That’s the kind of rule that you could build in if you think it through, and you’ve got some sense for why you would have things set at those different times.
TCTim CallanIf I’m giving you God rights, I’m going to limit you to a day, and if you’re not done, you get to come get another one, and I’m sorry if it’s inconvenient. If on the other hand I’m giving you access to something that isn’t all that important, I just consider the risk lower. I love it. What is Number 3?
TCTim CallanProbably not.
In other words, when we say, lower maintenance, it’s at least giving you the capability of doing maintenance in a much, in a frictionless way, because it is – that capability should be built into your Certificate Lifecycle Management System.
TCTim CallanBecause back to your previous point. They clean themselves out. The main maintenance is getting rid of the ones you don’t want. And they will do that on their own, if you have built-in expiration. And that’s most of maintenance.
Alright. I agree, lower maintenance. But otherwise, think about what is the nightmare. You’ve got these keys, and they’re just keys. They work, I mean, what you really have to do, your version of expiration when you're using raw keys is somehow, prove beyond a shadow of a doubt that this key, this private key, is no longer in use anyway.
Alright. I agree, lower maintenance. But otherwise, think about what is the nightmare. You’ve got these keys, and they’re just keys. They work, I mean, what you really have to do, your version of expiration when you're using raw keys is somehow, prove beyond a shadow of a doubt that this key, this private key, is no longer in use anyway.
TCTim CallanIt’s a Black Swan problem.
TCTim CallanI love it. What’s Number 4?
TCTim CallanI think I see where you’re going with this.
TCTim CallanLump it in with all the other like material, and use best practices to manage to deploy, manage, track, understand, and ensure governance for all of that like material. Once it’s a certificate, there is no good reason not to treat it the way you treat other certificates.
TCTim CallanAbsolutely. That’s excellent. Then you can start imagined reporting and compliance reporting and all sorts of things like that. All just gets so much easier. What’s Number 5?
TCTim CallanThat’s still TCO. That’s your total cost of ownership still went up.
TCTim CallanAnd on the topic of tooling, and this goes directly back to the previous bullet single pane grass manageability, you’re probably using tools that you have to have anyway, that you have to own and that you have to know how to use, and you just apply those to this situation as well.
TCTim CallanYou're bringing it into the fold of handling your authentication key material, certificate material. Yes. Absolutely, Tim.
And there’s a lot of different reasons to revoke, Tim, and we’ve talked about that on previous podcasts. But at least you get those capabilities because with things like SSH, replacement processes and revocation, well, you could say that it – replacement kind of exists, but revocation does not.
Revocation actually is – if you think about what would it take to do the equivalent to a revocation in an SSH key pair, we could list out what it would take here. It’s technically possible, but it’s a lot of work. And it’ s almost, really in reality, I think the reality of it is, it’s almost impossible because where are all the copies of the keys, Tim?
TCTim CallanI was just going to contend that. It is impossible because, and this is the Black Swan problem I was talking about earlier, you have to somehow prove to your satisfaction that this key, this private key, is not in use anywhere. How do you do that?
TCTim CallanOn the other hand, certs can be revoked. That’s one of the great things about certificates. Ideally if you have these short-lived certs that you and I are talking about, the exposure is low, but still isn’t necessarily zero. Among other things, let’s say I’m issued that one-week cert, and I’m done with my job, and I know I’m done with that job, maybe I can request a revocation right then and three hours later get on with my life. Now there’s no exposure.
As well, if you determine that there’s an automated system that needs to be reissued, have a renewal process for certificates because after a week or two or a month, whatever it is you decide for you that your certificate lifecycles are, that renewal process can actually be automated by your Certificate Lifecycle Management System. SSH raw cannot do that.
TCTim CallanI’m almost contrasting this to the opposite scenario. So let’s suppose that I have a developer, an employee who’s deep in the bowels of my systems, and let’s suppose that for some reason I have to let this person go and maybe this person’s disgruntled. Well, gee, I mean, how do I ever know that that person isn’t going to use an SSH key to come in somewhere and do something? On the other hand, in the other scenario you just revoke the cert or the certs, and it’s done.
TCTim CallanLet’s just say these benefits one more time as recap: trust, customizable expiration, lower maintenance, single pane of glass manageability, reduced costs and simple revoke and replace processes.