prevent anonymous topic operations#49335
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
e105c83 to
88b14e4
Compare
src/rgw/rgw_rest_iam.cc
Outdated
| using namespace std; | ||
|
|
||
| void RGWHandler_REST_IAM::rgw_iam_parse_input() | ||
| using op_generator= std::function<RGWOp*(const bufferlist&)>; |
There was a problem hiding this comment.
using op_generator = RGWOp* (*)(const bufferlist&);works for gcc and clang in godbolt: https://godbolt.org/z/YGhT3z4xK
There was a problem hiding this comment.
it failed with "typedef", let me try "using".
There was a problem hiding this comment.
i have to be explicit with the return types of the lambdas
88b14e4 to
a006c53
Compare
|
jenkins test docs |
|
when running the S3 test suite, the |
a006c53 to
f7d1326
Compare
this failure is happening also on master (when running locally with vstart): https://tracker.ceph.com/issues/58365 |
|
jenkins test make check |
|
jenkins test make check |
| return true; | ||
| } | ||
|
|
||
| if (op == rgw::IAM::s3CreateBucket || op == rgw::IAM::s3ListAllMyBuckets) { |
There was a problem hiding this comment.
@yuvalif : can you help me understand why the check for CreateBucket/ListAllMyBuckets has been removed?
There was a problem hiding this comment.
@pritha-srivastava after my changes, we reach this line when we do bucket list, and return false.
why did we add this "if" statement i nthe first place?
There was a problem hiding this comment.
@yuvalif : iirc, I added that because if a user tries to create a bucket/ list all buckets and there wasn't any policy (user policy, or role policy or session policy) for the same, or the policy didn't have any action to allow these s3 ops, then the code would go to the last statement and return false and these ops would be denied, which shouldn't be. I added the check as part of this commit: acee911
There was a problem hiding this comment.
before my change, the code was doing the check only for bucket creation and listing all buckets.
so, for these operations nothing will change.
the change is that the chek will be done for other operation.
There was a problem hiding this comment.
But for other iam ops (like create oidc provider etc) the ops must be allowed only based on the evaluation of the policies and in the absence of these policies, the op must be denied.
There was a problem hiding this comment.
ok. so in the "common" function I should just return "false" if there is no policy?
and add the policy-less check to the verify_permission() of s3CreateBucket and s3ListAllMyBuckets ?
There was a problem hiding this comment.
actually if verify_user_permission() returns false we wouldn't know whether its an actual 'deny' or simply because the policies don't exist or the policy doesn't have an action for these ops. So a better option would be to change the return type of the current verify_user_permission() to reflect the return type of policy evaluation, and then have a wrapper verify_user_permission with return type bool, that can invoke this new verify_user_permission. In this case we can move the extra 'if' check part to CreateBucket and ListAllMyBuckets verify_permission().
There was a problem hiding this comment.
Policy is not mandatory in this case, a user with admin caps for oidc-provider can create an openidconnect provider in rgw.
There was a problem hiding this comment.
so, for the OIDC ops with no policy, we should run verify_user_permission_no_policy() and not fail immediatly?
this is not what the code initally did.
There was a problem hiding this comment.
No, for OIDC ops we do not need to go to verify_user_permission_no_policy(). Is it not possible to invoke verify_user_permission_no_policy() in CreateBucket/ListAllMyBuckets(), after policy evaluation is complete and the result is an Effect::Pass?
f7d1326 to
c552ce7
Compare
|
@yuvalif do you think it would be worth splitting out the refactoring so we can merge/backport the trivial fix? |
it is split to 2 commits. one for the refactoring and one for the topic authentication fix. |
|
baseline results |
seperate between the different non-bucket handler operations: iam, sts, sns (topic) and non bucket s3 ops Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
fixes: https://tracker.ceph.com/issues/58167 Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
c552ce7 to
5bb78ab
Compare
|
jenkins test api |
|
@pritha-srivastava could you please review the latest? |
looks good to me. |
thanks. can you please approve? |
|
teuthology results. main difference is the crash backtrace in multisite (showing an issue in tcmalloc): |
|
all teuthology failures are known issues. see: #48709 |
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows