Bizarre and unusual uses of DNS
fosdem.org
fosdem.org
I asked GitLab if they could make use of that, but it hasn't received much attention so far:
* https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/10376
In fact, even if the original domain does support DNSSEC, can a userspace program such as the SSH client actually tell whether the record it just resolved was resolved using a DNSSEC-aware resolver?
There's an "ad" (Authenticated Data) flag in the DNS reply header that a resolver can set to 1 to indicate that it validated the answer, but an MITM can also just set that to 1. The client would have to do its own validation, and ssh(1) doesn't. Therefore, you can only safely use this if you use a DNSSEC-validating resolver, and you trust the resolver (e.g. you administer it yourself), and you have a trusted path between you and it (e.g. it's on your LAN).
Isn’t this a gap in the API? res_query/etc should provide some way to find out if the response is validated or not. That would require either (1) a validating resolver running locally, or (2) a remote validating revolver, accessed over a secure protocol (such as DoT or DoH), which the system administrator has elected to trust. But the system should be able to tell applications, via some API, whether (1) or (2) hold or not
The man pages on my Linux box are too old to mention the trust-ad option, although newer Linux man pages do.
glibc defines a RES_TRUSTAD bit which is equivalent, so applications can choose to request and trust the AD bit even if resolv.conf isn't configured to do so. However, that doesn't appear to be documented anywhere other than the header file and the NEWS file in the glibc distribution. Both RES_TRUSTAD and trust-ad were added in glibc 2.31 (released Feb 2020).
EDIT: I meant for this to be a reply to my sibling comment.
If you're on Ubuntu, you most likely have a local resolver running already.
*: this is the definition of "work" that also means it won't resolve anything if anything is wrong with DNSSEC validation, but if you want to be secure you need it to fail closed.
That way most things will still work even DNSSEC is broken, and apps with higher security requirements can opt-in to "fail if invalid", by passing setting the AD bit on queries, and checking if it is still there on responses.
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.
> 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).
The harder part is what is the client going to do? How will you implement TLS at each end? Your ssh client will want to link against an HTTP library that integrates with the client OS’s x509 PKI. That will be the axiom upon which your trust of the server is founded. OpenSSH’s client might trust their ssh host key because it was served in a connection signed by Let’s Encrypt, and the local copy of libcurl used libssl which found Let’s Encrypt in /etc/ssl/cacerts.pem etc etc.
The hardest part is adding a TLS implementation to the OpenSSH daemon 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:
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.
Yeah then you got at least two more problems. SSL and OCSP
I have bunch of personal servers, and bunch of keys in use, many of the servers are not automated (they're pets, not cattle), so when I rotate keys, it's sometimes a hassle.
Mostly asking just because it'd be fun.
Far better is to use SSH host certificates, then your known_hosts can simply have a @cert-authority * some-cert in it. (See https://www.lorier.net/docs/ssh-ca.html)
The suggested alternative using certificates is a much more standard way that has less ways to create holes in your security.
The command would basically hit "keys.my-domain.example" and return the values of each TXT record. Not sure what could go wrong here, besides if I lose DNS access, I won't have access to the boxes. Probably add some sort of caching as well for that.
But otherwise, it seems to be much more about the security of what goes into "keys.my-domain.example".
It's very easy to just check this for yourself. There are increasing numbers of domains signed every year, because registrars and product companies have baked DNSSEC in as a feature. But the vast majority of zones don't matter: nobody ever looks anything up in them. The figure of merit is how many important zones are signed.
Amusingly for this method to work the resolver must understand DNSSEC. This is because DS records exist solely at the parent side of a delegation. A resolver that is not aware of DNSSEC will look to the child as it would for any other kind of record type.
Unfortunately the user experience for a DNSSEC signature failure is so bad, the only option if you run a large ISP or corporate network is to just use the answer you get anyway.
In fact, I see a lot of people advocating for using centralized resolvers, and not even once have I seen a counter-argument in the form of DNSSEC validation being a problem.
Many recursive servers do validate DNSSEC, but disable it on a per-zone basis when validation failures happen and users start to complain.
tptacek raises an additional good point that DNSSEC does nothing to protect the last mile of a query. It also provides zero confidentiality.
dnscrypt was always a superior implementation, but saw little uptake because people blindly believed the DNSSEC propaganda.
If validation failures were that common, I would think I, working at a domain registrar and authoritative DNS provider, would hear about it. The last mile problem would be solved by DoT/DoH, no?
If anything is a “dead horse”, it’s dnscrypt. Are you claiming that DNSSEC is some sort of industry conspiracy?
I imagine 10 years ago, controls may not have been so good though.
Edit: part of the rationale in some cases, I believe, is to facilitate captive portals for hotel wifi login etc.
“I just really like looking up A records from dig”
Now that I've name names (or a name), how about you? Who uses e164.arpa?
There was also something very weird with VRML files in the early 90s, like favicon but in 3d and shipped over DNS kind of idea. Yeah that got about zero traction also.
News (NNTP) basically _was_ the Internet before HTTP came along, and still exists today, albeit in niche form. I still check News every day.
Your standard seems to be "things that were one popular, but have been replaced." whereas the 90's were full of ideas that literally never took off. Like cuecat https://en.m.wikipedia.org/wiki/CueCat
And don't get me started on the blink tag. That was huge, if anything, overused. That was activly killed (for good reason) because it made most Web pages beyond horrible. For some reason non-computer people weren't happy unless like half the site was blinking all the time. It was beyond terrible.
Frankly the jury is still out on VR headsets (an idea from the 60s that simply won't die.)
Edit: never mind, these are dead now, but they definitely took off in their day.
DNS Toys (946 points) https://news.ycombinator.com/item?id=31704789
Do not put any private information in DNS. It’s not made for it, and many, many systems which work with DNS assume in their design that all DNS data is public.
— https://en.wikipedia.org/wiki/Fallacies_of_distributed_compu...
If you don’t buy this, I guess you should start encrypting all your syscalls too?
Don't forget to encrypt all .socket's, and maybe encrypt everything over at /dev as well.
Or if you insist on it being a virtual stack, how about some DMA engines with transient errors that mix up your packet headers from their payloads?
The network is secure is a fallacy.
https://www.lastweekinaws.com/blog/route-53-amazons-premier-...
It seems like we're missing this kind of stuff lately. Even the April 1st hacks have failed to be interesting on the same level. I wonder what has happened and why.
# netstat $(hostname) 40443
Trying 10.X.X.X
Connected to hostname.foo.bar
Escape character is '^]'
...
# ss -tpln | grep 40443
#
# lsof -i :40443
#
This kind of fun makes you want to punch each individual ITF member as well as people in Kubernetes who decided it'd be cool to implement L7 proxy using DNAT.No, seriously, there is no L7 reverse proxy implemented using kube-proxy mechanism (aforementioned DNAT) - It's L4 proxy for supporting legacy code that doesn't support intelligently querying for endpoints (by SRV record, k8s API, or other service discovery protocol).
It's not even required to use it, Services can be declared to not need it (common example is using service mesh or ingress controller with http)
nginx-ingress will read Service Endpoints through k8s API and resolve connections to specific pod IPs so long as your network is properly deployed.
Of course it's also possible to make it go through serviceIP (which by default is still implemented using DNAT in kube-proxy), but it's not recommended.
NodePorts like the example given earlier exist for dealing with external traffic from hosts unaware of (possibly unroutable) serviceIP and podIP ranges.
I had lots of !FUN! with nginx-ingress, but that's not one of its faults.
$LICENSE_NUMBER.$NAME.$ZIPCODE.example.com
and the reply would indicate the license status.
$ dig TXT current.cvd.clamav.net
...
;; QUESTION SECTION:
;current.cvd.clamav.net. IN TXT
;; ANSWER SECTION:
current.cvd.clamav.net. 972 IN TXT "0.103.8:62:26823:1677366000:1:90:49192:334"TL;DR: HTTPS records are like SRV records without the weight number (but, crucially, including the priority number), and with some extra stuff to make the TLS handshake happier.
Regardless of the standard being finalized there's already some support in the wild. To name a few prominent ones iOS, macOS, Cloudflare, Akamai, and NS1 all support both types.
https://github.com/MikeBishop/dns-alt-svc/blob/main/svcb-imp...
Yes, but the topic was web browsers, which would use the HTTPS record, not the SVCB one.
Fun fact: you can store ~64 kB of data in a single TXT record
It resulted in an extra DNS query for every site being accessed, but because the query is internal and the client caches the result, it didn't add much load but otherwise worked well. Then it was just a matter of automating A record creation.
Last time I checked (several years ago). There source code was still available if you poked around the CMU FTP servers. It was unavailable via http.
Edit, it actually may not have been FTP, it may have been on their AFS volumes.
https://www.softether.org/1-features/1._Ultimate_Powerful_VP...!)
Using DNS to exfiltrate arbitrary data thru firewalls that don’t log DNS requests is handy too.
What do you mean here?
- The One True A(G)I will find your domain automagically and block it and you'll have to pick another one
...In all seriousness several MB of data to a DNS server will get you bitten at least once because someone somewhere is actually doing the job they're paid to do. But it'll probably be an exception.