Service Mesh mTLS and Traffic Policy

Service mesh mTLS authenticates peers and protects transport between participating workloads. Traffic policy chooses how eligible requests reach destinations. Authorization decides which authenticated callers may perform an operation. Keep all three visible when diagnosing a failed request or preparing a rollout.

Istio is the worked example. Its sidecar and ambient modes have different enforcement paths and supported policy details, so first identify the installed version, data-plane mode, and actual traffic path. A YAML file describes intent; effective proxy behavior supplies the operational evidence.

TL;DR

Quick Example

This hypothetical sidecar-mode Istio configuration targets only wiki-demo. It requires inbound mTLS and describes a 90/10 service split. It assumes an existing service, enrolled workloads, matching version labels, and compatible Istio APIs. The three documents were parsed and their local references/weights checked; they were not applied to a cluster.

The expected structural result is STRICT transport policy plus two declared subsets whose weights sum to 100. It doesn't show that the candidate receives real traffic, or that any application authorization rule exists. Review effective inherited policies and auto-mTLS behavior in the installed environment before considering deployment.

Core Concepts

Identity and certificates

Mesh workload certificates connect a cryptographic identity to the workload under the mesh’s trust system. Certificate issuance, renewal, trust roots, and accepted peer identity all matter. Encryption alone does not tell an application which business record a caller may read. Istio security

Authentication and authorization

PeerAuthentication controls accepted transport authentication. Istio’s authorization policies are a separate mechanism; workloads without applicable authorization policies allow requests by default under the documented model. An mTLS requirement is therefore not an allowlist of approved operations. Authentication and authorization concepts

Routing and destination configuration

The example’s VirtualService chooses named subsets declared by DestinationRule. The subset labels must match real endpoints. Weighted routing is separate from changing replica counts, and observed proportions require a meaningful sample. Traffic shifting

Diagnose from the failed boundary

Use the smallest observation that can distinguish competing explanations. This proposed sequence avoids weakening transport protection merely to make an error disappear.

Correlate one request across caller, proxy, destination, and application where permitted. Avoid placing credentials, full sensitive payloads, or unnecessary identity details in broadly accessible logs. Capture the effective policy/configuration revision with the observation so a later reconciliation does not silently change the evidence.

Test one allowed identity, one unintended identity, and a non-mesh/plaintext client in an approved isolated environment. Record the expected result for each. A denied request only demonstrates the boundary you actually exercised; it does not certify all possible routes into the workload.

Shift traffic with a stopping rule

Choose a candidate that is independently identifiable in telemetry. Define error, latency, saturation, and application-correctness conditions before increasing its weight. Include dependencies shared by both versions; a healthy candidate can still increase downstream load.

Long-lived connections, request mix, client behavior, retries, and limited sample sizes can make observed distribution differ from a simple ratio. Count at a clearly defined point and distinguish original operations from attempts. Do not use an exact ten-request split as the sole acceptance criterion.

Prepare the prior known-good route and determine whether reversing traffic is sufficient. A candidate that writes an incompatible database shape may require a data-compatibility strategy even after routing changes back. Stop the rollout when the chosen conditions fail and retain the evidence needed to explain the failure.

Certificate lifecycle deserves its own exercise. Verify that the intended trust and identity continue across renewal and that monitoring identifies a renewal problem early enough for intervention. Neither the local YAML check nor a successful single handshake establishes that ongoing behavior.

Best Practices

Review effective scope

Trace mesh, namespace, and workload configuration together. Confirm the target’s data-plane mode and supported semantics before translating sidecar examples to ambient deployments.

Keep authorization tests separate

Record caller identity, operation, destination and expected allow/deny result. Include application object authorization where the mesh cannot make that business decision.

Observe both sides of a rollout

Compare stable and candidate behavior over the same window. Preserve a rollback route and verify persisted-data compatibility.

Common Mistakes

Bad: Assuming every encrypted caller is authorized.

Correct: Define and test authorization separately from transport authentication.

Bad: Changing TLS to permissive whenever traffic fails.

Correct: Identify the failed handshake, identity, routing or authorization boundary and repair that cause.

Bad: Declaring a 90/10 rollout correct after ten requests.

Correct: Use an adequate observed sample and examine connection, retry, endpoint and request-mix effects.

FAQ

Does mTLS replace application authorization?

No. It supplies transport protection and peer authentication. Resource and business-operation access still require the appropriate authorization layer.

Does the example create its workloads?

No. It assumes an existing service and version-labeled, mesh-enrolled endpoints. Structural checks cannot prove their presence.

Can routing rollback repair every candidate failure?

No. Persistent data, external side effects and compatibility changes may survive the route reversal. Plan those boundaries before shifting traffic.

Related Topics

References