Project

General

Profile

Bug #21578

s3:GetBucketCORS/s3:PutBucketCORS policy fails with 403

Added by Adam Emerson 3 months ago. Updated 3 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
Start date:
09/27/2017
Due date:
% Done:

0%

Source:
Q/A
Tags:
rgw
Backport:
luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
luminous
Needs Doc:
No

Description

Upstream counterpart to Red Had Bugzilla #1494140

After setting the policy, set_cors_xml()/set_cors() or get_cors_xml()/get_cors() fail to work.

Version-Release number of selected component (if applicable):
ceph-radosgw-12.2.0-2.el7cp.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create a bucket with tenant user testx$tester
2. Write a bucket policy providing s3:GetBucketCORS/s3:PutBucketCORS to another user in the same or different tenant
3. After setting the policy, try setting/getting CORS configuration on the bucket using the permitted user credentials

Actual results:
S3ResponseError: 403 Forbidden

Expected results:
Should successfully allow the user to set/get CORS configuration.

Additional info:

Bucket policy:

{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"AWS": ["arn:aws:iam::testy:user/u2"]},
"Action": ["s3:ListBucket", "s3:GetBucketCORS", "s3:PutBucketCORS"],
"Resource": [
"arn:aws:s3::*:my-bucket",
"arn:aws:s3::*:my-bucket/*"
]
}]
}

  1. s3cmd -c s3test.cfg setpolicy getputcors s3://my-bucket

Boto script with the user credentials of testy$u2:

b = conn.get_bucket("testx:my-bucket")

cors_conf = """
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
"""
b.set_cors_xml(cors_conf)
print b.get_cors()


Related issues

Copied to rgw - Backport #21635: luminous: s3:GetBucketCORS/s3:PutBucketCORS policy fails with 403 In Progress

History

#1 Updated by Adam Emerson 3 months ago

  • Status changed from Verified to Need Review

#2 Updated by Adam Emerson 3 months ago

  • Status changed from Need Review to Need Test

#3 Updated by Matt Benjamin 3 months ago

  • Status changed from Need Test to Pending Backport

#4 Updated by Nathan Cutler 2 months ago

  • Copied to Backport #21635: luminous: s3:GetBucketCORS/s3:PutBucketCORS policy fails with 403 added

Also available in: Atom PDF