11. Service Mesh Integration
11. Service Mesh Integration
← Previous: Machine Identity | Index | Next: Federation →
11.1 Linkerd Identity Model
11.1.1 Why Linkerd
| Criterion | Linkerd Advantage |
|---|---|
| Lightweight | Rust-based proxy, minimal resource overhead |
| Automatic mTLS | Zero-config encryption |
| Simple identity | ServiceAccount-based, no custom CRDs |
| SPIRE compatible | Optional SPIRE integration |
11.1.2 Identity Structure
Linkerd uses Kubernetes ServiceAccounts for identity:
Example identities:
| ServiceAccount | Namespace | Linkerd Identity |
|---|---|---|
| api | payments | api.payments.serviceaccount.identity.linkerd.cluster.local |
| frontend | web | frontend.web.serviceaccount.identity.linkerd.cluster.local |
| prometheus | monitoring | prometheus.monitoring.serviceaccount.identity.linkerd.cluster.local |
11.1.3 Trust Anchor
Linkerd uses a trust anchor (root CA) for the mesh:
11.2 mTLS Configuration
11.2.1 Automatic mTLS
Linkerd automatically enables mTLS for all meshed traffic:
| Traffic Type | Encryption | Identity Verified |
|---|---|---|
| Pod to Pod (both meshed) | mTLS | Yes |
| Pod to Pod (one not meshed) | Plaintext | No |
| Ingress to Pod | TLS termination | Ingress only |
| Pod to external | Plaintext (or TLS) | No |
11.2.2 Injection
Enable mesh injection per namespace or pod:
11.2.3 mTLS Verification
Check mTLS status:
11.2.4 mTLS Flow
11.3 Authorization Policies
11.3.1 Server Resource
Define what ports a workload accepts traffic on:
11.3.2 ServerAuthorization
Define who can access a Server:
11.3.3 Default Deny
Enable default deny for strict authorization:
11.3.4 Authorization Flow
11.4 HTTPRoute Authorization
11.4.1 Fine-Grained HTTP Authorization
For HTTP-level authorization:
11.4.2 MeshTLSAuthentication
11.5 SPIRE Integration
11.5.1 Why Integrate SPIRE with Linkerd
| Benefit | Description |
|---|---|
| Unified identity | Same SPIFFE ID across mesh and Vault |
| Stronger attestation | Pod-level attestation |
| Federation ready | SPIFFE federation for multi-cluster |
11.5.2 Integration Architecture
11.5.3 Configuration
11.6 Observability
11.6.1 Identity Metrics
Linkerd exports identity-aware metrics:
| Metric | Description |
|---|---|
request_total{client_id, server_id} | Requests by identity |
response_latency_ms{client_id, server_id} | Latency by identity |
tcp_connections{client_id, server_id} | Connections by identity |
11.6.2 Grafana Dashboards
11.6.3 Distributed Tracing
Linkerd propagates trace context:
11.7 Ingress Integration
11.7.1 Ingress Identity
Ingress controllers need mesh identity:
11.7.2 External Traffic Policy
11.8 Multi-Cluster Mesh
11.8.1 Cross-Cluster Identity
For multi-cluster deployments:
11.8.2 Cross-Cluster Authorization
11.9 Security Considerations
11.9.1 Attack Surface
| Attack | Mitigation |
|---|---|
| Traffic interception | mTLS prevents eavesdropping |
| Identity spoofing | Certificate verification |
| Unauthorized access | ServerAuthorization policies |
| Lateral movement | Default deny + explicit allow |
11.9.2 Certificate Security
| Concern | Mitigation |
|---|---|
| Root CA compromise | HSM-backed or cert-manager managed |
| Certificate theft | Short TTL (24h default) |
| Weak ciphers | TLS 1.3 preferred, 1.2 minimum |
11.9.3 Policy Bypass
| Scenario | Prevention |
|---|---|
| Direct pod IP access | NetworkPolicy blocks non-mesh |
| Injection disabled | Admission webhook enforcement |
| Unauthenticated override | Audit and alert on bypass |
11.10 Compliance Mapping
11.10.1 Invariant Enforcement
| Invariant | Service Mesh Implementation |
|---|---|
| INV-1 | ServiceAccount-based identity |
| INV-6 | mTLS for all mesh traffic |
| INV-7 | Namespace-scoped policies |
| INV-10 | Identity in all metrics and traces |
11.10.2 Verification
Document Navigation
| Previous | Index | Next |
|---|---|---|
| ← 10. Machine Identity | Table of Contents | 12. Federation → |
End of Section 11