Using linkerd2 for mTLS only with DNS service discovery (or custom service discovery) #7487
Replies: 2 comments 1 reply
-
The short answer is: no, not without code changes.
The destination controller is required to communicate the expected identity of the target pod to clients. I.e. if the gateway is connecting to pod 2, how does the proxy discover what the expected identity is? The destination controller is responsible for providing this information.
You should be able to configure linkerd to treat all traffic as opaque so that HTTP detection is not performed. The destination controller is required to provide these hints, though.
You can configure proxies to require identity on inbound traffic, though there are a number of caveats here--especially with regard to Kubernetes liveness/readiness probes, which cannot be secured. On the outbound side, mtls requires knowing the identity of the target pod. So, if you're communicating with an unmeshed pod, there is no identity. So, I guess the question is: can you configure proxies to fail to communicate with unmeshed endpoints? This would require code changes but is a reasonable feature request. |
Beta Was this translation helpful? Give feedback.
-
Would it be still doing mTLS in opaque mode?
by identity of the target pod, are you referring to the public leaf certificate target pod has? Here's what I had in mind: pod1 talking to pod2, and they are not necessarily in the same mesh but they both share the same PKI / anchor certificate. So when pod1 starts TLS handshake against pod2, it verifies the legitimacy of pod2 based on the TLS anchor certificate it has. The same way browsers verifies authenticity of a website using public CA's they trust. pod1 would also verify that the certificate pod2 uses covers the server name (target service fqdn). What am I missing? |
Beta Was this translation helpful? Give feedback.
-
Our simplified routing infrastructure is pod1 -> gateway -> pod2. All actors can potentially be in different k8s clusters and cloud regions. Connectivity between them is assumed.
I'd like to leverage Linkerd to provide end to end encryption and workload identity. Thus, I have following questions:
With these done, the above request path would become:
pod1 | linkerd-proxy -> gateway -> linkerd-proxy | pod2
The gateway would require TLS client certificate and linkder-proxy would provide it. Gateway will authenticate the cert because of the shared anchor certificate.
Similarly when gateway connects to pod2's linkerd-proxy, linkerd-proxy would require TLS client certificate and gateway would provide it.
Beta Was this translation helpful? Give feedback.
All reactions