News for hackers. Stuff that matters.
Re:Bizarre and Unusual Uses of DNS by gorgoiler on Sunday February 26, 2023 @01:26AM (#34943577)
This is fun but a more practical solution would be for “ssh host” to GET the host’s public key from https://host/.well-known/.

The OpenSSH daemon could host it for you if you could fit a tiny, vuln free httpd inside it — not an enormously onerous task given that the codebase already includes the implementation of a robust TCP daemon. Add ACME support and you’ve moved the TOFU MITM attack from being possible on every-new-client-connection to also having to coincide with the once-every-X-days for the HTTPS certificate renewal.

It’s a lot of new functionality which probably isn’t cool for the OpenSSH codebase, but it’s a pragmatic solution to plugging the gap between mankind’s universally deployed PKI and ssh’s ephemeral peer-to-peer verification.

Re:Bizarre and Unusual Uses of DNS by CGamesPlay on Sunday February 26, 2023 @03:12AM (#34943939)
Doesn't SSH already support using TLS keys for authentication? So, we can skip the whole HTTPS part of the equation.
Re:Bizarre and Unusual Uses of DNS by t0mas88 on Sunday February 26, 2023 @03:52AM (#34944091)
Jup, it does. And that was my first thought reading this as well.
Re:Bizarre and Unusual Uses of DNS by jleahy on Sunday February 26, 2023 @04:02AM (#34944127)
No it has its own certificate system, it’s not TLS and it’s not even X.509.
Re:Bizarre and Unusual Uses of DNS by growse on Sunday February 26, 2023 @05:22AM (#34944465)
Not being x.509 is arguably a good thing. :)
Re:Bizarre and Unusual Uses of DNS by AndyMcConachie on Sunday February 26, 2023 @04:02AM (#34944126)
Making SSH authentication dependent on HTTPS seems like a really bad idea.
Re:Bizarre and Unusual Uses of DNS by kedihacker on Sunday February 26, 2023 @04:24AM (#34944212)
Making ssh authentication dependent on honesty seems like a really bad idea.
Re:Bizarre and Unusual Uses of DNS by est on Sunday February 26, 2023 @08:38AM (#34945433)
However I'd wish the reverse is true, SSH via TLS connections, so I don't need to open another 22 port, and make my SSH hidden behind Cloudflare or something.
Re:Bizarre and Unusual Uses of DNS by chrisandchris on Sunday February 26, 2023 @04:43AM (#34944306)
So one needs to run an HTTP-Server for a host that only has SSH otherwise?

> but it's a pragmatic ...

I think we have different views of the word pragmatic if your pragmatic solution covers including a HTTP server in OpenSSH for serving a single (!) file while the other solution depends on something you most probably already use to connect to the server (DNS).

Re:Bizarre and Unusual Uses of DNS by gorgoiler on Sunday February 26, 2023 @05:36AM (#34944526)
Hah, I’m surprised you zoomed in on that part. All you have to do for the protocol is blurt out “HTTP/1.1 200 OK\n\nssh-rsa AAAAf00fcafe…=“ on port 443 instead of “SSH-2.0-OpenSSH_xyz EtcEtc” on port 22. I wouldn’t (and didn’t) suggest you include code to respond with the contents of files, nor should you even bother parsing the request*.

The harder parts are what is the client going to do, and how will you implement TLS at each end? For the client, you’ll want to link against an HTTP library that integrates with the client OS’s x509 PKI as that will be the axiom upon which your trust of the server is founded. Their host key was served in a connection signed by Let’s Encrypt, and you’ve got Let’s Encrypt in /etc/ssl/cacerts.pem or whatever.

The hardest part is adding a TLS implementation to OpenSSH and the crazy part is having it support ACME so it can fetch its own certificates**. There is precedent for this though — caddy includes support for negotiating issuance and renewal of SSL certificates via ACME:

https://caddyserver.com/

Adding a new feature like this comes with the responsibility of supporting it in production and fixing bugs (in this case, dealing with weird missing features) for the remaining lifetime of the product. It’s not something to be done as lightly as an HN comment, by any means. There are a lot of sensible reasons to use DNS to bootstrap trust but as others have pointed out it is a little naive to think that DNSSEC has anything like the level of deployment that HTTPS has achieved since ACME and Lets Encrypt showed up. I contend that it’s that aspect which makes my solution indeed a more practical method — pragmatic, even — of bootstrapping trust over The Internet in 2023.

* Yes, this will mean you cannot support clients that demand their content be encoded with xzip in ylang with zspace. We’re not writing a real httpd here, remember.

** If it’s using ACME HTTP then that makes the simplistic httpd a bit more complicated, of course. Now you have to blurt two responses instead of one.

Re:Bizarre and Unusual Uses of DNS by nousermane on Sunday February 26, 2023 @05:36AM (#34944528)
That's clever - let PKI (via letsencrypt or other ACME) deal with trust, by getting a certificate there.

It's a shame that OpenSSH can't use those directly. "ssh-keygen -i" can import individual keys, but alas - SSH certificate signatures are generated differently from X.509 certs.

Re:Bizarre and Unusual Uses of DNS by est on Sunday February 26, 2023 @08:35AM (#34945415)
> not an enormously onerous task given that the codebase already includes the implementation of a robust TCP daemon.

Yeah then you got at least two more problems. SSL and OCSP