AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Identity binding (previously called trust domain) - workload identity federation

Open shashankbarsin opened this issue 2 years ago • 22 comments

Identity binding feature allows users to map an Entra user-assigned managed identity to any number of cluster or subject (namespace, service account) combinations to address the current 20 FIC limitation per identity. For each binding, user provides the cluster ARM Id to specify which managed identities are usable via workload identity on any cluster. Post that, they’d then create a ClusterRole and ClusterRoleBinding within the cluster specifying the service accounts that are allowed to use the managed identity.

Tentative UX:

  1. Cluster operator creates identity binding resource
az aks identity-binding create \ 
  --name <binding-name> \  
  --resource-group <group-name> \  
  --managed-identity-resource-id <identity-resource-id> \ 
  --cluster-name <cluster name>

This step sets up an issuer per each identity binding and the output of the above step surfaces the identity-binding-issuer needed for step 3. AKS maintains a unique identity binding issuer per each managed identity. So even if identity binding is created for same managed identity mapped to a different cluster, the same identity binding issuer is used for the same allowing for the same issuer value under FIC (from step 3) to be used across multiple clusters

  1. User creates a cluster role and role binding identifying the namespace and service account that can use the managed identity
apiVersion: rbac.authorization.k8s.io/v1 
kind: ClusterRole 
metadata: 
  name: allow-clientid-1 
rules: 
- verbs: ["use-managed-identity"] 
  apiGroups: ["cid.wi.aks.azure.com"] 
  resources: ["<client-id-1>"] 
--- 
apiVersion: rbac.authorization.k8s.io/v1 
kind: ClusterRoleBinding 
metadata: 
  name: allow-clientid-1-binding 
roleRef: 
  apiGroup: rbac.authorization.k8s.io 
  kind: ClusterRole 
  name: allow-clientid-1 
subjects: 
- kind: ServiceAccount 
  name: mysa 
  namespace: ns 
  1. User creates FIC mapping the managed identity and identity binding.
az identity federated-credential create \ 
    --name ${FEDERATED_IDENTITY_CREDENTIAL_NAME} \ 
    --identity-name "${USER_ASSIGNED_IDENTITY_NAME}" \ 
    --resource-group "${RESOURCE_GROUP}" \ 
    --issuer "<identity_binding_issuer>" \ 
    --subject "<ARM-ID-managed-identity>"\ 
    --audience api://AzureADTokenExchange 

Tentative ETA for preview June 2025

shashankbarsin avatar Nov 15 '24 16:11 shashankbarsin

@shashankbarsin Will this resolve these issues? https://github.com/Azure/AKS/issues/3982 https://github.com/Azure/AKS/issues/2861

colincmac avatar Nov 26 '24 17:11 colincmac

For the ETA for a preview which type of preview is that expected to be?

OmnipotentOwl avatar Nov 30 '24 02:11 OmnipotentOwl

@colincmac - It'll address #3982. #2861 will be addressed by structured authentication integration, that's currently being planned and will share an update on that soon too..

@OmnipotentOwl - Most likely a private preview to begin with. Closer to release, we will share a form where you can share your subscriptionId and we will enable the feature flag.

shashankbarsin avatar Dec 05 '24 22:12 shashankbarsin

All the Subjects in a trust domain will have the same prefix, will it also share the Issuer?

Richard87 avatar Dec 10 '24 08:12 Richard87

reopening this issue as it was wrongly closed as stale by the bot. this feature is still on the roadmap and still on track for a preview in CY2025H1.

shashankbarsin avatar Jan 08 '25 07:01 shashankbarsin

@Richard87 - this feature (trust domain) would result in the same issuer URL for the trust domain and wouldn't impact the subject part, which remains a tuple of <namespace, service-account>. For flexibility on declaration of subjects, we have a different feature on the roadmap to provide the ability to declare the subject using prefix patterns - https://github.com/Azure/AKS/issues/4688

shashankbarsin avatar Jan 08 '25 07:01 shashankbarsin

@shashankbarsin will this feature be dependent on Fleet Manager - ie will the clusters have to be a part of a Fleet Manager fleet to be a part of the trust domain?

ChrisF987-coles avatar Jan 10 '25 00:01 ChrisF987-coles

@ChrisF987-coles - no it won't be dependent on Fleet Manager

shashankbarsin avatar Feb 28 '25 21:02 shashankbarsin

Hi @shashankbarsin!

can you confirm the CY2025H1 ETA is still a valid date for the preview?

I'm very interested to try this feature to deploy, and authenticate, at scale an app on multiple AKS clusters

Thanks!

fsforza avatar Apr 04 '25 14:04 fsforza

Updated the issue description to capture the tentative UX planned for the feature and to provide a more granular timeline. Still tracking for CY2025H1 and looking at June 2025 for preview.

shashankbarsin avatar Apr 07 '25 19:04 shashankbarsin

Hi @shashankbarsin, is it still on track to be delivered in June, have a use case dependent on this feature.

Sathpal-Singh avatar May 20 '25 05:05 Sathpal-Singh

Hi! I updated my az cli, but the command az aks identity-binding create is not recognized by it. Are further steps required to try out this in preview?

msci-horvrud avatar Jul 22 '25 14:07 msci-horvrud

Hi! Any updated timeline for when we can start to test this?

Richard87 avatar Sep 01 '25 08:09 Richard87

🥳 It's about to drop: https://github.com/Azure/AKS/pull/5430

illrill avatar Dec 11 '25 15:12 illrill

It seems I have missudnerstood the feature, especially reading the documentation and the description above again. Can you confirm/deny this UX?

  • 1 Managed Identity created by Platform Operators (Platform MI)
  • Assign the Platform MI with Identity binding to 2-3 AKS clusters
  • Our users have their own Managed Identity with Workload Identity Enabled (AppX MI)
  • Our users can select to use their MI with our Platform MI (A jwt with the Platform MI as issuer, but AZURE_CLIENT_ID = AppX MI Client id

And Offocurse, AppY MI and AppZ MI etc will continue to work, but can select the Platform MI as issuer when they are ready (will require a RBAC role to allow selecting the Platform MI as issuer).

In other words, I expected a new annotation like this:

apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    azure.workload.identity/client-id: "${AppX_MI}"
    azure.workload.identity/identity-binding-client-id: "${Platform_MI}" # This guy is MIA
  name: appx-server
  namespace: appx
---
apiVersion: v1
kind: Pod
metadata:
    name: appx-server
    namespace: appx
    labels:
        azure.workload.identity/use: "true"
spec:
    serviceAccountName: appx-server
    containers:
    - image: ghcr.io/azure/azure-workload-identity/msal-go
        name: oidc
        env: 
        - name: AZURE_CLIENT_ID 
            value: ${AppX_MI}
        - name: AZURE_TENANT_ID
            value: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
        - name: AZURE_FEDERATED_TOKEN_FILE
            value: /var/run/secrets/azure/tokens/azure-identity-token 
        - name: AZURE_AUTHORITY_HOST  
            value: https://login.microsoftonline.com/   

Richard87 avatar Dec 17 '25 10:12 Richard87

+1 @Richard87

If the MI needs to be owned by the cluster operator then this is basically unusable in multi-tenancy setups. Reasonably, cluster users need to be able to "bring their own" MI's so that they can control their own role assignments, etc.?

illrill avatar Dec 17 '25 11:12 illrill

I'm a bit confused now. Does this feature resolve https://github.com/Azure/AKS/issues/3982 or not?

nilsgstrabo avatar Dec 17 '25 11:12 nilsgstrabo

wic, err := NewWorkloadIdentityCredential(&WorkloadIdentityCredentialOptions{
			AdditionallyAllowedTenants: additionalTenants,
			ClientOptions: options.ClientOptions,
			DisableInstanceDiscovery: options.DisableInstanceDiscovery,
			TenantID: options.TenantID,
			EnableAzureTokenProxy: true,
})

Default Credential Chain Link: https://github.com/Azure/azure-sdk-for-go/blob/dea9249d894d9a2908a605f3b7460b95ec93db14/sdk/azidentity/default_azure_credential.go#L154

Currently we have tested and are able to authenticate for our use case by setting the WorkloadIdentityCredentialOptions.EnableAzureProxy: true in the default credential chain.

Now query from our side: Will the identity binding feature be added in the DefaultAzureCredential chain?

@benjaminapetersen @shashankbarsin

arnab-baishnab avatar Mar 25 '26 09:03 arnab-baishnab

For python MSFT Support told me no. I have already raised the same request with python identity sdk and they refused apparently because of some security issue. ==> As a result, we are now forced to migrate a number of apps on our side, from Default to WorkloadId.

dmpe avatar Mar 25 '26 17:03 dmpe

the GA of this is targeted for H2 this year - stay tuned for more.

kaarthis avatar Jun 09 '26 23:06 kaarthis