Skip to content

rgw/oidc: Add support for global OIDC providers. - #68850

Merged
anrao19 merged 6 commits into
ceph:mainfrom
kchheda3:wip-global-oidc
Sep 3, 2026
Merged

anrao19 merged 6 commits into
ceph:mainfrom
kchheda3:wip-global-oidc

Conversation

@kchheda3

@kchheda3 kchheda3 commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/76069

based on design doc--> https://docs.google.com/document/d/1SWfTGOP4xVV5GsSx0DhqerblozVSAzE4kEz5VHBk8Co/edit?pli=1&tab=t.0

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added the rgw label May 11, 2026
@kchheda3
kchheda3 marked this pull request as ready for review May 11, 2026 18:11
@kchheda3
kchheda3 requested a review from a team as a code owner May 11, 2026 18:11
Comment thread src/rgw/radosgw-admin/radosgw-admin.cc Outdated
} else if (!tenant.empty()) {
oidc_tenant = tenant;
} else {
oidc_tenant = std::string(global_oidc_tenant);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the admin wants the oidc provider to be created in the empty tenant namespace?

@cbodley cbodley May 12, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, but we can probably ignore tenant-based roles/oidcs for this feature. it's too late to merge for the umbrella release, and "tenant-based roles and policy" were deprecated in tentacle and can be removed for the v release

so these commands could just treat the lack of --account-id as "global"

@pritha-srivastava pritha-srivastava May 13, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means we won't be supporting these for existing users that use tenants? we could have done that by adding a --global flag which could have mapped to the global_oidc_tenant. and let the empty tenant map to empty tenant namespace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also make these ops available only for global oidc providers (both for tenants and accounts) and let the end users use REST APIs for local oidc proviers

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also make these ops available only for global oidc providers (both for tenants and accounts) and let the end users use REST APIs for local oidc proviers

once we decide what we want to do, this is trivial change
originally in the design i did not propose adding --global flag and hence the coding was done based on that.
based on consensus I can do what is required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we decided we don't need to support tenants for this, as for the restricting it to just global oidc providers for accounts, whats your take on this @cbodley

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we decided we don't need to support tenants for this, as for the restricting it to just global oidc providers for accounts, whats your take on this @cbodley

thats what @cbodley originally mentioned to not support tenant, but you again proposed adding --global

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, we had a discussion internally about it and concluded we wont support it for tenants. but at the same time, my suggestion is to restrict the commands only for global oidc providers. And I was asking @cbodley about his thoughts on the latter

Comment thread src/rgw/radosgw-admin/radosgw-admin.cc Outdated
return EINVAL;
}

std::string oidc_tenant;

@pritha-srivastava pritha-srivastava May 12, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidc_tenant resolution can be moved to a method and called from all CRUD ops

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidc_tenant resolution can be moved to a method and called from all CRUD ops

done

@pritha-srivastava

Copy link
Copy Markdown
Contributor
  1. Documentation needs to be added for this - specifically the trust policy that will be used with the role for a global oidc provider, whether a role will support both the tenant/account specific and global oidc provider etc
  2. Tests need to be added for different scenarios.

@pritha-srivastava

Copy link
Copy Markdown
Contributor

RGWREST_STS::verify_permission check this method and the part that evaluates the policy:

if (get_type() == RGW_STS_ASSUME_ROLE_WEB_IDENTITY) {
      op = rgw::IAM::stsAssumeRoleWithWebIdentity;
    } else {
      op = rgw::IAM::stsAssumeRole;
    }

    auto res = p.eval(s->env, *s->auth.identity, op, boost::none);
    if (res != rgw::IAM::Effect::Allow) {
      ldout(s->cct, 0) << "evaluating policy for op: " << op << " returned deny/pass" << dendl;
      return -EPERM;
    }

Here if the tenant/account of the authenticating identity is different from that of the oidc provider in the trust policy of the role - then this might fail

@cbodley

cbodley commented May 12, 2026

Copy link
Copy Markdown
Contributor

i found a recent aws blog post https://aws.amazon.com/about-aws/whats-new/2026/01/aws-sts-supports-validation-identity-provider-claims/ which references https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif - these provider-specific condition keys can be used in role trust policy to limit which jwt claims to accept

do we support anything like this currently? should we try to do something similar for these global providers?

@kchheda3

Copy link
Copy Markdown
Contributor Author

RGWREST_STS::verify_permission check this method and the part that evaluates the policy:

if (get_type() == RGW_STS_ASSUME_ROLE_WEB_IDENTITY) {
      op = rgw::IAM::stsAssumeRoleWithWebIdentity;
    } else {
      op = rgw::IAM::stsAssumeRole;
    }

    auto res = p.eval(s->env, *s->auth.identity, op, boost::none);
    if (res != rgw::IAM::Effect::Allow) {
      ldout(s->cct, 0) << "evaluating policy for op: " << op << " returned deny/pass" << dendl;
      return -EPERM;
    }

Here if the tenant/account of the authenticating identity is different from that of the oidc provider in the trust policy of the role - then this might fail

The trust policy's Principal.Federated ARN is parsed at line (rgw_iam_policy.cc:566) which extracts only the IDP URL (discards the account from the ARN)

  • WebIdentityApplier::is_identity() at line (rgw_auth.cc:804) compares only idp_url from the Principal vs iss from the JWT
  • The OIDC provider's storage tenant (.global vs account) is never consulted during policy evaluation.

The account ID in the ARN is not matched against the OIDC provider's storage tenant. It's just part of the ARN structure. What actually happens:

Step 1: Parse trust policy ARN (rgw_iam_policy.cc:566)
"arn:aws:iam::RGW12345:oidc-provider/example.com"
↓
Principal::oidc_provider("example.com")
→ account RGW12345 is DISCARDED

Step 2: Match caller identity (rgw_auth.cc:804)
p.get_idp_url() == get_idp_url()
"example.com" == "example.com"
→ match on URL only ✓
→ ENOENT → falls back to .global
→ finds the provider config (client_ids, thumbprints)
→ uses it for JWT validation

@kchheda3

Copy link
Copy Markdown
Contributor Author
  1. Documentation needs to be added for this - specifically the trust policy that will be used with the role for a global oidc provider, whether a role will support both the tenant/account specific and global oidc provider etc
  2. Tests need to be added for different scenarios.

The trust policy doesn't need to know whether the OIDC provider is global or account-level — the lookup is transparent. During AssumeRoleWithWebIdentity,
load_provider() first tries the role's account, and falls back to the global provider if not found. The trust policy evaluation at rgw_iam_policy.cc:566
only matches on the IDP URL (discards the account from the ARN), so it works identically for both.

A role supports both — if an account-level provider exists for the same URL, it takes precedence. If not, the global provider is used. No configuration
change needed on the role side.

so what do you want to add for documentation ? anything w.r.t trust policy will make things confusing, we can add support for global oidc provider and add that it works same way as account level with no change in trust policy and permission policy.
where do you think this documentation needs to go ?

For Tests:
you want me to add functional test (qa/workunits/rgw/) — create/modify/get/list/delete for global and account-scoped providers via radosgw-admin ??

@pritha-srivastava

pritha-srivastava commented May 13, 2026 •

Copy link
Copy Markdown
Contributor
  1. Documentation needs to be added for this - specifically the trust policy that will be used with the role for a global oidc provider, whether a role will support both the tenant/account specific and global oidc provider etc
  2. Tests need to be added for different scenarios.

The trust policy doesn't need to know whether the OIDC provider is global or account-level — the lookup is transparent. During AssumeRoleWithWebIdentity, load_provider() first tries the role's account, and falls back to the global provider if not found. The trust policy evaluation at rgw_iam_policy.cc:566 only matches on the IDP URL (discards the account from the ARN), so it works identically for both.

A role supports both — if an account-level provider exists for the same URL, it takes precedence. If not, the global provider is used. No configuration change needed on the role side.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

so what do you want to add for documentation ? anything w.r.t trust policy will make things confusing, we can add support for global oidc provider and add that it works same way as account level with no change in trust policy and permission policy. where do you think this documentation needs to go ?

Ofcourse we need to tell the users that support for global oidc providers has been added. There is a section here:
https://docs.ceph.com/en/latest/radosgw/oidc/

For Tests: you want me to add functional test (qa/workunits/rgw/) — create/modify/get/list/delete for global and account-scoped providers via radosgw-admin ??

Not just for the crud ops, but for the entire workflow when no local oidc provider is present. we have tests for assumerolewithwebidentity in https://github.com/ceph/s3-tests/blob/master/s3tests/functional/test_sts.py.

@pritha-srivastava

pritha-srivastava commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html if we are trying to provide support for oidc providers along the lines of https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html
If you are using an OIDC identity provider from Google, Facebook, or Amazon Cognito, you don't need to create a separate IAM identity provider. These OIDC identity providers are already built-in to AWS and are available for your use. Instead, you can move directly to creating new roles using your identity provider.
Then it looks like, that even when the user uses one of the above oidc providers, the role's trust policy must explicitly allow them as a Principal as noted here: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html
If you are using an OIDC IdP from Google, Facebook, or Amazon Cognito, don't create a separate IAM IdP in the AWS Management Console. These OIDC identity providers are already built into AWS and are available for you to use. Skip this step and create new roles using your IdP in the following step.

Prepare the policies for the role that the IdP-authenticated users will assume. As with any role, a role for a mobile app includes two policies. One is the trust policy that specifies who can assume the role. The other is the permissions policy that specifies the AWS actions and resources that the mobile app is allowed or denied access to.

For web IdPs, we recommend that you use [Amazon Cognito](https://aws.amazon.com/cognito/) to manage identities. In this case, use a trust policy similar to this example.
{
    "Version":"2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Principal": {"Federated": "cognito-identity.amazonaws.com"},
        "Action": "sts:AssumeRoleWithWebIdentity",
        "Condition": {
            "StringEquals": {"cognito-identity.amazonaws.com:aud": "us-east-2:12345678-abcd-abcd-abcd-123456"},
            "ForAnyValue:StringLike": {"cognito-identity.amazonaws.com:amr": "unauthenticated"}
        }
    }
}

For some common OIDC IdPs, the providerUrl is a URL. The following examples include methods to specify the principal for some common IdPs:

"Principal":{"Federated":"cognito-identity.amazonaws.com"}

"Principal":{"Federated":"www.amazon.com"}

"Principal":{"Federated":"graph.facebook.com"}

"Principal":{"Federated":"accounts.google.com"}

@pritha-srivastava

pritha-srivastava commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

i found a recent aws blog post https://aws.amazon.com/about-aws/whats-new/2026/01/aws-sts-supports-validation-identity-provider-claims/ which references https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif - these provider-specific condition keys can be used in role trust policy to limit which jwt claims to accept

do we support anything like this currently? should we try to do something similar for these global providers?

Yes all claims in the JWT token can be used in the condition element of the role's trust policy currently. Reference to our documentation here: https://docs.ceph.com/en/latest/radosgw/STS/
The trust between the IDP and the role is created by adding a condition to the role’s trust policy, which allows access only to applications which satisfy the given condition. All claims of the JWT are supported in the condition of the role’s trust policy.
All examples in AWS have the IDP URL and token claim/s of the common oidc provider in the role's trust policy.

@pritha-srivastava

pritha-srivastava commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

RGWREST_STS::verify_permission check this method and the part that evaluates the policy:

if (get_type() == RGW_STS_ASSUME_ROLE_WEB_IDENTITY) {
      op = rgw::IAM::stsAssumeRoleWithWebIdentity;
    } else {
      op = rgw::IAM::stsAssumeRole;
    }

    auto res = p.eval(s->env, *s->auth.identity, op, boost::none);
    if (res != rgw::IAM::Effect::Allow) {
      ldout(s->cct, 0) << "evaluating policy for op: " << op << " returned deny/pass" << dendl;
      return -EPERM;
    }

Here if the tenant/account of the authenticating identity is different from that of the oidc provider in the trust policy of the role - then this might fail

The trust policy's Principal.Federated ARN is parsed at line (rgw_iam_policy.cc:566) which extracts only the IDP URL (discards the account from the ARN)

* WebIdentityApplier::is_identity() at line (rgw_auth.cc:804) compares only idp_url from the Principal vs iss from the JWT

* The OIDC provider's storage tenant (.global vs account) is never consulted during policy evaluation.

The account ID in the ARN is not matched against the OIDC provider's storage tenant. It's just part of the ARN structure. What actually happens:

Step 1: Parse trust policy ARN (rgw_iam_policy.cc:566) "arn:aws:iam::RGW12345:oidc-provider/example.com" ↓ Principal::oidc_provider("example.com") → account RGW12345 is DISCARDED

This will allow cross account roles to be assumed via AssumeRoleWithWebIdentity and this is not allowed by AWS, hence I am not sure if this is correct.

Step 2: Match caller identity (rgw_auth.cc:804) p.get_idp_url() == get_idp_url() "example.com" == "example.com" → match on URL only ✓ → ENOENT → falls back to .global → finds the provider config (client_ids, thumbprints) → uses it for JWT validation

again if i understand this correctly, is this use case you talking about

Setup:                                                                                                                                                                                                   
                                                                                                                                                                                                           
  Account A (RGW_AAAA):                                                                                                                                                                                    
    - Registers OIDC provider: example.com                                                                                                                                              
    - Creates Role-A with trust policy allowing sub=kchheda3                                                                                                                                               
                                                                                                                                                                                                           
  Account B (RGW_BBBB):                                                                                                                                                                                    
    - Does NOT register any OIDC provider                                                                                                                                                                  
    - Creates Role-B with trust policy:                                                                                                                                                                    
      "Principal": {"Federated": ["arn:aws:iam::RGW_BBBB:oidc-provider/example.com"]}                                                                                                     
      allowing sub=kchheda3                                                                                                                                                                                
                                                                                                                                                                                                           
  What happens when kchheda3 calls AssumeRoleWithWebIdentity(RoleArn=Role-B, JWT):                                                                                                                         
                                                                                                                                                                                                           
  Step 1: Load Role-B from account RGW_BBBB ✅ (role exists)                                                                                                                                                
                                                                                                                                                                                                           
  Step 2: load_provider("RGW_BBBB", "example")                                                                                                                                        
          → ENOENT (Account B never registered this provider!)                                                                                                                                             
                                                                                                                                                                                                           
  Step 3 (our fallback): load_provider(".global", "example.com")                                                                                                                          
          → If a global provider exists → JWT validated ✅                                                                                                                                                  
          → If no global either → fails (correct behavior)                                                                                                                                                 
                                                                                                                                                                                                           
  Step 4: Trust policy eval                                                                                                                                                                                
          Principal::oidc_provider("example.com")                                                                                                                                         
          vs                                                                                                                                                                                               
          WebIdentityApplier::get_idp_url() = "example.com"                                                                                                                               
          → URL matches ✅                                                                                                                                                                                  
                                                                                                                                                                                                           
  Step 5: Condition check: sub == "kchheda3" ✅                                                                                                                                                            ─
                                                                                                                                                                                                           
  Result: kchheda3 gets temporary credentials for Role-B in Account B                                                                                                                                      
                  
  The Concern                                                                                                                                                                                              
                  
  Without our global fallback, Step 2 would return ENOENT and the whole request would fail — Account B never registered the OIDC provider, so nobody can assume Role-B via web identity. The trust policy  
  is "dead" without a matching provider in that account.
                                                                                                                                                                                                           
  With our global fallback, a global provider makes it "live" — Account B's Role-B can now be assumed by anyone whose JWT validates against the global provider, even though Account B never explicitly    
  opted in to that provider.

Then whole purpose of this PR is to support GLOBAL OIDC, where without setting up the CreateOIDCProvider, user can setup TrustPolicy and assume role

@kchheda3

Copy link
Copy Markdown
Contributor Author

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.
not sure if i understand your question correctly here,
what i interpret here is you asking, where trust policy has no meaning/requirement for global oidc?
The trust policy is still required and must reference the OIDC provider URL in the Principal.Federated field. The global OIDC provider only determines where the provider configuration (client_ids, thumbprints) is loaded from during JWT validation — it doesn't bypass trust policy evaluation. A role without a matching Federated principal in its trust policy will still be denied, regardless of whether a global provider exists.
the user still needs to have the trust policy

 {               
    "Principal": {                                                                                                                                                                                         
      "Federated": ["arn:aws:iam::RGW12345:oidc-provider/example.com"]
    },                                                                                                                                                                                                     
    "Action": "sts:AssumeRoleWithWebIdentity"                                                                                                                                                              }

ceph will try to load the OIDC first from account namespace RGW12345 and then fall back to global if it exist

@kchheda3

Copy link
Copy Markdown
Contributor Author
  1. Documentation needs to be added for this - specifically the trust policy that will be used with the role for a global oidc provider, whether a role will support both the tenant/account specific and global oidc provider etc
  2. Tests need to be added for different scenarios.

The trust policy doesn't need to know whether the OIDC provider is global or account-level — the lookup is transparent. During AssumeRoleWithWebIdentity, load_provider() first tries the role's account, and falls back to the global provider if not found. The trust policy evaluation at rgw_iam_policy.cc:566 only matches on the IDP URL (discards the account from the ARN), so it works identically for both.
A role supports both — if an account-level provider exists for the same URL, it takes precedence. If not, the global provider is used. No configuration change needed on the role side.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

so what do you want to add for documentation ? anything w.r.t trust policy will make things confusing, we can add support for global oidc provider and add that it works same way as account level with no change in trust policy and permission policy. where do you think this documentation needs to go ?

Ofcourse we need to tell the users that support for global oidc providers has been added. There is a section here: https://docs.ceph.com/en/latest/radosgw/oidc/

For Tests: you want me to add functional test (qa/workunits/rgw/) — create/modify/get/list/delete for global and account-scoped providers via radosgw-admin ??

Not just for the crud ops, but for the entire workflow when no local oidc provider is present. we have tests for assumerolewithwebidentity in https://github.com/ceph/s3-tests/blob/master/s3tests/functional/test_sts.py.

done adding test ceph/s3-tests#750
and updated the doc

@pritha-srivastava

Copy link
Copy Markdown
Contributor

RGWREST_STS::verify_permission check this method and the part that evaluates the policy:

if (get_type() == RGW_STS_ASSUME_ROLE_WEB_IDENTITY) {
      op = rgw::IAM::stsAssumeRoleWithWebIdentity;
    } else {
      op = rgw::IAM::stsAssumeRole;
    }

    auto res = p.eval(s->env, *s->auth.identity, op, boost::none);
    if (res != rgw::IAM::Effect::Allow) {
      ldout(s->cct, 0) << "evaluating policy for op: " << op << " returned deny/pass" << dendl;
      return -EPERM;
    }

Here if the tenant/account of the authenticating identity is different from that of the oidc provider in the trust policy of the role - then this might fail

The trust policy's Principal.Federated ARN is parsed at line (rgw_iam_policy.cc:566) which extracts only the IDP URL (discards the account from the ARN)

* WebIdentityApplier::is_identity() at line (rgw_auth.cc:804) compares only idp_url from the Principal vs iss from the JWT

* The OIDC provider's storage tenant (.global vs account) is never consulted during policy evaluation.

The account ID in the ARN is not matched against the OIDC provider's storage tenant. It's just part of the ARN structure. What actually happens:
Step 1: Parse trust policy ARN (rgw_iam_policy.cc:566) "arn:aws:iam::RGW12345:oidc-provider/example.com" ↓ Principal::oidc_provider("example.com") → account RGW12345 is DISCARDED

This will allow cross account roles to be assumed via AssumeRoleWithWebIdentity and this is not allowed by AWS, hence I am not sure if this is correct.

Step 2: Match caller identity (rgw_auth.cc:804) p.get_idp_url() == get_idp_url() "example.com" == "example.com" → match on URL only ✓ → ENOENT → falls back to .global → finds the provider config (client_ids, thumbprints) → uses it for JWT validation

again if i understand this correctly, is this use case you talking about

Setup:                                                                                                                                                                                                   
                                                                                                                                                                                                           
  Account A (RGW_AAAA):                                                                                                                                                                                    
    - Registers OIDC provider: example.com                                                                                                                                              
    - Creates Role-A with trust policy allowing sub=kchheda3                                                                                                                                               
                                                                                                                                                                                                           
  Account B (RGW_BBBB):                                                                                                                                                                                    
    - Does NOT register any OIDC provider                                                                                                                                                                  
    - Creates Role-B with trust policy:                                                                                                                                                                    
      "Principal": {"Federated": ["arn:aws:iam::RGW_BBBB:oidc-provider/example.com"]}                                                                                                     
      allowing sub=kchheda3                                                                                                                                                                                
                                                                                                                                                                                                           
  What happens when kchheda3 calls AssumeRoleWithWebIdentity(RoleArn=Role-B, JWT):                                                                                                                         
                                                                                                                                                                                                           
  Step 1: Load Role-B from account RGW_BBBB ✅ (role exists)                                                                                                                                                
                                                                                                                                                                                                           
  Step 2: load_provider("RGW_BBBB", "example")                                                                                                                                        
          → ENOENT (Account B never registered this provider!)                                                                                                                                             
                                                                                                                                                                                                           
  Step 3 (our fallback): load_provider(".global", "example.com")                                                                                                                          
          → If a global provider exists → JWT validated ✅                                                                                                                                                  
          → If no global either → fails (correct behavior)                                                                                                                                                 
                                                                                                                                                                                                           
  Step 4: Trust policy eval                                                                                                                                                                                
          Principal::oidc_provider("example.com")                                                                                                                                         
          vs                                                                                                                                                                                               
          WebIdentityApplier::get_idp_url() = "example.com"                                                                                                                               
          → URL matches ✅                                                                                                                                                                                  
                                                                                                                                                                                                           
  Step 5: Condition check: sub == "kchheda3" ✅                                                                                                                                                            ─
                                                                                                                                                                                                           
  Result: kchheda3 gets temporary credentials for Role-B in Account B                                                                                                                                      
                  
  The Concern                                                                                                                                                                                              
                  
  Without our global fallback, Step 2 would return ENOENT and the whole request would fail — Account B never registered the OIDC provider, so nobody can assume Role-B via web identity. The trust policy  
  is "dead" without a matching provider in that account.
                                                                                                                                                                                                           
  With our global fallback, a global provider makes it "live" — Account B's Role-B can now be assumed by anyone whose JWT validates against the global provider, even though Account B never explicitly    
  opted in to that provider.

Then whole purpose of this PR is to support GLOBAL OIDC, where without setting up the CreateOIDCProvider, user can setup TrustPolicy and assume role

Yes, got it, for cross account, the method will fail at the step where it fails to load the provider using the role's tenant/account

@pritha-srivastava

pritha-srivastava commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.
not sure if i understand your question correctly here,
what i interpret here is you asking, where trust policy has no meaning/requirement for global oidc?
The trust policy is still required and must reference the OIDC provider URL in the Principal.Federated field. The global OIDC provider only determines where the provider configuration (client_ids, thumbprints) is loaded from during JWT validation — it doesn't bypass trust policy evaluation. A role without a matching Federated principal in its trust policy will still be denied, regardless of whether a global provider exists.
the user still needs to have the trust policy

 {               
    "Principal": {                                                                                                                                                                                         
      "Federated": ["arn:aws:iam::RGW12345:oidc-provider/example.com"]
    },                                                                                                                                                                                                     
    "Action": "sts:AssumeRoleWithWebIdentity"                                                                                                                                                              }

ceph will try to load the OIDC first from account namespace RGW12345 and then fall back to global if it exist

Re-using a trust policy for a local oidc provider for using a global oidc provider - AWS states: The values for the principal in the trust policy for the role are specific to an IdP. A role for OIDC can specify only one principal. Therefore, if the mobile app allows users to sign in from more than one IdP, create a separate role for each IdP that you want to support. Create separate trust policies for each IdP. in https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html. Generally end users use different claims like "aud", "sub" to scope the role to an application/set of users as Condition element in the role's trust policy. This means that client ids (same as aud) that are registered for the local oidc provider will have to be registered with the global oidc provider also in order to re-use the same trust policy for both local and global oidc provider. Similarly if the trust policy of the local oidc provider is configured to check for tags in the web token generated by it, then the global oidc providers will also have to configure their web tokens to contain the same tags.
Are you suggesting this to ease transition from using local oidc providers to global oidc providers without the need to modify the role's trust policy for existing accounts? Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?

The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

@pritha-srivastava

Copy link
Copy Markdown
Contributor

Another question is what ARN do create and get ops return? From the code it looks like "arn:aws:iam::.global:oidc-provider/example.com", unless there is code to strip off ".global" from the ARN returned.

@kchheda3

Copy link
Copy Markdown
Contributor Author

Are you suggesting this to ease transition from using local oidc providers to global oidc providers without the need to modify the role's trust policy for existing accounts? Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?

The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.
not sure if i understand your question correctly here,
what i interpret here is you asking, where trust policy has no meaning/requirement for global oidc?
The trust policy is still required and must reference the OIDC provider URL in the Principal.Federated field. The global OIDC provider only determines where the provider configuration (client_ids, thumbprints) is loaded from during JWT validation — it doesn't bypass trust policy evaluation. A role without a matching Federated principal in its trust policy will still be denied, regardless of whether a global provider exists.
the user still needs to have the trust policy

 {               
    "Principal": {                                                                                                                                                                                         
      "Federated": ["arn:aws:iam::RGW12345:oidc-provider/example.com"]
    },                                                                                                                                                                                                     
    "Action": "sts:AssumeRoleWithWebIdentity"                                                                                                                                                              }

ceph will try to load the OIDC first from account namespace RGW12345 and then fall back to global if it exist

Re-using a trust policy for a local oidc provider for using a global oidc provider - AWS states: The values for the principal in the trust policy for the role are specific to an IdP. A role for OIDC can specify only one principal. Therefore, if the mobile app allows users to sign in from more than one IdP, create a separate role for each IdP that you want to support. Create separate trust policies for each IdP. in https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html. Generally end users use different claims like "aud", "sub" to scope the role to an application/set of users as Condition element in the role's trust policy. This means that client ids (same as aud) that are registered for the local oidc provider will have to be registered with the global oidc provider also in order to re-use the same trust policy for both local and global oidc provider. Similarly if the trust policy of the local oidc provider is configured to check for tags in the web token generated by it, then the global oidc providers will also have to configure their web tokens to contain the same tags. Are you suggesting this to ease transition from using local oidc providers to global oidc providers without the need to modify the role's trust policy for existing accounts? Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?

The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?


"Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?"

i cannot think of, not for the same URL at least.
The trust policy is per-role, not per-OIDC-provider — so different roles can already have different Conditions (different aud, sub values) regardless of whether the OIDC provider is local or global.
The OIDC provider object itself only stores client_ids (audience allowlist) and thumbprints (certificate fingerprints). For the same IDP URL:

  • Thumbprints are inherently identical — same server, same TLS certificate
  • Client_ids acts as a coarse gate before the trust policy Condition is evaluated. The global provider should either list the superset of all audience values, or leave client_ids empty (which skips
    this check entirely, deferring audience validation to each role's trust policy Condition)
    And If a tenant needs a restricted client_ids as an additional security boundary, they create a local provider — which takes priority and the fallback never fires.

The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

As mentioned above,

  • The global provider is a cluster-wide convenience to avoid per-tenant duplication
  • For the same URL, there's no realistic scenario where the OIDC provider configuration (client_ids, thumbprints) would differ between local and global

Given this, the user already has full liberty over their trust policy — they can set whatever Conditions they want (aud, sub, etc.) regardless of whether the underlying OIDC provider is local or
global. The fallback simply resolves which OIDC provider object to use for token validation (client_ids gate + thumbprint/signature check), and for the same URL, that validation is identical.

this was the pure reason for FALLBACK

@kchheda3

kchheda3 commented May 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Another question is what ARN do create and get ops return? From the code it looks like "arn:aws:iam::.global:oidc-provider/example.com", unless there is code to strip off ".global" from the ARN returned.

it returns .global
create and get op's are more for the cluster admin and not end users
so is there any issue's with returning .global ?

@pritha-srivastava

Copy link
Copy Markdown
Contributor

Are you suggesting this to ease transition from using local oidc providers to global oidc providers without the need to modify the role's trust policy for existing accounts? Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?
The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.

Are you saying that the trust policy for a role will not have the requirement for the global oidc provider specified.
not sure if i understand your question correctly here,
what i interpret here is you asking, where trust policy has no meaning/requirement for global oidc?
The trust policy is still required and must reference the OIDC provider URL in the Principal.Federated field. The global OIDC provider only determines where the provider configuration (client_ids, thumbprints) is loaded from during JWT validation — it doesn't bypass trust policy evaluation. A role without a matching Federated principal in its trust policy will still be denied, regardless of whether a global provider exists.
the user still needs to have the trust policy

 {               
    "Principal": {                                                                                                                                                                                         
      "Federated": ["arn:aws:iam::RGW12345:oidc-provider/example.com"]
    },                                                                                                                                                                                                     
    "Action": "sts:AssumeRoleWithWebIdentity"                                                                                                                                                              }

ceph will try to load the OIDC first from account namespace RGW12345 and then fall back to global if it exist

Re-using a trust policy for a local oidc provider for using a global oidc provider - AWS states: The values for the principal in the trust policy for the role are specific to an IdP. A role for OIDC can specify only one principal. Therefore, if the mobile app allows users to sign in from more than one IdP, create a separate role for each IdP that you want to support. Create separate trust policies for each IdP. in https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html. Generally end users use different claims like "aud", "sub" to scope the role to an application/set of users as Condition element in the role's trust policy. This means that client ids (same as aud) that are registered for the local oidc provider will have to be registered with the global oidc provider also in order to re-use the same trust policy for both local and global oidc provider. Similarly if the trust policy of the local oidc provider is configured to check for tags in the web token generated by it, then the global oidc providers will also have to configure their web tokens to contain the same tags. Are you suggesting this to ease transition from using local oidc providers to global oidc providers without the need to modify the role's trust policy for existing accounts? Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?
The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

"Is there a scenario where the global oidc provider's trust policy can look different from the local oidc provider's trust policy?"

i cannot think of, not for the same URL at least. The trust policy is per-role, not per-OIDC-provider — so different roles can already have different Conditions (different aud, sub values) regardless of whether the OIDC provider is local or global. The OIDC provider object itself only stores client_ids (audience allowlist) and thumbprints (certificate fingerprints). For the same IDP URL:

* Thumbprints are inherently identical — same server, same TLS certificate

* Client_ids acts as a coarse gate before the trust policy Condition is evaluated. The global provider should either list the superset of all audience values, or leave client_ids empty (which skips
  this check entirely, deferring audience validation to each role's trust policy Condition)
  And If a tenant needs a restricted client_ids as an additional security boundary, they create a local provider — which takes priority and the fallback never fires.

The question is why not allow the end user to directly configure a global oidc arn in the trust policy and why enforce the falback?

As mentioned above,

* The global provider is a cluster-wide convenience to avoid per-tenant duplication

* For the same URL, there's no realistic scenario where the OIDC provider configuration (client_ids, thumbprints) would differ between local and global

Given this, the user already has full liberty over their trust policy — they can set whatever Conditions they want (aud, sub, etc.) regardless of whether the underlying OIDC provider is local or global. The fallback simply resolves which OIDC provider object to use for token validation (client_ids gate + thumbprint/signature check), and for the same URL, that validation is identical.

this was the pure reason for FALLBACK

IMO we should do what AWS does - allow the end user to set the global oidc url/arn in the role's trust policy. The code already supports this (atleast setting the global oidc ARN). And for the same reason, having .global in the ARN returned is confusing.

@pritha-srivastava

Copy link
Copy Markdown
Contributor

Meanwhile /src/test/cli/radosgw-admin/help.t needs to be updated with the options added for oidc provider in radosgw-admin.cc

@kchheda3

kchheda3 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

overall the code looks fine now. Just a suggestion - you may replace global_oidc_tenant with an account specific name to avoid any confusion (applies to other places in code also). The tests also look fine. You can schedule a teuthology run for testing this branch+new s3tests that have been added.

@cbodley : Do you see any drawback in allowing radosgw-admin commands for CRUD ops on account-scoped oidc providers? (I don't see any)

teuthology run: https://pulpito.ceph.com/bcs-ceph-2026-08-03_21:20:12-rgw-wip-global-oidc-distro-default-smithi/

Suite: rgw (centos 9.stream). STS results are green:

  • rgw/sts s3tests: 1172 passed / 0 failed (incl. the 3 new global-OIDC tests:
    test_assume_role_with_global_oidc_provider_local_override,
    test_assume_role_with_global_oidc_trust_policy_scope,
    test_assume_role_with_web_identity_uid_based_non_account_user)
  • RGW ran clean under valgrind in rgw/verify (no memcheck errors)

Remaining job failures are unrelated to this change (verified: no coredumps except
the pre-existing rgw/d4n SSDDriver crash; the rest are Sepia infra teardown
EOFErrors and a dedup timeout).

what next is needed?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds global OIDC providers as an account fallback for RGW web-identity authentication.

Changes:

  • Adds global-provider storage, lookup, and trust-policy matching.
  • Adds radosgw-admin oidc-provider management commands.
  • Adds documentation and integration coverage.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/rgw/rgw_rest_sts.h Extends web-token interfaces with global scope.
src/rgw/rgw_rest_sts.cc Adds global provider fallback.
src/rgw/rgw_auth.h Tracks global OIDC identities.
src/rgw/rgw_auth.cc Implements scope-aware principal matching.
src/rgw/rgw_basic_types.h Adds account scope to OIDC principals.
src/rgw/rgw_iam_policy.cc Parses global and scoped OIDC principals.
src/rgw/rgw_oidc_provider.h Defines global provider utilities.
src/rgw/rgw_oidc_provider.cc Formats provider metadata.
src/rgw/rgw_rest_oidc_provider.cc Reuses shared date formatting.
src/rgw/radosgw-admin/radosgw-admin.cc Adds OIDC provider CLI operations.
src/test/cli/radosgw-admin/help.t Updates CLI help expectations.
src/test/rgw/s3-tests/s3tests/functional/test_sts.py Adds global OIDC integration tests.
qa/tasks/s3tests.py Provisions the global test provider.
qa/tasks/keycloak.py Extends test token lifetime.
doc/radosgw/oidc.rst Documents global provider behavior.
doc/man/8/radosgw-admin.rst Documents new CLI commands.

Comment thread src/rgw/rgw_rest_sts.cc Resolved
Comment thread src/rgw/rgw_iam_policy.cc Resolved
Comment thread src/rgw/radosgw-admin/radosgw-admin.cc Resolved
Comment thread src/rgw/radosgw-admin/radosgw-admin.cc Resolved
Comment thread src/rgw/rgw_oidc_provider.cc Resolved
Comment thread qa/tasks/s3tests.py
Comment on lines +250 to +273
for client in config.keys():
cluster_name, daemon_type, client_id = teuthology.split_role(client)
client_with_id = daemon_type + '.' + client_id
realm_name = os.environ.get('KC_REALM', '')
thumbprint = os.environ.get('THUMBPRINT', '')
aud = os.environ.get('AUD', '')
if realm_name and thumbprint:
ctx.cluster.only(client).run(
args=[
'adjust-ulimits',
'ceph-coverage',
'{tdir}/archive/coverage'.format(tdir=testdir),
'radosgw-admin',
'-n', client_with_id,
'--cluster', cluster_name,
'oidc-provider', 'create',
'--provider-url',
'http://localhost:8080/auth/realms/{}'.format(realm_name),
'--thumbprints', thumbprint,
'--client-ids', aud,
],
)
global_oidc_created = True
break # only need to create once on one client

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the remaining test cluster that are created are part of multisite, and oidc is synced as metadata, so other clusters should get the oidc synced and not required to create for each of them

Add a reserved ".global" tenant for OIDC providers that are not tied to
any specific account or tenant. The '.' prefix is chosen because it is
invalid in tenant names (only [a-zA-Z0-9_] allowed) and does not
conflict with metadata separators.

Also move format_creation_date() from rgw_rest_oidc_provider.cc to
rgw_oidc_provider.cc so it can be reused by radosgw-admin.

Signed-off-by: Krunal Chheda <[email protected]>
When WebTokenEngine::load_provider() fails to find an OIDC provider for
the request's tenant, retry the lookup using the global_oidc_tenant.
This allows cluster-wide OIDC providers to validate tokens for any
tenant without requiring per-tenant configuration.

Signed-off-by: Krunal Chheda <[email protected]>
Fix Principal parsing and is_identity() to enforce that the trust
policy principal scope matches the loaded OIDC provider scope:

- Account-scoped provider: trust policy must use the full ARN form
  (arn:aws:iam::<account>:oidc-provider/<url>) with matching account.
- Global provider: trust policy must use the bare URL form (<url>).

Changes:
- Principal::oidc_provider now stores the account from the ARN
- ParseState::parse_principal preserves account for OIDC providers
- Bare URL (with dot or slash, no arn: prefix) parsed as global OIDC
- load_provider() outputs is_global_oidc flag on global fallback
- WebIdentityApplier::is_identity() checks account match for
  account-scoped and empty account for global providers

Signed-off-by: Krunal Chheda <[email protected]>
Add radosgw-admin subcommands for managing OIDC providers:
  oidc-provider create|modify|get|delete|list

New CLI options: --provider-url, --client-ids, --thumbprints.
When neither --tenant nor --account-id is given the commands default
to the global OIDC tenant.

Signed-off-by: Krunal Chheda <[email protected]>
Copilot AI review requested due to automatic review settings August 5, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Suppressed comments (3)

src/rgw/radosgw-admin/radosgw-admin.cc:7654

  • Apply the same OIDC field validation when replacing these lists. As written, modify can write oversized client IDs/thumbprints even though the IAM API rejects them (rgw_rest_oidc_provider.cc:69-117), so a previously valid provider can be moved into an invalid state through this command.
      if (!client_ids_str.empty()) {
        info.client_ids.clear();
        get_str_vec(client_ids_str, ",", info.client_ids);
      }
      if (!thumbprints_str.empty()) {

src/rgw/radosgw-admin/radosgw-admin.cc:7594

  • Validate the provider URL, client IDs, and thumbprints before persisting them. The IAM create path enforces a 255-byte URL, at most 100 client IDs of 255 bytes, and at most five 40-byte thumbprints (rgw_rest_oidc_provider.cc:69-117), but this admin path bypasses all of those limits and can create provider records that cannot be created through the public API. Please share the validation logic/constants with both entry points so global and account-scoped records have the same invariants.

This issue also appears on line 7650 of the same file.

      info.provider_url = provider_url;

src/test/rgw/s3-tests/s3tests/functional/test_sts.py:2266

  • This description names the wrong fixture: the code below uses get_iam_client(), not the [s3 tenant] user. The latter also has tenant testx, so the current wording contradicts the empty-tenant behavior this test actually exercises.
    Uses the [s3 tenant] user (testid), whose tenant is empty and who has no
    account. The OIDC provider and role are created under that same empty

…allback and trust policy scope

Create a global OIDC provider via 'radosgw-admin oidc-provider create'
during test setup when Keycloak is configured. This enables s3-tests to
exercise the global OIDC fallback path in AssumeRoleWithWebIdentity.

Signed-off-by: Krunal Chheda <[email protected]>
Add documentation for:
- Global vs account-level OIDC provider concepts and fallback behavior
- radosgw-admin oidc-provider create/modify/get/delete/list commands
- Trust policy format for roles using OIDC providers
- Note clarifying that global providers do not bypass trust policy evaluation

Signed-off-by: Krunal Chheda <[email protected]>
Copilot AI review requested due to automatic review settings August 5, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/test/rgw/s3-tests/s3tests/functional/test_sts.py:2113

  • Phase 2 can still pass if client-ID validation is accidentally skipped: this trust policy only contains the global bare-URL principal, so an account-scoped identity is denied later by principal matching anyway. Include the account-scoped provider ARN as an alternative principal so the wrong client ID is what actually causes Phase 2 to fail, while the bare URL continues to cover Phases 1 and 3.
    policy_document = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Federated\":[\""+idp_url+"\"]},\"Action\":[\"sts:AssumeRoleWithWebIdentity\"],\"Condition\":{\"StringEquals\":{\""+idp_url+":sub\":\""+sub+"\"}}}]}"

src/rgw/rgw_rest_sts.cc:120

  • The new account-only fallback boundary is not exercised by the added tests. The uid-based test creates a local provider, so it never verifies that a role in a nonempty legacy tenant cannot consume a global provider. Add an integration case for that denial; this is an important isolation property documented by this PR.
  if (r == -ENOENT && tenant != global_oidc_id &&
      rgw::account::validate_id(tenant)) {

@kchheda3

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@anrao19

anrao19 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/79449
@kchheda3 , if there no further testing is needed then this pr can be merged

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks complete to me 👍

@pritha-srivastava could you please do a final round of review?

Comment on lines +2157 to +2160
resp=sts_client.assume_role_with_web_identity(RoleArn=role_response['Role']['Arn'],RoleSessionName=role_session_name,WebIdentityToken=token)
assert False, "Expected failure due to wrong client_id in account-level provider"
except ClientError as e:
assert e.response['Error']['Code'] in ('AccessDenied', 'InvalidIdentityToken')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which of these is the correct error? do we really need to accept both?

p.s. elsewhere we use this pattern for expected failures:

e = assert_raises(ClientError, sts_client.assume_role_with_web_identity, RoleArn=role_response['Role']['Arn'], RoleSessionName=role_session_name, WebIdentityToken=token)
status, code = _get_status_and_error_code(e.response)
assert status == 403
assert code in ('AccessDenied', 'InvalidIdentityToken')

@anrao19
anrao19 merged commit 2f51f24 into ceph:main Sep 3, 2026
7 checks passed
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/33752307586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants