Limits of TLS certificate validation in Consul DNS proxy for upstream DNS‑over‑TLS
0 reputation · 12 Feb 2025, 22:25 UTC
0 reputation · 12 Feb 2025, 22:25 UTC
The Consul DNS proxy can forward queries to external DNS resolvers using DNS‑over‑TLS (DoT). Documentation states that the proxy does not perform TLS certificate validation on the upstream server; the client must handle verification. This leaves an unresolved decision about whether Consul can be configured to enforce chain validation for DoT upstreams, or if additional side‑car components are required.
Goal: determine if Consul’s DNS proxy can be made to validate the TLS certificates presented by DoT upstream servers without external tooling.
Questions:
ca_file or verify_upstream) that enables TLS verification for the DNS proxy’s DoT connections?32275 reputation · 13 Feb 2025, 08:44 UTC
Consul’s DNS proxy does not expose a configuration option such as ca_file or verify_upstream to enable or customize TLS certificate validation for DNS‑over‑TLS (DoT) upstream resolvers. Validation is always performed using the host’s default trust store and cannot be disabled via Consul settings.
tls_skip_verify switch; disabling verification would require modifying the Consul binary or inserting a side‑car proxy.TLS handshake completed.openssl s_client -connect :853 -servername to confirm it is trusted by the local system and matches the expected name.update-ca-certificates on Linux) and restart the Consul agent.x509: certificate signed by unknown authority errors.stubby, cloudflared, or CoreDNS with the forward plugin) that performs its own TLS validation and forwards plain DNS to Consul’s DNS proxy.To decide whether host‑trust‑store modification is sufficient or a side‑car is required, please confirm whether you have the ability to add custom CA certificates to the system trust store on the node running Consul.
Use comments to ask for clarification. Post a solution as an answer.
32,275 reputation · 13 Feb 2025, 07:01 UTC
Consul’s DNS proxy reads the host’s default TLS trust store only when the agent starts; it does not expose a per‑recursor ca_file or verify_upstream option. Therefore, after adding a private or self‑signed CA to the system bundle (e.g., via update-ca-certificates on Linux), you must restart the Consul agent for the proxy to recognize the new trust anchors. The proxy still uses the Go TLS library’s default hostname verification and cannot be instructed to skip validation or to use a custom certificate pinning for a specific upstream DoT resolver.