Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a workload identity credential for DAC auth flow #19212

Closed
scottaddie opened this issue Sep 27, 2022 · 0 comments · Fixed by #19503
Closed

Create a workload identity credential for DAC auth flow #19212

scottaddie opened this issue Sep 27, 2022 · 0 comments · Fixed by #19503
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@scottaddie
Copy link
Member

scottaddie commented Sep 27, 2022

Related to #15615.

Intro:
Azure AD workload identity federation is a new capability. It applies to both application identities and managed identities in Azure AD. The k8s team has built additional components around this that help customers use this capability in their k8s deployments. It's essential for the Azure Identity SDK to support this pattern so customers can easily benefit from this capability.

  1. Allow customers to seamlessly move their code, which uses DefaultAzureCredential, to also run in a k8s cluster.
  2. Do this in a way that isn't confusing to customers. They could either use application identities or managed identities. Telling a customer to pass a managed identity when they're using an application identity is going to be very confusing.
  3. Provide predictability on the credential. For example, a customer may want to exclude ManagedIdentityCredential, so they know the request isn't going through the compute endpoint like IMDS.

Proposal:

  1. Add a new credential type named WorkloadIdentityCredential. This new credential type will become part of the DefaultAzureCredential auth flow.

  2. The WorkloadIdentityCredential will come into play if the necessary environment variables are populated: (AZURE_FEDERATED_TOKEN_FILE, AZURE_CLIENT_ID, AZURE_TENANT_ID). These are set up by the k8s platform based on the assertions on a service account.

  3. Allow an optional client ID parameter to be passed into DefaultAzureCredential, which can be used by the customers to override the AZURE_CLIENT_ID in the event they have more than one identity for which they intend to use this flow.

With these changes, customers can do the following:

  1. Use DefaultAzureCredential as their main guidance to their developers.
  2. Recommend excluding the necessary credential types to get predictability in their code execution.
  3. Pass explicit client IDs for which they want to get an Azure AD token.

Ideally with these changes, we'd also remove the current implementation where ManagedIdentityCredential is overloaded to work with these env. Doing this is ideal to avoid the ensuing confusion for customers.

@scottaddie scottaddie added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Sep 27, 2022
@scottaddie scottaddie added this to the Backlog milestone Sep 27, 2022
@scottaddie scottaddie modified the milestones: Backlog, 2023-01 Oct 24, 2022
@joshfree joshfree modified the milestones: 2023-01, 2022-11 Nov 3, 2022
@joshfree joshfree moved this from Planned to In Progress in Azure Identity SDK Improvements Nov 3, 2022
@joshfree joshfree modified the milestones: 2022-11, 2022-12 Nov 3, 2022
@chlowell chlowell linked a pull request Dec 9, 2022 that will close this issue
Repository owner moved this from In Progress to Done in Azure Identity SDK Improvements Dec 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants