Skip to content

rgw/s3: don't let ACL grants bypass governance retention - #73078

Open
jzhu116-bloomberg wants to merge 2 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-82087
Open

jzhu116-bloomberg wants to merge 2 commits into
ceph:mainfrom
jzhu116-bloomberg:wip-82087

Conversation

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor

AWS requires an explicit permission to:

To override or remove governance-mode retention settings, you must have the s3:BypassGovernanceRetention permission

This PR is to enforce the above and don't let the permission fall back to ACL.

Fixes: https://tracker.ceph.com/issues/82087
Signed-off-by: Jane Zhu [email protected]

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.

Comment thread src/rgw/rgw_common.cc Resolved
@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

if you don't want acls to apply to this op, i think you can just remove it from the switch statement in op_to_perm():

   case s3PutObjectLegalHold:
-  case s3BypassGovernanceRetention:
   case s3ReplicateDelete:
   case s3ReplicateObject:
   case s3ReplicateTags:
   case s3vectorsCreateIndex:
   case s3vectorsCreateVectorBucket:
   case s3vectorsDeleteIndex:
   case s3vectorsDeleteVectorBucket:
   case s3vectorsDeleteVectors:
   case s3vectorsPutVectors:
     return RGW_PERM_WRITE;

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor Author

if you don't want acls to apply to this op, i think you can just remove it from the switch statement in op_to_perm():

   case s3PutObjectLegalHold:
-  case s3BypassGovernanceRetention:
   case s3ReplicateDelete:
   case s3ReplicateObject:
   case s3ReplicateTags:
   case s3vectorsCreateIndex:
   case s3vectorsCreateVectorBucket:
   case s3vectorsDeleteIndex:
   case s3vectorsDeleteVectorBucket:
   case s3vectorsDeleteVectors:
   case s3vectorsPutVectors:
     return RGW_PERM_WRITE;

Removing the s3BypassGovernanceRetention case makes op_to_perm() return RGW_PERM_INVALID, which fails the ACL fallback for everyone, including the bucket owner, who today can bypass governance retention without any policy. I don't think we want to change the bucket owner's behavior. This PR only stops ACL grants to anyone else (including an uploader who doesn't own the bucket) from implying bypass, and keeps a bucket-owner-only fallback with the same perm_mask check as before.

@smanjara
smanjara self-requested a review November 10, 2026 19:07
@anrao19 anrao19 added the wip-anrao6-testing wip-anrao6-testing label Nov 13, 2026
@anrao19

anrao19 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-anrao6-testing-2026-11-13-0833-main.

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.

4 participants