Repository navigation
rgw: suspend account-owned buckets (root user and account) - #70940
RaminNietzsche wants to merge 3 commits into
Conversation
|
@cbodley @adamemerson @yuvalif Could you take a look when you have time? Suspending an account root left account-owned buckets enabled because Local: |
|
Follow-up pushed:
Local build: |
|
@AliMasarweh Could you take a look when you have time? You already reviewed/approved the related per-bucket work in #69645. This PR is the complementary account-scoped side: account-root Happy to address any feedback. Local |
|
When this is ready for a review, please add the needs-review label. |
@ivancich Thanks — this is ready for review (not a draft). I don’t have permission to add labels on ceph/ceph; could you please add needs-review? |
|
ok to test |
| if (opt_cmd == OPT::ACCOUNT_MODIFY) { | ||
| if (opt_cmd == OPT::ACCOUNT_MODIFY || | ||
| opt_cmd == OPT::ACCOUNT_SUSPEND || | ||
| opt_cmd == OPT::ACCOUNT_ENABLE) { |
There was a problem hiding this comment.
it's a little awkward how these commands are combined with 'account modify', meaning that 'account suspend' could modify other fields too:
account suspend --account-name foo --max-buckets 10
There was a problem hiding this comment.
Agreed. account suspend / account enable now build a dedicated AdminOpState with only the account identity and the suspended flag, so they no longer share the account modify fields (50aa5689656).
| const bool suspension_changed = | ||
| op_state.suspended && static_cast<bool>(*op_state.suspended) != | ||
| static_cast<bool>(info.suspended); |
There was a problem hiding this comment.
why the static_casts? aren't those already bool?
There was a problem hiding this comment.
Removed. Suspension is compared and set via account_suspended() / set_account_suspended() on uint32_t flags in 50aa5689656.
| /* Apply bucket suspension after account_id / account-root are resolved so | ||
| * account root users disable account-owned buckets, not an empty uid list. */ | ||
| if (op_state.has_suspension_op()) { | ||
| ret = set_user_bucket_suspended(dpp, y, driver, user_info, |
There was a problem hiding this comment.
i don't think suspension of account root users should suspend the account's buckets. that's what 'account suspend' is for, right?
the account may have more than one root user. admins may want to suspend one and not others. suspension should only prevent that user from making requests
There was a problem hiding this comment.
You're right. user suspend on an account root should only block that user. An account can have more than one root, and freezing account-owned buckets belongs on account suspend.
50aa5689656 stops listing those buckets by account id on user suspend, so only that identity is disabled. account suspend still sets ACCOUNT_SUSPENDED and suspends account-owned buckets.
| static constexpr int32_t DEFAULT_ACCESS_KEY_LIMIT = 4; | ||
| int32_t max_access_keys = DEFAULT_ACCESS_KEY_LIMIT; | ||
|
|
||
| __u8 suspended{0}; |
There was a problem hiding this comment.
please change to uint32_t flags like RGWBucketInfo, so we can easily extend it in the future
There was a problem hiding this comment.
Done in 50aa5689656: RGWAccountInfo now uses uint32_t flags with ACCOUNT_SUSPENDED, plus account_suspended() / set_account_suspended(). Encoding is v4; v3 __u8 suspended still decodes.
cbodley
left a comment
There was a problem hiding this comment.
thanks, just some minor comments
| encode_json("flags", flags, f); | ||
| encode_json("suspended", account_suspended() ? 1 : 0, f); |
There was a problem hiding this comment.
please remove suspended from the json format so it doesn't duplicate information. adding both could lead to inconsistency/confusion - for example, an admin might try passing 'flags': 0, 'suspended': 1 to radosgw-admin metadata put and it wouldn't do what they want
There was a problem hiding this comment.
Done in 32f345b745c: RGWAccountInfo::dump() / decode_json() now only use flags, matching RGWBucketInfo. Thanks for flagging the inconsistency risk.
| flags |= ACCOUNT_SUSPENDED; | ||
| } | ||
| } else if (struct_v >= 4) { | ||
| decode(flags, bl); |
There was a problem hiding this comment.
we don't need both the v3 and v4 encodings, since the u8 part never merged. please just add the v3 encoding for uint32_t
There was a problem hiding this comment.
Agreed — the u8 path never merged. 32f345b745c uses a single struct v3 with uint32_t flags for encode/decode.
| account. Prefer ``account suspend`` / ``account enable`` to freeze or restore | ||
| an entire account (sets ``AccountInfo.suspended`` and suspends account-owned | ||
| buckets). Suspending an *account root* user has the same effect on account | ||
| buckets for compatibility with the older per-user workflow. Suspending a |
There was a problem hiding this comment.
this part about account root users is no longer accurate
There was a problem hiding this comment.
Updated in 32f345b745c: the User Suspend section now says only account suspend / account enable freeze account-owned buckets; suspending a user (including the account root) only disables that identity.
| bool account_suspended() const { | ||
| return (flags & ACCOUNT_SUSPENDED) != 0; | ||
| } |
There was a problem hiding this comment.
nit: account->account_suspended() is repetitive, consider suspended()
There was a problem hiding this comment.
Renamed to suspended() in 32f345b745c.
| bool account_suspended() const { | ||
| return (flags & ACCOUNT_SUSPENDED) != 0; | ||
| } | ||
| void set_account_suspended(bool suspended) { |
There was a problem hiding this comment.
flags is a public variable, so we don't really need a setter function for this. especially when there's only one caller, the bit manipulation can just live there. RGWBucketInfo only has getters for these flags
the goal of flags is to make this extensible, and i don't want to see more of these setters duplicated for different flag values
There was a problem hiding this comment.
Removed set_account_suspended() in 32f345b745c; the caller sets ACCOUNT_SUSPENDED on flags directly, consistent with how bucket flags are handled elsewhere.
|
@cbodley Thank you for the careful review and for approving. The round-2 feedback is addressed in I built I'll squash the commits before qa/merge as you suggested. Thanks again — this was much clearer with your guidance on separating |
32f345b to
f8d7777
Compare
|
Squashed the branch to three commits as requested:
Pushed to |
@RaminNietzsche, @adamemerson wanted to recognize your contributions and asked me to add you to the Ceph team. i thought i'd sent you an invite, but it doesn't look like you've joined. i can send it again if you'd like. you may need to enable github 2fa before you can accept |
Oh, nice! I’d be happy to join the Ceph team. that's very kind of @adamemerson, and I appreciate you checking. I'm sorry I missed the invite. Please send it again; I'll set up 2FA if needed and accept right away. Thanks for your help with the process. |
|
welcome :) that granted you write access to the repo, meaning that you can review/approve other prs and merge things. please make sure you understand the qa process before you do any merges yourself generally it's enough to add the 'needs-qa' label to get something picked up for qa. once the qa results are approved, someone else will merge the pr or add a 'ready-to-merge' label. once the pr checks are green, you're welcome to merge at that point |
@cbodley Thank you — I appreciate the welcome and the guidance. I'll read up on the QA process before merging anything myself. For now I'll use |
fadabfa to
49c929f
Compare
| .. note:: Ownership of all of the user's buckets will be transferred to | ||
| the account. | ||
| the account. Existing object ACLs may still name the pre-migration user | ||
| id as the object owner. Account members that rely on IAM (rather than |
There was a problem hiding this comment.
Existing object ACLs may still name the pre-migration user id as the object owner.
maybe another sentence along the lines of:
These objects will still be accessible to that user, but not to other users in the account.
There was a problem hiding this comment.
Added that sentence to the migration note in doc/radosgw/account.rst (commit 8c2aad3b6038):
Those objects remain accessible to that user, but not to other users in the account.
Rebased the branch onto current main (173b33c6d08b) and force-pushed to wip-rgw-79320-account-root-suspend. Local vstart: qa/workunits/rgw/test_account_root_suspend.sh still passes on the rebased tip.
|
This PR has been added to main integration testing by anuchaithra started 2026-10-09-10:05. |
49c929f to
8c2aad3
Compare
|
@cbodley Round-3 follow-up:
Could you take another look when you have time? |
pr testing completed and approved by @ivancich, more details in https://tracker.ceph.com/issues/81586. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
8c2aad3 to
f5bbadb
Compare
f5bbadb to
36caebd
Compare
Add radosgw-admin account suspend and account enable. Store suspension in RGWAccountInfo as uint32_t flags (ACCOUNT_SUSPENDED), encoded in struct v3 like RGWBucketInfo. account suspend marks account-owned buckets BUCKET_SUSPENDED and rejects requests from users and roles in that account at auth time. user suspend on an account root only disables that identity; it does not freeze account-owned buckets. Use account suspend for that. Dedicated AdminOpState for account suspend/enable so those commands do not share account modify fields. Fixes: http://tracker.ceph.com/issues/79320 Fixes: http://tracker.ceph.com/issues/79322 Signed-off-by: ramin.najarbashi <[email protected]>
Cover account suspend/enable (ACCOUNT_SUSPENDED flag and bucket BUCKET_SUSPENDED) and verify user suspend of an account root does not freeze account-owned buckets. Create users inside the account before uploading objects so ACLs are account-owned. Use a jq 1.6-safe flags check for teuthology. Signed-off-by: ramin.najarbashi <[email protected]>
Document account suspend/enable and note that migrating users into an account transfers bucket ownership while existing object ACLs may still name the pre-migration user; bucket chown with --account-id updates those object ACLs. Signed-off-by: ramin.najarbashi <[email protected]>
|
Rebased onto current |
36caebd to
d1c7ac3
Compare
|
@cbodley This has gone through testing, but still needs an approval. Can you take another look? |
|
@cbodley Gentle ping. All the review threads are addressed on the current tip |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Summary
Account-owned buckets are not listed under individual uids after users are
adopted into an RGW account. This series addresses suspension of those
resources in two complementary ways:
user suspendon aTYPE_ROOTuseronly disables that identity; it does not freeze account-owned buckets
(tracker #79320).
radosgw-admin account suspend|enablesets
RGWAccountInfoACCOUNT_SUSPENDEDinflags, marks accountbuckets
BUCKET_SUSPENDED, and rejects requests from users/roles in thataccount at auth time (tracker #79322).
Migrating an existing user with
user modify --account-idtransfers bucketownership to the account, but existing object ACLs may still name the
pre-migration user. Documented
bucket chown --account-idfor updating thoseobject ACLs when IAM members need access after migration.
Testing
ninja radosgw/radosgw-adminon local vstart; fullqa/workunits/rgw/test_account_root_suspend.shpass (account-first setup).make check/ arm64 green on prior tip; Windows failure was infra(
network is already active), unrelated to RGW account changes.jenkins test rgw:singletonChecklist
Show available Jenkins commands
jenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.