Skip to content

rgw: support S3 Object Ownership controls to disable object ACLs - #64152

Merged
yuriw merged 9 commits into
ceph:mainfrom
cbodley:wip-63323
Sep 19, 2025
Merged

yuriw merged 9 commits into
ceph:mainfrom
cbodley:wip-63323

Conversation

@cbodley

@cbodley cbodley commented Jun 24, 2025 •

Copy link
Copy Markdown
Contributor

https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html

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

TODO:

  • authorization ignores object acls for BucketOwnerEnforced
  • reject PutACLs for BucketOwnerEnforced
  • handle ObjectOwnership interactions with canned acls on object uploads
  • CreateBucket accepts header x-amz-object-ownership: BucketOwnerPreferred | ObjectWriter | BucketOwnerEnforced
  • Put/Get/DeleteBucketOwnershipControls
  • 'bucket chown' skips object acl updates for BucketOwnerEnforced
  • s3tests s3: test object ownership s3-tests#660
Show available Jenkins commands

@cbodley cbodley changed the title rgw: support S3 Object Ownership controls to disable objects ACLs rgw: support S3 Object Ownership controls to disable object ACLs Jun 24, 2025
@cbodley
cbodley marked this pull request as ready for review June 25, 2025 12:48
@cbodley
cbodley requested a review from a team as a code owner June 25, 2025 12:48
@cbodley
cbodley requested a review from a team as a code owner June 27, 2025 17:18
@cbodley cbodley removed the needs-doc label Jun 27, 2025
@adamemerson adamemerson self-assigned this Jul 2, 2025
Comment thread doc/radosgw/s3/bucketops.rst Outdated

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.

i think you are missing the doc for the new PUT/GET/DELETE operations

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

rebased over conflict with #64251

@chardan chardan 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.

This looks ok to me-- it's probably good to get some further feedback from others who might be more familiar with the feature itself, but code looks fine! Thanks for your work on this.

Comment thread src/rgw/rgw_acl_s3.cc Resolved
Comment thread src/rgw/rgw_bucket.cc Resolved
Comment thread src/rgw/rgw_object_ownership.cc Resolved
Comment thread src/rgw/rgw_object_ownership.h Resolved
Comment thread src/rgw/rgw_object_ownership.cc Resolved
Comment thread src/rgw/rgw_op.cc Resolved
Comment thread src/rgw/rgw_rest_s3.cc Resolved
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

cbodley added 6 commits July 30, 2025 15:31
when object uploads specify a canned acl, they call create_canned_acl()
to build the corresponding RGWAccessControlPolicy

ObjectOwnership adds two special cases to this:
* BucketOwnerEnforced denies acls other than "bucket-owner-full-control"
* BucketOwnerPreferred overrides owner for "bucket-owner-full-control"

Signed-off-by: Casey Bodley <[email protected]>
Comment thread src/rgw/rgw_op.cc
rgw::s3::OwnershipControls controls;
controls.object_ownership = *object_ownership;
encode(controls, createparams.attrs[RGW_ATTR_OWNERSHIP_CONTROLS]);
} // TODO: config option to set default ownership when not requested

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.

Should we make a feature tracker for this? You can assign it to me. I just don't want this to get forgotten, since it's access control related and we should be able to match the default Amazon behavior if configured so users don't get surprised.

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.

thanks, i created an rfe in https://tracker.ceph.com/issues/72373. as i mention there, it might be very challenging to test non-default configurations

Comment thread src/rgw/rgw_op.cc

using rgw::s3::ObjectOwnership::BucketOwnerEnforced;
if (ownership.object_ownership == BucketOwnerEnforced) {
// reject BucketOwnerEnforced if the bucket's acl doesn't

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 should add in docs/release note somewhere that this doesn't match the Amazon behavior of suspending ACL enforcement and re-enabling it with the saved ACLs if changed from ObjectWriter to OwnerEnforced and back.

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.

i assume you're talking about the "Re-enabling ACLs" section under https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html#object-ownership-changes?

changing between ObjectWriter and BucketOwnerEnforced doesn't modify any object acls, authorization just ignores object acls when BucketOwnerEnforced. when switching back to ObjectWriter, those preexisting object acls would start being enforced again. isn't this the same behavior as aws?

@adamemerson

Copy link
Copy Markdown
Contributor

jenkins test make check

@adamemerson

Copy link
Copy Markdown
Contributor

@cbodley IS this QA-able or do we need some S3tests we're waiting on?

@cbodley

cbodley commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

@cbodley IS this QA-able or do we need some S3tests we're waiting on?

there are tests in ceph/s3-tests#660. i can rebase them and start qa

@cbodley

cbodley commented Sep 16, 2025

Copy link
Copy Markdown
Contributor Author

@cbodley IS this QA-able or do we need some S3tests we're waiting on?

there are tests in ceph/s3-tests#660. i can rebase them and start qa

qa pending in https://pulpito.ceph.com/cbodley-2025-09-16_20:27:49-rgw-wip-63323-distro-default-gibba/

@yuriw

yuriw commented Sep 18, 2025

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

@yuriw
yuriw merged commit b1cdf2f into ceph:main Sep 19, 2025
@github-actions

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/17861807667

@cbodley

cbodley commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

cc @adamemerson @ivancich we need to come up with a process that handles pr validation with custom s3-tests. the needs-qa label caused this to be merged without its test coverage

@MaximMonin

Copy link
Copy Markdown

This commit was merged 5 months ago. But it's missing in version 20 (tentacle). Should I wait for version 21, or will it be included in 20.2.x?

@cbodley

cbodley commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

Should I wait for version 21, or will it be included in 20.2.x?

@MaximMonin sorry, there are no plans to backport for tentacle - backports are usually reserved for bug fixes

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.

6 participants