Azure / Azure/azure-workload-identity

Federated identity credentials support for wildcards

Open
#373 248 comments 412 reactions 0 assignees View on GitHub
aad enhancement
Dominant language
Go
Stars
337
Forks
122
Avg merge
1h 7m
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**
We are porting our product from AWS to Azure and in AWS you can use wildcards in your trust relationships between your serviceaccount and a role (similar to azure ad application in azure) as follows:
```
statement {
actions = [
"sts:AssumeRoleWithWebIdentity"]
effect = "Allow"

condition {
test = "StringLike"
variable = ""
values = [
"system:serviceaccount:environmentprefix-*:saprefix-*"]
}

principals {
identifiers = []
type = "Federated"
}
}
```
Is this something that you are considering as well? At the moment it is rigid to work with federated identity credentials in Azure:
- 1 ad application can only have 20 federated identity credentials
- you need to create a federated identity credential when deploying an application to a different aks environment.

**Describe the solution you'd like**
It would be great if the federated identity credential had support for wildcards to for example allow multiple environments or allow creating a dedicated service account for each pod.
An example of a credential could be as follows:
`
resource "azuread_application_federated_identity_credential" "app" {
application_object_id = azuread_application.object_id
display_name = "uuid"
audiences = ["api://AzureADTokenExchange"]
issuer = var.oidc_issuer_url
subject = "system:serviceaccount:*:service_account_name-????"
}
`
wildcard support: * for any string or ? for 1 random character

**Describe alternatives you've considered**
The other path we are thinking of is managing the federated identity credentials using a kubernetes operator. This way we can dynamically create the federated identity credential, when an application is deployed to a new environments.
Issues we see there are:
- We could bump to the limit of only allowing 20 federated identity credentials per ad application.
- Our clients might want to keep control over the federated identity credentials that get created for an azure ad application.
- We notice a delay between the creation of federated identity credential and when it can be used, this might impact the jobs being launched on a new environment.

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

No implementation files or tests are identified in the issue. Start by reviewing the discussion and the Azure federated identity credential constraints, then determine the accepted wildcard semantics and implementation scope; done should include an agreed design and corresponding support for wildcard subjects.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go, kubernetes
Domain
authentication, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.