Access Control for Shared OIDC Identity Providers
For shared OIDC IdPs, IAM enforces explicit validation of specific claims within the agency trust policy. Specifically, IAM mandatorily validates the oidc:iss (issuer) and oidc:aud (audience) condition keys as a core component of its runtime access control mechanism. While the oidc:sub (subject) condition key is not strictly mandatory, we strongly recommend adding it to your trust policy. In most multi-tenant scenarios, evaluating the oidc:sub claim effectively mitigates the confused deputy problem inherent in shared identity environments.
When you create or update a trust agency, the operation will fail if the underlying trust policy does not explicitly restrict these critical claims. Validating these condition keys ensures that only identities originating from your authorized organization can assume the trust agency and access your Huawei Cloud resources. This containment boundary is particularly critical when multiple independent Huawei Cloud accounts share a common, multi-tenant OIDC IdP.
Shared Identity Providers
- Private OIDC providers: These are owned and managed by a single organization or operate as a dedicated tenant of a SaaS provider. The OIDC issuer URL serves as a unique, globally distinct identifier specific to that organization.
- Shared OIDC providers: These are multi-tenant platforms utilized concurrently by multiple independent organizations. Consequently, the OIDC issuer URL may be completely identical across all organizations using the shared infrastructure.
| Attribute | Private OIDC Providers | Shared OIDC Providers |
|---|---|---|
| Issuer context | Dedicated exclusively to a single organization. | Shared across multiple independent organizations. |
| Tenant context | Conveyed directly via the unique issuer URL. | Conveyed via claims embedded within the JWT payload. |
Confused Deputy Problem
Deploying a shared OIDC IdP introduces a critical structural security risk known as the confused deputy problem. This vulnerability occurs when a cloud service—in this case, Huawei Cloud IAM—acts as a deputy that evaluates inbound OIDC ID tokens to authorize trust agency assumptions. Because the underlying IdP infrastructure is shared across multiple tenants, ID tokens issued to entirely different organizations can feature identical issuer strings. If an agency's trust policy evaluates only the issuer field without imposing granular restrictions on organization-specific claims (such as audience or subject), IAM cannot isolate tenant boundaries. The deputy becomes confused, treating a valid user from an unrelated external tenant as an authorized entity within the target account. An attacker holding legitimate credentials on the same shared IdP can exploit this lack of isolation to induce IAM into performing unauthorized cross-organization actions, achieving cross-tenant privilege escalation.
Consequently, failing to enforce explicit, multi-layered validation of key JWT claims within shared OIDC configurations directly exposes the IAM deployment to the confused deputy exploit.
Access Control for Shared Identity Providers
- The oidc:iss Condition Key
The oidc:iss condition key evaluates whether the token issuer matches the specific value defined in your trust policy. This key maps directly to the iss claim within the inbound OIDC ID token, and represents the base URL of the external IdP.
Consider the following sample OIDC ID token payload:{ "iss": "https://accounts.example-idp.com", "aud": "my-backend-service", "sub": "a1b2c3d4e5f6g7h8" }In this scenario, the corresponding value evaluated by the oidc:iss condition key is: https://accounts.example-idp.com.
- The oidc:aud Condition Key The oidc:aud condition key evaluates whether the intended audience of the token matches the value defined in your trust policy. The value resolved by this condition key is determined by the following parsing rules:
- If the OIDC ID token does not contain an azp (authorized party) claim, the oidc:aud condition key resolves to the value of the aud claim.
- If the OIDC ID token contains an azp claim, the oidc:aud condition key resolves directly to the value of the azp claim.
When authoring IAM trust policies using the oidc:aud condition key, you must verify whether your external OIDC IdP injects the azp claim into the ID tokens issued for your applications.- OIDC token without an azp claim:
{ "iss": "https://accounts.example-idp.com", "aud": "my-backend-service", "sub": "550e8400-e29b-41d4-a716-446655440000" }In this scenario, the resolved value for the oidc:aud condition key is: my-backend-service
- OIDC token with an azp claim:
{ "iss": "https://accounts.example-idp.com", "aud": "my-backend-service", "azp": "my-frontend-app", "sub": "550e8400-e29b-41d4-a716-446655440000" }In this scenario, the resolved value for the oidc:aud condition key is: my-frontend-app
- OIDC token with a multi-valued aud and an azp claim:
{ "iss": "https://accounts.example-idp.com", "aud": [ "my-backend-service", "my-mobile-app" ], "azp": "my-frontend-app", "sub": "550e8400-e29b-41d4-a716-446655440000" }In this scenario, the resolved value for the oidc:aud condition key remains: my-frontend-app
- The oidc:sub Condition Key
The oidc:sub condition key evaluates whether the subject identity matches the specific value defined in your trust policy. This key maps to the sub claim within the OIDC token, and represents the unique identifier for the user within the external IdP scope.
Consider the following sample OIDC ID token payload:{ "iss": "https://accounts.example-idp.com", "aud": "my-backend-service", "sub": "550e8400-e29b-41d4-a716-446655440000" }In this scenario, the corresponding value evaluated by the oidc:sub condition key is: 550e8400-e29b-41d4-a716-446655440000.
{
"Version": "5.0",
"Statement": [
{
"Action": [
"sts:agencies:assumeWithOIDC"
],
"Effect": "Allow",
"Principal": {
"Federated": [
"iam::{account-id}:oidcProvider:{provider-name}"
]
},
"Condition": {
"StringEquals": {
"oidc:iss": [
"https://accounts.example-idp.com"
],
"oidc:aud": [
"my-backend-service"
],
"oidc:sub": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
}
}
]
} What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot