Multicluster Access Control and Identity Propagation
When traffic is forwarded by a gateway, it typically assumes the identity of that gateway. This default behavior simplifies access control configuration for external traffic. However, in a multi-cluster environment, more granular access control is often needed. Tetrate Service Bridge (TSB) offers the capability to preserve the original identity of a request through gateway hops, allowing for cross-cluster authentication and fine-tuned access control.
This documentation explains how to enable and utilize identity propagation in TSB, enabling scenarios such as propagating consumer identities to remote services, implementing detailed access control between different clusters, and applying access control rules to failover targets.
Before proceeding, it’s assumed that you are familiar with TSB concepts and terminology such as Ingress Gateways, Tier-1 Gateways, and EastWest gateways.
GitOps
Enabling Identity Propagation
By default, service identities are not propagated through gateway hops due to TLS termination at the gateways. TSB achieves identity propagation using an internal WebAssembly (WASM) extension on each gateway hop. This extension validates the client identity and appends it to the requests’ XFCC header, which is then forwarded.
To enable identity propagation:
- Add the
enableHttpMeshInternalIdentityPropagation
key to thexcp
component in theControlPlane
CR or Helm values:
spec:
...
components:
xcp:
centralAuthMode: JWT
configProtection: {}
enableHttpMeshInternalIdentityPropagation: true
kubeSpec:
...
...
- Configure the
imagePullSecret
for your TSB image registry in theControlPlane
CR or Helm values. This is necessary for the WASM extensions to be pulled:
spec:
...
imagePullSecrets:
- name: gcr-secret
components:
xcp:
...
...
Verifying Identity Propagation
After enabling identity propagation, you can verify its status by checking if ENABLE_HTTP_MESH_INTERNAL_IDENTITY_PROPAGATION
is enabled in the XCP edge:
kubectl get deployment edge -n istio-system -o yaml | grep ENABLE_HTTP_MESH_INTERNAL_IDENTITY_PROPAGATION -A 1
Use Case 1: Propagating Service Identities through Tier 1 and Tier 2 Gateways
In this use case, we demonstrate how to propagate service identities across clusters using Tier 1 and Tier 2 gateways.
-
Configure two clusters,
cluster-1
andcluster-2
, sharing the same root of trust. Follow the guide here and use this repo to set up Istio root and intermediate certs. -
In
tier-1
cluster:- Create a dedicated cluster for deploying the
tier-1
gateway. - Configure
networkReachability
to establish reachability betweencluster-1
andtier-1
, and betweentier-1
andcluster-2
.
- Create a dedicated cluster for deploying the
-
In
cluster-1
:- Create a tenant,
tenant-1
, and its namespace, workspace, and groups. - Deploy the
sleep
pod or a similar text client in thetenant-1-ns
.
- Create a tenant,
-
In
cluster-2
:- Create a tenant,
tenant-2
, and its namespace, workspace, and groups. - Deploy the
bookinfo
app intenant-2-ns
along with aningress gateway
.
- Create a tenant,
-
Verify that a request from the
sleep
pod incluster-1
can reach a service in thebookinfo
app incluster-2
via the Tier 1 gateway. -
Implement access control by denying communications between workspaces or tenants at different levels using appropriate rules and settings.
Use Case 2: Propagating Service Identities in EastWest Gateway Failover
In this use case, we focus on propagating source identities during service failover in an EastWest gateway setup.
-
In
cluster-1
, create namespaces for theClient
andBookinfo
tenants. Deploy thebookinfo
andbookinfo-gateway
services in thebookinfo-ns
. -
In
cluster-2
, create thebookinfo-ns
for theBookinfo
tenant. Deploy thebookinfo
andbookinfo-gateway
services in thebookinfo-ns
. -
Configure
bookinfo-ns
/bookinfo-gateway
for EastWest failover usingdefaultEastWestGatewaySettings
. -
Implement
allow
anddeny
rules to control communications between different tenants and services. -
Verify that clients in the
Client
tenant can access the appropriate services while enforcing access control. -
Observe the behavior of identity propagation during service failover scenarios.
Troubleshooting
-
Ensure that
enableHttpMeshInternalIdentityPropagation
is correctly set in thexcp
component of theControlPlane
CR. -
Verify that the
imagePullSecret
is configured in theControlPlane
CR to allow the necessary WASM extensions to be pulled. -
Confirm that the required WASM extensions have been successfully installed in the Istio environment.
-
Ensure that the XFCC header propagation is functioning correctly.
-
If you encounter issues, consult the Troubleshooting section at the end of this page for further guidance.