\

TLS certificates for internal services done right

68 points - today at 2:57 PM

Source
  • EvanAnderson

    today at 3:47 PM

    The relative proximity of the words "done right" and "split-horizon DNS" makes my insides hurt a little bit.

    Use DNS validation to allow these internal services to pull ACME certs. There's so much less headache, long-term.

    Split-horizon DNS (and the tedious make-work it can create when you start needing to mirror public-accessibly records in the private DNS) has always been something to aspire to move away from in my experience.

      • stock_toaster

        today at 5:57 PM

        Once dns-persist-01 becomes available/usable[1], it should make dns validation even easier.

        [1]: https://letsencrypt.org/2026/02/18/dns-persist-01

        • bombcar

          today at 5:57 PM

          Just LE a wild card cert and slap it everywhere.

      • samgranieri

        today at 5:28 PM

        Split horizon DNS is not something I'm willing to do. I'll just rock out with .internal or .home.arpa, have step-ca and bind communicate to each other, either in step-issuer in kube or maybe even rfc2136 if i feel like a bit of the dns-01 strategy is in order. I slap the internal ca root certs everywhere, and keep my home infra out of the crt.sh logs.

        I get it, I could just do *.mydomain.com and slap that wildcard cert everywhere, but it's still in the public logs..

        • raffraffraff

          today at 4:27 PM

          Hmm. I don't really care enough about leaking home network host names because they are all super generic names like 'router', 'laptop', 'tv', 'nas'. So I use my public zone on cloudflare. I just use internal ip addresses (eg: nas.example.com = 10.1.2.3) on the public zone and DNS01 challenge for let's encrypt. Anyone can resolve the ip for any of my hosts, but obviously you'd need to be on the wireguard vpn to hit them.

          This means that I can always use public DNS servers like 1.1.1.1, 8.8.8.8, nextDNS etc

          This is not "done right" by any stretch but it's extremely low effort to set up and has never once failed me, unlike countless complex meshy things.

            • graton

              today at 5:49 PM

              I do the same thing. I'm not worried about them seeing my FQDNs.

              I use the form of hostname.int.example.com for everything inside my home network. None of which is accessible to the outside world. I use LetsEncrypt with DNS validation to get the certificates.

              • icedchai

                today at 5:44 PM

                This is similar to what I do, except I have my own authoritative DNS servers instead of Cloudflare.

                I'd prefer this over split DNS, any day.

                • luckman212

                  today at 4:32 PM

                  Fair, but what about names that are specific enough to give an attacker a clue to a potential attack surface, like "authelia.example.com" - now they know you've likely got an Authelia setup, and can start digging for exploitable CVEs etc. I'm in the process of removing all my individual certs and replacing with a wildcard cert served by Traefik. Is that a bad idea?

                    • bbkane

                      today at 4:33 PM

                      Can they dig for exploitable CVEs if they're not on the Wireguard network? It is a clue to your infrastructure, but I personally think the simplicity is worth it.

                      • icedchai

                        today at 5:46 PM

                        Do the names resolve to publicly routeable IPs? If not, I wouldn't worry about it.

                        • nijave

                          today at 5:01 PM

                          My IaC is on public GitHub. They could do a network scan to find software then fingerprint to find version anyway.

                          Removing attack surface is better than trying to hide it.

                  • patrakov

                    today at 3:43 PM

                    My preferred procedure is to use DNS-01 validation and have no publicly accessible "A" or "AAAA" record for internal services.

                    Or even a more extreme example: https://crt.sh/?id=27555237869 (sorry for any possible crt.sh downtime) - the domain name in question never existed in public or private DNS by itself. It is used only for a WPA3-Enterprise network, as the CN that WiFi clients expect to be present in the RADIUS server certificate, but never resolve. In the public DNS, only the "_acme-challenge" TXT record exists.

                      • otabdeveloper4

                        today at 4:21 PM

                        Sounds bonkers. Why not make an overlay LAN and host your own DNS server in 10.0.0.0/8?

                    • boscillator

                      today at 4:02 PM

                      The real answer here is that configuring HTTPS clients to trust a self-signed cert (or signed by an internal CA) shouldn't be as difficult as it is. I find it extremely annoying that every programming language has it's own idea of where certificates should live instead of just checking the os trust store.

                        • spacebanana7

                          today at 4:43 PM

                          [dead]

                      • wrxd

                        today at 3:33 PM

                        I use the acme dns-1 challenge on my public domain. That gives you certificates you can use as you see fit, without needing to expose anything else to the public internet.

                        I also use Tailscale so I configure my DNS to use my Tailscale IP addresses. If you don’t want to expose them on a public DNS server you can add them only to an internal DNS server.

                      • sandeepkd

                        today at 5:12 PM

                        I was under impression that I understand networking and DNS resolution. It was really hard to follow, the OP did worked hard, just not sure what exact problem was being solved with the proposed solution that isnt already been solved.

                        • xorcist

                          today at 4:04 PM

                          This is crazy. If you have a home network with a few internal services, or some sort of network where you don't control the endpoints, just use DNS validation. That's why it exists.

                          But on hosts you control, you should absolutely provision them with an identity and join the local CA. You're going to need it for a multitude of other reasons.

                            • maqnius

                              today at 5:00 PM

                              Can you elaborate why one shouldn't use DNS validation for hosts you control in general?

                                • xorcist

                                  today at 5:30 PM

                                  That's not it. If you have an internal network, where every host is provisioned by you, you already control identity.

                                  In that case there's no need to validate anything as names, dns records, certificates and anything else should already be in place.

                                    • llama052

                                      today at 5:41 PM

                                      There's certainly something to be said for ease of use and not having to ensure you push trusted certs to every device that touches your internal network.

                                      Unless you enjoy that sort of thing.

                          • thomashabets2

                            today at 3:54 PM

                            Personally, I hate split horizon DNS. I prefer the "BeyondCorp" model. I MUCH prefer putting an mTLS cert in my trusted devices over relying on VPNs in same devices. I've yet to see a "clever" DNS setup not cause annoyances.

                            Specifically grafana is nice to be able to see on the phone, and split horizon DNS and corp VPN is a hassle, to say the least, on phones.

                            I bet you can do it with HA-Proxy, but I use https://github.com/ThomasHabets/sni-router

                            • jmbwell

                              today at 5:01 PM

                              I don’t know much in this space, but I find myself wishing there was a dead simple self hosted CA solution and also that trust on first use (à la ssh) was A Thing for self-managed root certs in client implementations. TOFU is such an elegant, good-enough solution for these use cases. Fixed deployment is always still an option, but in this day and age it feels so much like we are unnecessarily still dealing with solved problems

                                • nijave

                                  today at 5:04 PM

                                  On k8s, there's cert-manager but also you need k8s...

                                  Most browsers support trust on first use for leaf certs

                                    • notTooFarGone

                                      today at 5:50 PM

                                      Firefox now started that you can't even go on the page on some occasions.

                                      Using a browser in an air gapped environment is so much more pain than it should be.

                                      • jmbwell

                                        today at 5:08 PM

                                        I guess I mean treat it as a clear first class feature. Right now most browsers treat it as an arcane error. I’m thinking more “This is the first time you’re connecting to this site. Do you trust it?”

                                        And later if something changes, then they can do the whole DOING SOMETHING NASTY! thing, which is effectively the experience today

                                • pizzalife

                                  today at 3:19 PM

                                  I don't agree that tunneling everything through some external facing proxy is "TLS certificates for internal services done right".

                                    • nijave

                                      today at 3:24 PM

                                      Arguably it's 1/2. You can put public certs on proxy then give proxy private CA to backend services. Then you don't need public certs for all the private stuff nor need to trust the private CA on all your devices.

                                  • jabart

                                    today at 5:28 PM

                                    A Github Action running acme.sh that pushes certs to S3 solves the split dns issue for hosts, which can cause all sorts of weirdness after a while. You can then grab a cert on a schedule and even make them wildcard if you want. Then you will get NXDOMAIN if you are not on the VPN so ideally no public traffic.

                                      • llama052

                                        today at 5:40 PM

                                        DNS-01 validation is way less work than that in my experience.

                                    • raquuk

                                      today at 3:54 PM

                                      I am looking forward to finally using DNS-PERSIST-01 for validation. No more dynamic DNS updates, DNS credentials or forwarding necessary.

                                      • gmuslera

                                        today at 5:16 PM

                                        "Right" without use case can be wrong. And by use case I include scale. For a small team, few machines, some in-place infrastructure may worth it. Smaller than that may be overkill, bigger than that may not be enough, or end being cumbersome, insecure or not work for everyone.

                                        • Eduard

                                          today at 5:38 PM

                                          to help with passive reconnaissance, here are tuxnet.dev's SSL certificates and associated subdomains:

                                          https://www.certkit.io/tools/ct-logs/?query=tuxnet.dev

                                          • aliasxneo

                                            today at 5:01 PM

                                            I wonder if the author realizes that getting public certificates results in them being recorded in CT logs.

                                            • cobertos

                                              today at 3:38 PM

                                              Why not just map the domain to an internal IP and call it a day? Then the only way it can be accessed is through a VPN. Then use a wildcard so none of leaks into cert transparency logs

                                                • throw0101d

                                                  today at 3:48 PM

                                                  > Then use a wildcard so none of leaks into cert transparency logs

                                                  You now also have to build infrastructure to distribute the wildcard from (presumably) central place where you generate it to all the different places where it is desired.

                                                  And hope the wildcard's private key does not leak from one of myriad of places it now lives.

                                                    • AlexanderYamanu

                                                      today at 5:34 PM

                                                      well, I configure my services te request their own wildcard certs from a caching proxy acme to letsencrypt. Easy peasy.

                                                      • cobertos

                                                        today at 4:16 PM

                                                        I have a few Traefik instances that request wildcards independently of each other. Each with the same config, per server.

                                                        Leaking is an issue but we're talking about internal services too.

                                                • ramblurr

                                                  today at 4:07 PM

                                                  > TLS certificates for internal services* done right

                                                  * "internal services" = on a single server that is publicly routable

                                                  • mrl5

                                                    today at 2:57 PM

                                                    I've documented how to securely set up TLS certificates for internal services without creating TLS issues for http clients downstream. All thanks to split-horizon DNS, WAF and ACME protocol. All for free!

                                                      • rootnod3

                                                        today at 4:00 PM

                                                        Uhm....source?

                                                          • cwillu

                                                            today at 4:14 PM

                                                            He's the submitter

                                                    • Hamuko

                                                      today at 3:35 PM

                                                      I use a registered domain with DNS validation and then CNAMEs that I resolve locally. Basically:

                                                        1. Register a domain ("server.com") and put it on some public DNS that can do DNS validation with acme.sh.
                                                        2. Use DNS validation to get a certificate on your domain from Let's Encrypt. You can just grab a wildcard one ("*.server.com").
                                                        3. CNAME all of your services on a public DNS to an internal address ("email.server.com" → "server.internal", "plex.server.com" → "server.internal").
                                                        4. Resolve your internal address on a local DNS server with an A record ("server.internal" → 192.168.0.123). This can often just be done on your router.
                                                      
                                                      Since you use DNS validation, you just API keys for your public DNS service that acme.sh can use. No need to have any VPN network interfaces for getting your certificate. Your wildcard certificate also doesn't leak any details about your services.

                                                      • spydum

                                                        today at 3:34 PM

                                                        this is all fine and good, if you are okay broadcasting your internal hostnames. I suppose it's a trade off some might make.

                                                          • CartwheelLinux

                                                            today at 3:38 PM

                                                            There's one way around that which is requesting a wildcard cert, but then that has its own rammifications

                                                              • gh02t

                                                                today at 5:48 PM

                                                                There's really two ways, the other is to manage your own CA. But it seems like every browser/piece of software/etc out there is hell bent on making that as difficult as possible. It'd also be nice if it was easier to scope a certificate authority to a specific domain, but support for that is pretty patchy which is functionally the same as no support at all. And that's not to mention software that ignores the system certificate store. Or how tedious and nonstandardized it can be to get a trusted certificate store in a Docker container in cases where you have services that need to trust each other. Or how annoying it is to install your own trusted CA on devices (though, step-cli does help a lot at least on normal computers... phones however...). On and on and on, the barriers to what should be the obvious solution are extremely high.

                                                        • AtNightWeCode

                                                          today at 4:56 PM

                                                          Don't do this. Public certs are for public services.

                                                          • nijave

                                                            today at 3:13 PM

                                                            [dead]