Live data from Hacker News

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

news.ycombinator.com

101–110 of 156 posts

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

#101
To SSH into servers at $work, I need to run a command to 2FA-authenticate against our SSO and obtain a short-lived SSH cert for my local SSH key. We have around 10 tech employees and around 40 servers and it's really nice when onboarding new servers or new employees that we don't have to juggle authorized_keys around, and when offboarding employees we no longer have stale authorized_keys files to worry about, since access will expire automatically after 20 hours once the employee is removed in SSO. There's no hardware backing the CA, and it's all homebrew (NIH style) 2FA-SSO with openssh CA invocations, but it works and is quite convenient. We also use the same CA for host keys (again, certs issued by our NIH-style homebrew fleet management), which allows us to avoid TOFU prompts when onboarding new servers.

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

#102
post #98
post #91

Earlier quoted context omitted.

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?

[deleted]

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

#103
post #36

Earlier quoted context omitted.

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.

That actually doesn’t answer my question (though the actual addressee answered it already quite satisfactorily). First, there is no such thing as CSR in context of ssh certificates: ssh certificates are not x.509 certificates (known for their use in TLS). Second, even assuming that they were, a client creates a CSR with their key, and then what? Where is the root of trust? Who processes these CSRs? How is it deciding which CSRs to accept, and which to reject? That’s what I’m actually asking about.

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

#104
post #36

Earlier quoted context omitted.

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?

I have a Raspberry Pi dedicated to generating certificates. It serves the files to my LAN statically via a webserver, and is otherwise heavily firewalled. I don't run any other software on the Pi, so barring an exploit in the webserver, I’m not worried about the signing key getting compromised. Compared to my desktop, where over the years I ran all kinds of stuff from the package manager, downloaded Python scripts an…

So anyone on your LAN can visit the URL and download the CA private key? Isn’t it only marginally more secure than just keeping the private key on your workstation in the first place, and foregoing the entire rigamarole with certificates? I mean, if you are worried about your something compromising your workstation and stealing your individual private keys, nothing is stopping whoever compromised your workstation from asking your RaspberryPi nicely for CA signing keys and stealing those too.

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

#105
post #16

We looked into them once at work for our "conventional" SSH infrastructure, but immediately rammed into the wall that a certificate can sign a key, but you can't have a full PKI infrastructure like SSL where certs can sign certs that can sign keys. Without the ability to delegate, the logistics of needing to create an absolutely centralized authority to do the useful things we wanted to do within the organization rai…

We set up an ssh cert signing server using Hashicorp Vault [1] so we didn't have to keep rotating keys across a fleet of boxes we couldn't always reach. It was cool but it made me nervous to centralize something like that. Cert sigantures expired after 30 min so leaks were not a problem. It was backed by DynamoDB and the keys were in memory so everytime the containers rebooted someone would have to manually unseal be…

We did this as well. To mitigate the danger of a vault outage, we had a very tightly restricted endpoint which generated 24 hour certs that were fetched by automation on a single box. In the event of a vault outage, we'd have a day to either fix it or deploy public key access.

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

#106
An option that's not in the list: check you CA key into source control (but with a very strong password). If you set the number of rounds large enough and have an excellent password this is sufficient (not as good as HSM, but probably safer than Vault).

The real thing that gets me though, is how to deal with different users needing access to different subsets of machines. That's where I miss Kerberos.

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

#107
post #16

We looked into them once at work for our "conventional" SSH infrastructure, but immediately rammed into the wall that a certificate can sign a key, but you can't have a full PKI infrastructure like SSL where certs can sign certs that can sign keys. Without the ability to delegate, the logistics of needing to create an absolutely centralized authority to do the useful things we wanted to do within the organization rai…

> 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 is this more secure than simply creating new certificates and replacing the old ones is the authorized_keys files?

> I only have to worry if my machine is secure in the present

No. If a host has been accessed by an attacker due to an exfiltrated key in the past it's tainted forever.

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

#108
post #32

Doing this without something like Vault is very difficult. Vault is designed to provide similar guarantees to an HSM (it's a service designed to make keys usable but not exfiltratable ), and that's essential for any long-lived certificates.

Vault is not able to provide guarantees similar to an HSM.

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

#109
post #10

What's the difference between a certificate and a public/private keys?

Certificate is short lived and signed on the fly for when you need it. The server trusts your SSH CA, and you can ask it to sign any private key you want, with a ttl. So you get extra security (credentials are dynamic and short -lived, and also per-user if needed) and lower maintenance because you only have the SSH CA public key to setup on all machines and that one needs less rotation/updates than public keys.

> lower maintenance because you only have the SSH CA public key to setup on all machines

This is hardly "lower maintenance" than pushing updates to the authorized_keys across servers.

Or having servers poll for such file.

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

#110

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.

doesn't this approach run into caching problems?

With a short TTL I imagine it's quite workable.
Post reply on HN