News for hackers. Stuff that matters.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Wednesday August 31, 2022 @09:51AM (#32662017)
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.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by tptacek on Wednesday August 31, 2022 @11:56AM (#32663980)
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?
Re:Poll HN: Do you use SSH certificates (not mere public-key... by Fnoord on Wednesday August 31, 2022 @02:39PM (#32666494)
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... by tptacek on Wednesday August 31, 2022 @03:15PM (#32666988)
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... by gunapologist99 on Wednesday August 31, 2022 @04:08PM (#32667673)
Agreed completely. The threat model for DNSSEC is vast; why would you diminish the security of a perfectly good end-to-end model in SSH keys or certificates, as long as you control 100% of that infrastructure.

Introducing any outside actors at all objectively diminishes the security of the whole model by becoming another link in the chain, even if that link isn't necessarily the weakest (and I certainly believe it would be, because both DNSSEC and the public Certificate Authority industry are object lessons for the abject failure of highly centralized global, government-wide, or even just company-wide security), but simply increasing any of the surface area is enough to decrease the security of the system.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @01:52AM (#32672503)
You'd have to compromise not only the root keys just to get into my infrastructure, but sign all the zones from there downwards, and intercept all DNS traffic leaving that server in the first place. That's secure enough for me.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by candiddevmike on Wednesday August 31, 2022 @11:33AM (#32663525)
This method puts a lot of reliance on DNSSEC working and trusting that it is preventing spoofing. I personally wouldn't rely on this in production, there are too many stories about DNSSEC cutovers rendering the domain unresolvable for hours+. Imagine not being able to get to your servers too...!
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @01:53AM (#32672513)
My DNS zones are not hosted on those servers, Google Cloud DNS does the dnssec signing, and there is a breakglass key installed on there too that when used automatically sends alerts out.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by colechristensen on Wednesday August 31, 2022 @10:52AM (#32662797)
Hesiod, now there’s a name I haven’t heard in a long time

https://en.m.wikipedia.org/wiki/Hesiod_(name_service)

Re:Poll HN: Do you use SSH certificates (not mere public-key... by aliqot on Wednesday August 31, 2022 @10:35AM (#32662552)
Is there some way I can purchase you a pint?
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @01:54AM (#32672516)
It would be rude of me to decline such an offer ;)
Re:Poll HN: Do you use SSH certificates (not mere public-key... by strobegoodsong on Wednesday August 31, 2022 @11:19AM (#32663261)
Please write a blog on this
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @06:44PM (#32684340)
A blog on this.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @06:47PM (#32684373)
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... by bshep on Wednesday August 31, 2022 @10:51AM (#32662787)
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)?

Re:Poll HN: Do you use SSH certificates (not mere public-key... by theblazehen on Wednesday August 31, 2022 @11:07AM (#32663056)
There are none. In fact yours is already public: https://github.com/bshep.keys
Re:Poll HN: Do you use SSH certificates (not mere public-key... by bombcar on Wednesday August 31, 2022 @11:20AM (#32663275)
There is technically one minor one, which really isn't one - but you should be aware of.

Someone can take your authorized keys and add them to a box they control, and trick you into logging in.

However, this would trigger the "new host" warning SSH gives you, and you can minimize this by minimizing which hosts you allow your private keys to be used on.

And if someone is so actively trying to attack you they probably have more direct methods available.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by dcow on Wednesday August 31, 2022 @12:38PM (#32664747)
What? How? What does putting my authorized keys file on another host do in terms of tricking me to log in? Authorized keys only matters on the host you are using when you type `ssh <some.host>`. The ssh client compares the public key of the remote host to the list in your `authorized_keys` file and, only if there is a match, skips serving you TOFU.

EDIT: I mixed up authorized_keys and known_hosts. But, the remote server doesn't need your authorized_keys file to grant you access so not sure the visibility of authorized_keys matters.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by cubesnooper on Wednesday August 31, 2022 @12:40PM (#32664780)
You’re thinking of known_hosts, not authorized_keys.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dcow on Wednesday August 31, 2022 @12:47PM (#32664879)
You are right, I am. Now I understand the DNSSEC setup.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by xorcist on Friday September 02, 2022 @07:50AM (#32689493)
Known_hosts can also be put in DNSSEC, using the SSHFP DNS record. OpenSSH understands that out of the box.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by lapser on Wednesday August 31, 2022 @12:41PM (#32664802)
This wouldn't matter anyway because the server can just give you access regardless of the auth provided.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by bombcar on Wednesday August 31, 2022 @01:19PM (#32665397)
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?
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dcow on Wednesday August 31, 2022 @02:45PM (#32666595)
The remote host can do:

    fn authorized(peer: ClientConnection) -> bool {
      return true;
    }
Re:Poll HN: Do you use SSH certificates (not mere public-key... by folmar on Wednesday August 31, 2022 @05:30PM (#32668614)
Use `ssh -vv` and you'll see which methods are proposed and used.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by archi42 on Wednesday August 31, 2022 @11:44AM (#32663734)
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 leaked, and you might want to avoid that. On my personal (and very objective! /s) paranoia scale this a 8/10. I'd definitely point it out to a customer during a pentest, but wouldn't really care if they "fixed" this (most of the time there is a lot of stuff that's more serious than knowing that the devops person is 'bro2000@jims-laptop').

Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @06:50PM (#32684397)
SSHFP records largely solves the host key problem, but yes, the user is the weak point in the chain there.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by encryptluks2 on Wednesday August 31, 2022 @01:01PM (#32665104)
A public key can be an identifier. Depending on what other information you share online or if a key is reused on GitHub it can be used to identify other places you visit and other artifacts associated with you. If your goal is anonymity then keeping you public keys secret or not attached to other personal information like a domain name is ideal. Almost all registrars are going to have a way to reveal your true identity.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by snowstormsun on Wednesday August 31, 2022 @11:08AM (#32663073)
doesn't this approach run into caching problems?
Re:Poll HN: Do you use SSH certificates (not mere public-key... by chociej on Wednesday August 31, 2022 @03:59PM (#32667554)
With a short TTL I imagine it's quite workable.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @01:57AM (#32672533)
My TTL is lower than most people's SSH certificate validity duration, for sure :)
Re:Poll HN: Do you use SSH certificates (not mere public-key... by egberts1 on Wednesday August 31, 2022 @04:04PM (#32667640)
Yes. Hesiod is safer than DNS TXT once secured by DNSSEC, because I envision mass blocking of DNS TXT in the near future.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @01:56AM (#32672524)
Good luck with that. DNS TXT records are used for a lot of infrastructure right now, from DMARC/SPF/DKIM to DNS-01 validation through LetsEncrypt afaik.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by egberts1 on Friday September 02, 2022 @12:53AM (#32686740)
Yes, and that too will change … again.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by dotwaffle on Thursday September 01, 2022 @06:48PM (#32684386)
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... by iambvk on Wednesday August 31, 2022 @12:43PM (#32664828)
What is the benefit?
Re:Poll HN: Do you use SSH certificates (not mere public-key... by bongobingo1 on Wednesday August 31, 2022 @02:14PM (#32666153)
I think,

1) You don't have to ssh-copy-id to new boxes, which is nice.

2) You can de-auth a key for all machines by changing the DNS record. This would depend on some propagation time but perhaps you can point the resolver at your nameserver directly which would avoid that.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by chociej on Wednesday August 31, 2022 @04:01PM (#32667591)
You could simply choose a short TTL, or your tool could check for e.g. "some-name._sshkeys.whatever.tld" as well as "_revoked.some-name._sshkeys.whatever.tld" to handle revocation instantly
Re:Poll HN: Do you use SSH certificates (not mere public-key... by bongobingo1 on Thursday September 01, 2022 @05:17AM (#32673947)
You could also just stick it behind a https GET and probably skip a bunch of bother.
Re:Poll HN: Do you use SSH certificates (not mere public-key... by xorcist on Friday September 02, 2022 @07:53AM (#32689519)
Now you've just moved your authentication to the SSL PKI.

In that case, use the SSL certs directly. You'd have add support OpenSSH of course, or just convert the certificates to SSH format, but it would be architecturally much simpler.

As to the original question here, the benefit compared to other PKI alternatives (including the SSH PKI in the original question) is that revocation is much easier.

Re:Poll HN: Do you use SSH certificates (not mere public-key... by witcH on Wednesday August 31, 2022 @11:42AM (#32663696)
a fine bit of wizardry, thanks for sharing.