Conversation
3926115 to
bc257a7
Compare
|
@cbodley : we found a test case that creates a role in an account here https://github.com/ceph/s3-tests/blob/master/s3tests_boto3/functional/test_iam.py:test_account_role_create. Is there any test case that tests assume role using cross account access (not tenants). |
the examples i found: |
bc257a7 to
893e852
Compare
893e852 to
74de6af
Compare
74de6af to
17d4cc1
Compare
17d4cc1 to
405a29d
Compare
| string key = "aws:userid"; | ||
| string value = user_info.type == TYPE_ROOT ? user_info.account_id : user_info.user_id.id; | ||
| s->env.emplace(key, value); |
There was a problem hiding this comment.
👍 but you can please update RemoteApplier too?
There was a problem hiding this comment.
sure, I find user_info is missing,
should I load user_info to check user type?
or without loading user_info can i proceed as I get userid
const AuthInfo info; string key = "aws:userid";
string value = info.acct_user.id;
s->env.emplace(key, value);There was a problem hiding this comment.
your use of AuthInfo info looks correct to me 👍
There was a problem hiding this comment.
thank you 👍🏻 pushed new update.
There was a problem hiding this comment.
👍 but you can please update RemoteApplier too?
@cbodley does this really apply to RemoteApplier?
There was a problem hiding this comment.
doesn't RemoteApplier support all the other interactions with iam policy? RemoteApplier::is_identity() matches policy Principals based on info.acct_user.id, and RemoteApplier::load_acct_info() produces a s->user whose uid comes from info.acct_user
There was a problem hiding this comment.
yes, but RemoteApplier is meant for Keystone/LDAP users, whereas GetCallerIdentity is mostly for IAM user/root user or roles.
We can add functionality for aws:userid to RemoteApplier, and then we will need to add implementation to its get_caller_indentity() method also? (right now it returns nullopt)
There was a problem hiding this comment.
yes, but RemoteApplier is meant for Keystone/LDAP users, whereas GetCallerIdentity is mostly for IAM user/root user or roles.
this is probably analogous to 'federated users' in sts? but our existing code presents these as normal s3 users
so i think RemoteApplier::get_caller_indentity() would return the same kind of user arn that it matches through is_identity(): "arn:aws:iam::{account id or tentant}:user/{userid}"
There was a problem hiding this comment.
ok, sounds fine to me. @ArbitCode : add implementation for get_caller_indentity() in RemoteApplier also
There was a problem hiding this comment.
@pritha-srivastava I added imp for get_caller_identity() in RemoteApplier
a2c84e2 to
570749a
Compare
|
Overall the PR looks fine to me. |
same! but we should add s3test coverage for this API - at least for LocalApplier and RoleApplier cases |
570749a to
f7a3b8c
Compare
src/rgw/rgw_auth.cc
Outdated
| std::unique_ptr<rgw::sal::User> user = driver->get_user(owner_acct_user); | ||
| auto user_info = user->get_info(); | ||
| bool has_account_id = !user_info.account_id.empty(); | ||
| std::string acct = has_account_id ? user_info.account_id : user_info.user_id.tenant; | ||
| if(user_info.type == TYPE_ROOT) { | ||
| return rgw::ARN("", "root", acct, true); |
There was a problem hiding this comment.
driver->get_user() just allocates a handle, it doesn't load it from the backend - and we shouldn't try to load it here
RemoteApplier::load_acct_info() will have already loaded this 'shadow user' if it exists, or called RemoteApplier::create_account() to make a new one
if get_caller_identity() needs additional information from the RGWUserInfo, load_acct_info() should stash that in a member variable like we do with the account info:
// account and policies are loaded by load_acct_info()
mutable std::optional<RGWAccountInfo> account;but if we're just trying to be consistent with what we match in RemoteApplier::is_identity(), this alone should be sufficient:
return rgw::ARN(owner_acct_user.id, "user", owner_acct_user.tenant, true);There was a problem hiding this comment.
okay, but there was a example where driver->get_user() was used RemoteApplier::create_account().
Yes, Below is sufficient.
return rgw::ARN(owner_acct_user.id, "user", owner_acct_user.tenant, true);cf785ae to
97b0bf9
Compare
| @@ -1032,11 +1032,20 @@ auto rgw::auth::RemoteApplier::load_acct_info(const DoutPrefixProvider* dpp) con | |||
|
|
|||
| void rgw::auth::RemoteApplier::modify_request_state(const DoutPrefixProvider* dpp, req_state* s) const | |||
There was a problem hiding this comment.
shouldn't RemoteApplier::get_caller_identity be moved to previous commit?
|
|
||
| std::optional<rgw::ARN> rgw::auth::RemoteApplier::get_caller_identity() const | ||
| { | ||
| return rgw::ARN(owner_acct_user.id, "user", owner_acct_user.tenant, true); |
There was a problem hiding this comment.
@cbodley : are keystone/ldap users created under accounts? from the comments I see handling for global tenant/implicit tenants only.
There was a problem hiding this comment.
are keystone/ldap users created under accounts?
no, RemoteApplier::create_account() only creates the 'shadow user' - no 'shadow accounts'
though once a shadow user exists, it is possible to migrate that into an account via https://docs.ceph.com/en/latest/radosgw/account/#migrate-an-existing-user-into-an-account
65e38fa to
abd127c
Compare
abd127c to
64444ba
Compare
64444ba to
abc3e75
Compare
Tracker: https://tracker.ceph.com/issues/72157 Signed-off-by: Raja Sharma <raja@ibm.com>
Tracker: https://tracker.ceph.com/issues/72157 Signed-off-by: Raja Sharma <raja@ibm.com>
abc3e75 to
a6e6885
Compare
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition