Live data from Hacker News

Poll HN: Do you use SSH certificates (not mere public-key authentication)?

news.ycombinator.com

91–100 of 156 posts

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#91
post #54

I store my authorized_keys in DNS TXT records, that are DNSSEC signed, with a validating resolver on the box. I then just use "/usr/bin/hesinfo %u ssh" as my AuthorizedKeysCommand in OpenSSH. I wrote a little tool that allowed you to "#include" other DNS records etc, but "hesinfo" is generally easily installable/available so it's just easier.

I know people do this, but I can't get my head around it. SSH is end-to-end secure even if the entire DNS hierarchy is corrupted. The DNSSEC PKI is controlled at its roots by governments, and one level of branches down by a set of companies not known for integrity and especially strong security practices. Why would you give any of these entities any influence over your authorized keys?

DNSSEC is top-down securing chain, DNSCrypt bottom-up. Each has their pros and cons. Relying on your government to keep you secure can be a valuable factor, depending on your threat model.

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#92
post #81
post #74

Note that using a CA cert with SSH (or putting a host cert in DNS, etc) expands the attack surface for your server from just that server to the server + the CA's servers + the CA's employees + potentially other CA's + whatever governments are able to compel the CA['s] to issue a MITM cert for your server. For big organizations security is by-definition lax (you have to trust lots of non-trustworthy employees), but th…

That's just the nature of trusting someone else to be your CA. You don't have to do that to use SSH certs.

At the minimum, you need to trust yourself to be a CA. That's strictly more attack surface than not having a CA.

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#93
post #78
post #67

Earlier quoted context omitted.

This wouldn't matter anyway because the server can just give you access regardless of the auth provided.

I know you can restrict the methods on the client (and which keys you use) but can the client determine the host actually used it?

The remote host can do:

    fn authorized(peer: ClientConnection) -> bool {
      return true;
    }

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#95

I don't see the benefit of using certificates for personal use. In my mind, certificates only really shine when administering a fleet of servers in a large company, as it eliminates the need to update the authorized_keys file on every server someone is hired or leaves. I could be missing some less obvious use cases, but if you're just authenticating to your personal machines, it doesn't seem worth it. It's not any mo…

I agree, but it kinda depends. For me, my personal setup has 8 things I can ssh to. It's not that big a deal to update them all if I get a new laptop or need to rotate my key. But I can certainly understand if someone didn't feel like doing that 8 times and wanted to use certs.

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#97
post #36

Earlier quoted context omitted.

> On the other side, as a personal user of SSH with basically one person to worry about, the effort of setting up a certificate seems like just a waste versus the existing key-based infrastructure; I don't understand at all what attack it would prevent or what convenience it would provide for the cost of learning it. The main benefit I get from using SSH certs at home is expiration. Before, I always had a niggling fe…

How do you issue client certificates? Do you not worry that the private key needed to issue these can also leak just the same as your personal private key?

By doing a Certificate Signing Request (CSR) from the client. Not sure when it's actually worth doing this extra effort but with the right automation (e.g. with Ansible) it's doable. Never tried this for ssh though. Additional security if you use HSMs.

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#98
post #91
post #54

Earlier quoted context omitted.

I know people do this, but I can't get my head around it. SSH is end-to-end secure even if the entire DNS hierarchy is corrupted. The DNSSEC PKI is controlled at its roots by governments, and one level of branches down by a set of companies not known for integrity and especially strong security practices. Why would you give any of these entities any influence over your authorized keys?

DNSSEC is top-down securing chain, DNSCrypt bottom-up. Each has their pros and cons. Relying on your government to keep you secure can be a valuable factor, depending on your threat model.

Ok, these are words, but again I'm not talking about DNS security here, I'm talking about SSH key distribution. Why would you elect to have your key distribution controlled by the DNS PKI? What's the upside? The downside is, an actor with control over the DNS PKI (there are many of those; see, for instance, every DOJ seizure of a domain) gets a degree of control over your SSH authorized keys. Seems... bad?

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#99
post #69

For folks on AWS I highly recommend investing in SSH over SSM in combination with EC2 Instance Connect. You can generate temporary ssh keys, send it to EC2 Instance Connect, it'll be on the server for 60 seconds. Then you can use ssm start-session to connect to the server over SSM. This also allows you to disable SSH ingress, and doesn't need a bastion or VPN.

If you’re all in on AWS, this is the easiest and possibly best solution, solves a bunch of security, operational and usability problems if implemented in tandem with SSO, CloudTrail and well defined IAM roles.

Re: Poll HN: Do you use SSH certificates (not mere public-key authentication)?

#100

Earlier quoted context omitted.

I think this is true if you only really have one or two computers you use ssh from regularly but if you have a few or you get new ones frequently you can get back to that experience of not having to frequently generate and distribute public keys by using a yubikey to sign local keys and then your authorized_keys only needs the cert authorization in it.

I hadn't thought of storing the CA key on the YubiKey. That's an interesting way to go about it. Like the other reply though, I keep my private SSH key on the YubiKey, protected with both a PIN and a password. I can SSH from any computer as long as I can install gpg on it.

Most of the time I don't really want to have my yubikey on me all the time (in particular, I no longer have need of regular keys in my day to day life so my keychain isn't as important as it once was). I'm happy enough to put a cert on a key, maybe with an expiry time, every now and then or on first use.

And it means I have to care less about what agent I'm running most of the time.

Post reply on HN