New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rgw]:Validate bucket names as per revised s3 spec #26787
Conversation
|
@mattbenjamin @pritha-srivastava @cbodley @yehudasa .. kindly review the changes. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
baa7a94
to
5cecc9a
Compare
|
unstale this |
|
we document our bucket name requirements in doc/radosgw/s3/bucketops.rst (see http://docs.ceph.com/docs/master/radosgw/s3/bucketops/#constraints) - could you please update that to reflect the changes? also worth mentioning which parts are conditional on rgw_relaxed_s3_bucket_names |
Sure. Will make the changes. |
5cecc9a
to
4eb3ab8
Compare
|
@cbodley .. |
|
yes please, we should limit to 63 as well |
Thanks. Will update. |
4eb3ab8
to
29096ae
Compare
|
jenkins render docs |
|
Doc render available at http://docs.ceph.com/ceph-prs/26787/ |
ce57225
to
bb855e0
Compare
|
jenkins render docs |
|
Doc render available at http://docs.ceph.com/ceph-prs/26787/ |
|
retest this please |
could you please replace this part of the commit message with: |
bb855e0
to
9c0a698
Compare
|
Done. |
c76492b
to
2b1bd35
Compare
Done. Please review. |
|
Hi all. I've tested this PR locally and I see that it is missing one rule for bucket names. Per the AWS S3 specification:
https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html I am able to create buckets that end with a period. |
Thanks David. I was referring to https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html while working on this. That page must not have been updated with this rule. @cbodley .. please let me know your thoughts. |
2b1bd35
to
88cb52f
Compare
|
good catch @monschein! |
88cb52f
to
a1109bc
Compare
|
jenkins retest this please |
|
@soumyakoduri One of my asking items is that RGW gets TWO toggles for bucket names: one toggle for strict bucket names on creation, and the other that still permits access to pre-existing buckets with names that can no longer be created. Can you confirm this is implemented in your PR? |
|
@robbat2 verifying that existing buckets with invalid names are still accessible is important, yeah. can you think of a reason, though, that an admin would want to deny access to existing buckets? what motivates that second toggle/config option? |
Specifically announcing a migration plan, and locking the old names at part of the enforcement stick. |
I verified this use-case -
Seems like the s3 bucket name is validated for every request which contains bucket name in 'postauth_init()'. As of now there is no option to toggle that behavior. To let old buckets (with invalid names) to be used post migration/upgrade, admin needs to set option "rgw relaxed s3 bucket names" to true. |
|
jenkins retest this please |
To avoid the old names becoming inaccessible post migration, we decided to validate s3 bucket names only during bucket creation now. This way old buckets (with relaxed names) can still be operated post migration but no new buckets with those invalid names can be created by default. If any need arises in future to enforce this validation for all requests , a new option can be added to toggle this behavior. But it is not being addressed as part of this PR. |
a1109bc
to
6b2126d
Compare
As per amazon s3 spec - https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html * The s3 bucket names should not contain upper case letters or underscore. * Name cannot end with dash or have consecutive periods, or dashes adjacent to periods. * Each label in the bucket name must start and end with a lowercase letter or a number. * Name cannot exceed 63 characters. This change is to enforce these rules if rgw_relaxed_s3_bucket_names is set to 'false' which is by default. Fixes: https://tracker.ceph.com/issues/36293 Signed-off-by: Soumya Koduri <skoduri@redhat.com>
6b2126d
to
eb6eddb
Compare
|
jenkins retest this please |
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
|
jenkins retest |
|
@soumyakoduri thanks for working through all the issues in testing! |
As per Amazon s3 spec, bucket names cannot contain underscore. https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html This (along with other naming convention mentioned in the doc) are being enforced via ceph/ceph#26787 This patch is to correct the bucket name generated in ragweed tests as well. Signed-off-by: Soumya Koduri <skoduri@redhat.com> (cherry picked from commit 7d4a729)
As per amazon s3 spec - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html The s3 bucket names should not contain upper case letters or underscore. Name cannot end with dash or have consecutive periods, or dashes adjacent to periods Name length shouldn't exceed 63 characters. These rules are being enforced via - ceph/ceph#26787 This patch is to update the respective testcases as well. Note: check_invalid_bucket_name() seems to have been broken. It should try to create bucket using invalid name. Have addressed it in this patch. Because of this few testcases (which were incorrectly passing earlier) are failing in validate_bucket_name. Have marked them 'fails_on_rgw' as done for test_bucket_create_naming_bad_punctuation Signed-off-by: Soumya Koduri <skoduri@redhat.com>
As per amazon s3 spec -
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html
The s3 bucket names should not contain upper case letters or underscore.
Name cannot end with dash or have consecutive periods, or dashes adjacent to periods
This change is to enforce these rules if rgw_relaxed_s3_bucket_names is set to 'false'.
Fixes: https://tracker.ceph.com/issues/36293
Signed-off-by: Soumya Koduri skoduri@redhat.com