Skip to content

rgw/sts: RoleApplier respects ACL grants for account roles - #66078

Closed
cbodley wants to merge 1 commit into
ceph:mainfrom
cbodley:wip-73659
Closed

cbodley wants to merge 1 commit into
ceph:mainfrom
cbodley:wip-73659

Conversation

@cbodley

@cbodley cbodley commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor

instead of returning 0 from RoleApplier::get_perms_from_aclspec(), call rgw_perms_from_aclspec_default_strategy() to check for matching ACL grants

this fixes a regression from commit b021d0f when identity/session policy implicitly deny a request. previously, these requests could be granted based on bucket ownership

add the missing RoleApplier support to grant access based on ACLs

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

Show available Jenkins commands

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

@cbodley
cbodley requested a review from a team as a code owner October 28, 2025 14:43
@github-actions github-actions Bot added the rgw label Oct 28, 2025
Comment thread src/rgw/rgw_auth.cc
Comment on lines +1214 to +1217
uint32_t rgw::auth::RoleApplier::get_perm_mask() const
{
return RGW_PERM_FULL_CONTROL;
}

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.

this was previously returning RGW_PERM_NONE, which ended up in s->perm_mask and caused an early exit from verify_bucket_permission_no_policy() here: https://github.com/ceph/ceph/blob/63ca1ffb5a/src/rgw/rgw_common.cc#L1454-L1455

@cbodley

cbodley commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

after the get_perm_mask() update, this is passing the test cases in ceph/s3-tests#703. these tests don't add any role or session policy, so we fall back to bucket acls. test_assume_role_owner_allow() and test_assume_role_owner_deny() just test default acls for same/different bucket owner. test_assume_role_acl_allow() tests an acl grant via GrantReadACP for s3:GetBucketLocation

@cbodley

cbodley commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

qa pending https://pulpito.ceph.com/cbodley-2025-10-28_19:32:41-rgw-wip-73659-distro-default-gibba/

the rgw/sts jobs show an existing test case test_session_policy_bucket_policy_role_arn() failing - s3_client.get_object() succeeds where the test expects AccessDenied

        bucket_body = 'this is a test file'
        s3_put_obj = s3_client.put_object(Body=bucket_body, Bucket=bucket_name_1, Key="test-1.txt")
        assert s3_put_obj['ResponseMetadata']['HTTPStatusCode'] == 200

        try:
            obj = s3_client.get_object(Bucket=bucket_name_1, Key="test-1.txt")
        except ClientError as e:
            s3object_error = e.response.get("Error", {}).get("Code")
>       assert s3object_error == 'AccessDenied'
E       UnboundLocalError: local variable 's3object_error' referenced before assignment

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

the rgw/sts jobs show an existing test case test_session_policy_bucket_policy_role_arn() failing

added a commit to ceph/s3-tests#703 as discussed with Pritha

rerun pending in https://pulpito.ceph.com/cbodley-2025-10-29_14:42:26-rgw-wip-73659-distro-default-gibba

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins build docs

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test docs

@cbodley

cbodley commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

1 similar comment
@cbodley

cbodley commented Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Oct 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test docs

@cbodley

cbodley commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test docs

instead of returning 0 from RoleApplier::get_perms_from_aclspec(), call
rgw_perms_from_aclspec_default_strategy() to check for matching ACL grants

add the missing RoleApplier support to grant access based on ACLs

Signed-off-by: Casey Bodley <[email protected]>
@cbodley cbodley changed the title rgw/sts: RoleApplier respects ACL grants rgw/sts: RoleApplier respects ACL grants for account roles Nov 10, 2025
@cbodley cbodley removed the TESTED label Nov 10, 2025
@cbodley

cbodley commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

@pritha-srivastava as discussed, i removed the tenant part of this acl support

i'll look at replacing the tenant-style tests in ceph/s3-tests#703 with cross-account acl tests

@pritha-srivastava

Copy link
Copy Markdown
Contributor

@pritha-srivastava as discussed, i removed the tenant part of this acl support

i'll look at replacing the tenant-style tests in ceph/s3-tests#703 with cross-account acl tests

looks fine to me

@github-actions github-actions Bot added the stale label Jan 11, 2026
@cbodley cbodley removed the stale label Jan 12, 2026
@ceph ceph deleted a comment from github-actions Bot Jan 13, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@cbodley

cbodley commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

i'll look at replacing the tenant-style tests in ceph/s3-tests#703 with cross-account acl tests

done in ceph/s3-tests#703

@cbodley

cbodley commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley cbodley added the TESTED label Apr 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jun 13, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Jul 13, 2026
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.

2 participants