Live data from Hacker News

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

news.ycombinator.com

141–150 of 156 posts

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

#142

Earlier quoted context omitted.

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.

> How is this more secure than simply creating new certificates and replacing the old ones is the authorized_keys files? It’s more convenient for me than updating authorized_keys. When I build a new machine, for example, I first generate a new SSH keypair on the machine. Then I copy the server and user public keys to the CA. Once I drop them in the right folder, certificates get generated automatically and served ove…

How do you implement emergency certificate revocation?

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

#143
post #128

Earlier quoted context omitted.

It's not "strictly" more because you reduce the attack surface of your leaf certs through expiration, etc.

What attack does that prevent? If the leaf certs are compromised, then so is the server, and it is already game over.

It prevents the attack where thousands of users have thousands of long-forgotten keys lying around, and eventually one of them gets compromised months or years after it was last legitimately used. AKA a huge attack surface that can't reliably be culled, because you are effectively relying on users to be their individual CAs.

This particular attack took down my former organization once.

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

#144
post #64
post #57

Earlier quoted context omitted.

I don't know that I disagree with the broader point here, but long-lived certificates are what you don't want.

Not GP, but I'd assume they talked about the root cert? You don't want to roll out a new one every other week ;-)

Yeah, the root is long-lived. The ones you issue to SSH to a machine are short-lived, because they're not stored in something like Vault.

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

#145
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.

You're right - an adversary with physical access to machines running Vault can steal keys from it. An HSM is designed to survive at least temporary physical access by an adversary. And if you have management infrastructure that lets admins access the servers running Vault, then they can exfiltrate the keys (an HSM can be configured to prevent this). There exist threats that HSMs will stop that Vault simply won't stop.

But they are both systems intended to provide secure storage of key material with policy-based access to that key material. As an SSH CA, you can configure Vault to sign SSH pubkeys but never divulge the key material. Depending on your threat model, it might get you what you want for this use-case, but you should definitely be aware of the limitations of Vault's security model.

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

#146
post #122

Earlier quoted context omitted.

I just store my SSH key in my Yubikey and then I can SSH from any computer that has SSH and GPG installed. Gets rid of the "generate and sign a key that then sits on that computer that might not be fully trusted" step...

not as flexible, as it has more dependencies, but you can make it work without gpg as well: https://developers.yubico.com/yubico-piv-tool/YKCS11/

Yes, I could. In fact I actually also use the PIV functionality, just not for SSH. The GPG answer seems simpler, at least for my use-case, since it really does just require SSH and GPG (okay, and GPG configured to `enable-ssh-support`). Also, I was actually using a GPG-as-SSH-key before I started hosting it on my Yubikey.

Sadly, the Windows GPG build and Win32-OpenSSH don't talk to the agent the same way, so it doesn't work there. (AFAIR Windows GPG - and Putty - uses "Assuan" while Win32-OpenSSH uses named pipes just like *nix SSH/GPG do.) I don't think PIV would help that though :(

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

#147

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.

Please write a blog on this

A blog on this.

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

#148

Earlier quoted context omitted.

Please write a blog on this

A blog on this.

And I may well do. But it's probably not the best idea to do this on a larger scale, there are valid reasons why this is not a good thing to recommend -- if you miss one part (DNSSEC signing, or running a local validating resolver) you can end up with a vulnerable system.

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

#149

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.

Yes. Hesiod is safer than DNS TXT once secured by DNSSEC, because I envision mass blocking of DNS TXT in the near future.

Hesiod uses txt records. I am using IN class records too, as I do not have a DNS provider that supports HS class... But that's fine, it works!

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

#150
post #52
post #35

Earlier quoted context omitted.

I would love a HOWTO link. Also, can the DNS server be public facing? Any issues with the authorized keys being public (AFAICT there isnt but i am not a security expert)?

Unless your keys are generated with low entropy (like the Debian CVE-2008-0166), publishing the public key file should not be an issue; that's from a cryptographic pov. & as bombcar said, obviously if you ignore "unknown host" warnings, you can be tricked into logging into an attacker-controlled machine. Often key files also contain "user@host" for the user&host the key was generated by&on. This identifier is then le…

SSHFP records largely solves the host key problem, but yes, the user is the weak point in the chain there.
Post reply on HN