Bug #68492
openrgw: sync S3 API ACLs with Swift API ACLs
0%
Description
While the keystone is used as a primary identity service, Ceph S3 API doesn't honor ACLs created with Ceph Swift API and vice versa.
S3 API ACLs refer only to RGW internal user account, and don't honor keystone user accounts.
Basically if you set ACL rules using Swift API, they're applicable only to Swift API and further access with S3 API using EC2 credentials won't work.
Use case:
- I have a CONSUMER1 user in SHARED project with a single noop role (this is required to make EC2 auth work, otherwise it will fail)
- I create a CONSUMER_BUCKET1 bucket and set ACL rules using Swift API ( -H "X-Container-Read: SHARED_PROJECT_ID:CONSUMER1_ID" -H "X-Container-Write: SHARED_PROJECT_ID:CONSUMER1_ID" )
Result:
- in OpenStack Swift I can access the bucket using S3 API ( expected behavior ):
$ curl -s "https://swift.local/CONSUMER_BUCKET1/hello.txt" --aws-sigv4 aws:amz:default:s3 -u CONSUMER1_ACCESS:CONSUMER1_KEY gotcha
- in Ceph RGW I can't access the bucket using S3 API ( unexpected behavior ):
$ curl -s "https://ceph.local/CONSUMER_BUCKET1/hello.txt" --aws-sigv4 aws:amz:default:s3 -u CONSUMER1_ACCESS:CONSUMER1_KEY <?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidAccessKeyId</Code><Message></Message><RequestId>XXX</RequestId><HostId>XXX</HostId></Error>
However if I assign an admin role, which is specified in rgw keystone integration, CONSUMER1 can access an object, but CONSUMER1 will be able to access all account buckets as well, which is not what I need.
Also here is a difference between Ceph S3 ACL API:
$ aws --endpoint-url https://ceph.local/ s3api get-bucket-acl --bucket CONSUMER_BUCKET1
{
"Owner": {
"DisplayName": "SHARED",
"ID": "SHARED_PROJECT_ID$SHARED_PROJECT_ID"
},
"Grants": [
{
"Grantee": {
"DisplayName": "SHARED",
"ID": "SHARED_PROJECT_ID$SHARED_PROJECT_ID",
"Type": "CanonicalUser"
},
"Permission": "FULL_CONTROL"
}
]
}
and OpenStack Swift S3 ACL API:
$ aws --endpoint-url https://swift.local/ s3api get-bucket-acl --bucket CONSUMER_BUCKET1
{
"Owner": {
"DisplayName": "SHARED:CONSUMER1",
"ID": "SHARED:CONSUMER1"
},
"Grants": [
{
"Grantee": {
"DisplayName": "SHARED:CONSUMER1",
"ID": "SHARED:CONSUMER1",
"Type": "CanonicalUser"
},
"Permission": "FULL_CONTROL"
}
]
}
While OpenStack Swift refers to a keystone user IDs, Ceph RGW refers to internal user IDs, which were generated based on the keystone project ID, and RGW has no reference to a keystone user ID.
Some info about the EC2 auth credentials using https://github.com/kayrus/ec2auth tool:
$ ec2auth -access CONSUMER1_ACCESS -secret CONSUMER1_KEY -debug 2>&1 | grep -A5 '"roles":'
2024/10/10 13:50:08 <- "roles": [
2024/10/10 13:50:08 <- {
2024/10/10 13:50:08 <- "id": "2d4b16626cf44e19a654d8aff12c3531",
2024/10/10 13:50:08 <- "name": "noop"
2024/10/10 13:50:08 <- }
2024/10/10 13:50:08 <- ],
see also:
JI Updated by J. Eric Ivancich about 2 years ago
- Priority changed from Normal to Low
Unfortunately there are no engineers currently working to maintain swift. So that we don't revisit these issues weekly, we've decided to set them to low priority until an engineer steps up to work on swift. Ideally a number of engineers would step up, because we need people to do code reviews, add tests, run tests, etc.
SC Updated by Senol Colak over 1 year ago
I’d like to kindly ask for a reconsideration of this ticket’s priority. Since it was first opened, the situation has evolved: both the OpenStack and Ceph communities now actively promote RGW as the default Swift-compatible backend. With OpenStack-Ansible and other deployments relying on RGW for Swift + Keystone integration, issues like this one directly affect production environments(and people on considering Ceph as a S3 alternative on their Openstack offering). As RGW increasingly replaces native Swift, ensuring feature completeness and stability has become essential. Appreciate your time and all the work you do.
SC Updated by Senol Colak 7 months ago
SC Updated by Senol Colak 3 months ago
Fix verified on a live squid + Keystone RGW deployment; cross-API and *:* ACL evaluation now works as specified.