Repository navigation
rgw: add s3control apis for account-wide PublicAccessBlock - #64293
Conversation
|
passing test case in ceph/s3-tests#669 |
|
make check arm64 |
|
i'm not sure why, but boto3 is adding the value of x-amz-account-id to the beginning of the host header for s3control requests:
when rgw_dns_name is set to localhost, this triggers our vhost-style logic which rewrites the path:
this doesn't match the path /v20180820/ so gets misinterpreted as s3. i think we need to change the vhost logic so it only applies to s3 requests |
Config Diff Tool Output! changed: rgw_enable_apis: old: s3, s3website, swift, swift_auth, admin, sts, iam, notifications (rgw.yaml.in)
! changed: rgw_enable_apis: new: s3, s3control, s3website, swift, swift_auth, admin, sts, iam, notifications (rgw.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
added commits up to "rgw/s3: apply vhost logic to s3 only" to resolve this |
the routing in RGWRESTMgr_S3 now tests for the x-amz-account-id request header to disambiguate, allowing the s3control api to be enabled by default: // s3control apis all expect the request header x-amz-account-id,
// and s3 apis don't. use that to disambiguate between s3control
// and requests to s3 buckets named v20180820
if (s3control && s->info.env->exists("HTTP_X_AMZ_ACCOUNT_ID")) { |
Apparently AWS serves s3-control API per account: https://docs.aws.amazon.com/general/latest/gr/s3.html#auto-endpoints-control-s3 |
so i guess this means we do not need a dedicated RGW endpoint for s3control |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
rebased over conflicts with #64251 |
| { | ||
| // s3control apis all expect the request header x-amz-account-id, | ||
| // and s3 apis don't. use that to disambiguate between s3control | ||
| // and requests to s3 buckets named v20180820 |
|
|
||
| int RGWDeletePublicAccessBlock_S3Control::verify_permission(optional_yield y) | ||
| { | ||
| const rgw::ARN arn{"", "root", account_id, false}; // XXX |
There was a problem hiding this comment.
Is the XXX because we need a proper ARN type for the account resource to modify?
There was a problem hiding this comment.
thanks, forgot about the XXX comment
it's a bit unclear what "Resource" arn is expected for iam policies when the resource is an account. afaik aws doesn't have an arn format for accounts, but this account-root-user arn seems to be the closest thing. this was discussed recently in #63945 (comment) for iam:GetAccountSummary so i did the same here
what do you think?
There was a problem hiding this comment.
in #68429 i had added a rgw::account::root_arn() helper function for exactly this, so i've updated this to use it
|
jenkins test make check |
|
I assume this needs s3-tests as well for QA. |
thanks for review! will schedule qa against ceph/s3-tests#669 |
the vhost-style transformations ran in RGWREST::preprocess() before we even route the request, so applied to every REST API in radosgw vhost-style requests are specific to the S3 API, so they should only apply after being routed to RGWRESTMgr_S3 extract the vhost logic from RGWREST::proprocess() into rgw_rest_transform_s3_vhost_style(), and call that only from RGWRESTMgr_S3::get_resource_mgr_as_default() url-decoding of request_uri into decoded_uri is now duplicated in preprocess() to apply to all requests, then again after vhost-style transforms the request_uri Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
s3tests for s3control and iam apis need to know the account id Signed-off-by: Casey Bodley <[email protected]>
i would prefer to run the s3control test coverage in rgw/verify, but it depends on rgw_dns_name configuration and support for wildcard dns which breaks most of the other rgw/verify test cases Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
this 'keytool' invocation was moved from qa/tasks/s3tests_java.py to qa/tasks/rgw.py so that it would also cover the java checksum tests but that means it runs for any rgw job with https enabled, even if it doesn't install or use any java stuff. the 'keytool' command itself comes from jdk packages which aren't installed by default ignore errors from this command so that subsuites can use https without installing java Signed-off-by: Casey Bodley <[email protected]>
|
|
jenkins test make check arm64 |
allow access to admin users that don't belong to the requested account. this is also necessary for multisite, where requests are forwarded to the metadata master as the multisite system user instead of the original requester Signed-off-by: Casey Bodley <[email protected]>
|
i've raised a separate pr #69111 for documentation changes so they can be reviewed without delaying merge here |
|
Please share regular updates on this |
|
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 |
When the `rgw_copious_policy_logging` option is set to true, a detailed trace of policy evaluation is logged. Assisted-by: Claude Opus 4.6 <[email protected]> (I wanted to see how it performed on rebase conflict resolution.) Assisted-by: Claude Fable 5 <[email protected]> (I figured I should have it look at the policy evaluation code for bugs while it's included, and it found a few mistakes in output.) Signed-off-by: Adam C. Emerson <[email protected]> Conflicts: src/common/options/rgw.yaml.in - Intervening options in upstream and other backports src/rgw/rgw_bucket_logging.cc - Clash with minimal environment production from <ceph#69264>. src/rgw/rgw_common.cc src/rgw/rgw_op.cc - Clash with change in `RestrictPublicBuckets` handling in <ceph#64293>. src/test/rgw/test_rgw_iam_policy.cc - Original commit modified upstream tests (keystone, etc.) not in downstream Fixes: https://tracker.ceph.com/issues/78662 (cherry picked from commit 7bdb627)
When the `rgw_copious_policy_logging` option is set to true, a detailed trace of policy evaluation is logged. Assisted-by: Claude Opus 4.6 <[email protected]> (I wanted to see how it performed on rebase conflict resolution.) Assisted-by: Claude Fable 5 <[email protected]> (I figured I should have it look at the policy evaluation code for bugs while it's included, and it found a few mistakes in output.) Signed-off-by: Adam C. Emerson <[email protected]> Conflicts: src/common/options/rgw.yaml.in - Intervening options in upstream and other backports src/rgw/rgw_bucket_logging.cc - Clash with minimal environment production from <ceph#69264>. src/rgw/rgw_common.cc src/rgw/rgw_op.cc - Clash with change in `RestrictPublicBuckets` handling in <ceph#64293>. src/test/rgw/test_rgw_iam_policy.cc - Original commit modified upstream tests (keystone, etc.) not in downstream Fixes: https://tracker.ceph.com/issues/78662 (cherry picked from commit 7bdb627)
When the `rgw_copious_policy_logging` option is set to true, a detailed trace of policy evaluation is logged. Assisted-by: Claude Opus 4.6 <[email protected]> (I wanted to see how it performed on rebase conflict resolution.) Assisted-by: Claude Fable 5 <[email protected]> (I figured I should have it look at the policy evaluation code for bugs while it's included, and it found a few mistakes in output.) Signed-off-by: Adam C. Emerson <[email protected]> Conflicts: src/common/options/rgw.yaml.in - Intervening options in upstream and other backports src/rgw/rgw_bucket_logging.cc - Clash with minimal environment production from <ceph#69264>. src/rgw/rgw_common.cc src/rgw/rgw_op.cc - Clash with change in `RestrictPublicBuckets` handling in <ceph#64293>. src/test/rgw/test_rgw_iam_policy.cc - Original commit modified upstream tests (keystone, etc.) not in downstream Fixes: https://tracker.ceph.com/issues/78662 (cherry picked from commit 7bdb627)
When the `rgw_copious_policy_logging` option is set to true, a detailed trace of policy evaluation is logged. Assisted-by: Claude Opus 4.6 <[email protected]> (I wanted to see how it performed on rebase conflict resolution.) Assisted-by: Claude Fable 5 <[email protected]> (I figured I should have it look at the policy evaluation code for bugs while it's included, and it found a few mistakes in output.) Signed-off-by: Adam C. Emerson <[email protected]> Conflicts: src/common/options/rgw.yaml.in - Intervening options in upstream and other backports src/rgw/rgw_bucket_logging.cc - Clash with minimal environment production from <ceph#69264>. src/rgw/rgw_common.cc src/rgw/rgw_op.cc - Clash with change in `RestrictPublicBuckets` handling in <ceph#64293>. src/test/rgw/test_rgw_iam_policy.cc - Original commit modified upstream tests (keystone, etc.) not in downstream Fixes: https://tracker.ceph.com/issues/78662 (cherry picked from commit 7bdb627)
we already support bucket-level PublicAccessBlock configuration through s3 PutBucketPublicAccessBlock. add support for s3control PutPublicAccessBlock to set configuration for a whole account. when both bucket and account configurations are present, take their union
rgw_enable_apis supports a new "s3control" entry that registers a RGWRESTMgr for the path "/v20180820/configuration/publicAccessBlock". because this path is hosted at the same endpoint as the s3 namespace, this would conflict with buckets named "v20180820".
for that reason, "s3control" is not enabled by default in rgw_enable_apispresence of the request headerx-amz-account-idis used to disambiguatehttps://docs.aws.amazon.com/AmazonS3/latest/userguide/configuring-block-public-access-account.html
Fixes: https://tracker.ceph.com/issues/71265
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