Project

General

Profile

Actions

Bug #76792

open
PQ CB

keystone: Attached policy not delegating all features

Bug #76792: keystone: Attached policy not delegating all features

Added by Pierre-Olivier Quirion 6 months ago. Updated 3 months ago.

Status:
Need More Info
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Community (user)
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

I have a use case where I am delegating all admin features to user admin0 in my account:

aws iam list-attached-user-policies --user-name admin0

{
    "AttachedPolicies": [
        {
            "PolicyName": "AmazonS3FullAccess",
            "PolicyArn": "arn:aws:iam::aws:policy/AmazonS3FullAccess" 
        },
        {
            "PolicyName": "AmazonSNSFullAccess",
            "PolicyArn": "arn:aws:iam::aws:policy/AmazonSNSFullAccess" 
        },
        {
            "PolicyName": "IAMFullAccess",
            "PolicyArn": "arn:aws:iam::aws:policy/IAMFullAccess" 
        }
    ]
}

Note that the admin0 is a keystone user.

admin0 is able to create users in the account, create new buckets and attach policies to user and bucket, but it cannot setting or getting tags (note that I have not tested all possible actions.

I expect admin0 to be able to do all action involving S3;* operations per `AmazonS3FullAccess` but there is an action that cannot be done: s3:GetBucketTagging


import boto3

session = boto3.Session(profile_name=profile) # admin0 credential

client = session.client(
        "s3",
        config=boto3.session.Config(s3={"addressing_style": "path"}),
    )

client.get_bucket_tagging(Bucket=bucket)

Will get:


  File "/home/poq/.local/lib/python3.13/site-packages/botocore/client.py", line 1094, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.AccessDenied: An error occurred (AccessDenied) when calling the GetBucketTagging operation: None

While the root account has no difficulty to getting tags.

PQ Updated by Pierre-Olivier Quirion 6 months ago Actions #1

  • Severity changed from 3 - minor to 2 - major

PQ Updated by Pierre-Olivier Quirion 6 months ago Actions #2

And what I mean by a user account is a user in the IAM user list.

aws iam list-users
{
    "Users": [
        {
            "Path": "/",
            "UserName": "admin0",
            "UserId": "337099167a984c338aed797aace39f78$337099167a984c338aed797aace39f78",
            "Arn": "arn:aws:iam::RGW42321810104104278:user/admin0",
            "CreateDate": "1969-12-31T19:00:00-05:00" 
        }
    ]
}

Not that user admin0 is the tenant of a project managed with keystone. We added admin0 to the user account list so all the existing buckets of that tenant were transferred to the root user. Our goal it to give back admin access of all these buckets to the tenant and also let the tenant manage the account. This use case lets a tenant manage by keystone the possibility of creating and revoking its own s3 keys with the OpenStack client and also let the tenant manage the user account.

JI Updated by J. Eric Ivancich 6 months ago Actions #3

  • Assignee set to Casey Bodley

CB Updated by Casey Bodley 6 months ago Actions #4

  • Status changed from New to Need More Info

Pierre-Olivier Quirion wrote in #note-2:

Not that user admin0 is the tenant of a project managed with keystone. We added admin0 to the user account list so all the existing buckets of that tenant were transferred to the root user. Our goal it to give back admin access of all these buckets to the tenant and also let the tenant manage the account. This use case lets a tenant manage by keystone the possibility of creating and revoking its own s3 keys with the OpenStack client and also let the tenant manage the user account.

thanks for the context. i spent some time investigating this with normal rgw users, and couldn't reproduce any issues with GetBucketTagging policy. so i assume this behavior is specific to keystone auth, and we don't have any test coverage that combines accounts and keystone to reproduce this. would you feel comfortable sharing a debug log (debug_rgw=20 debug_ms=1) of this particular request? you probably want to sanitize any addresses and credentials

PQ Updated by Pierre-Olivier Quirion 6 months ago Actions #5

I should be able to coordinate with my team to run the tests with the request config. In the mean time, I have found a surprising way of going around the problem:

The keystone user (admin0) is able to manage the iam account witout much restrictions using its keystone credentials, so I created a set of iam credentials for it and started using them... and it worked:

```bash
aws --profile admin0 iam list-access-keys --user-name admin0 {
"AccessKeyMetadata": []
}
```

```
aws iam --profile admin0 create-access-key --user-name admin0 {
"AccessKey": {
"UserName": "admin0",
"AccessKeyId": "<AccessKeyId>",
"Status": "Active",
"SecretAccessKey": "<SecretAccessKey>",
"CreateDate": "2026-06-04T19:14:43.452881+00:00"
}
}

```

I am able to tag my bucket with these credentials... Which is a bit surprising.

CB Updated by Casey Bodley 3 months ago ยท Edited Actions #6

Pierre-Olivier Quirion wrote in #note-5:

I should be able to coordinate with my team to run the tests with the request config.

any updates on this?

I am able to tag my bucket with these credentials... Which is a bit surprising.

using those credentials would avoid keystone auth. so that sounds consistent with my comment above:

i spent some time investigating this with normal rgw users, and couldn't reproduce any issues with GetBucketTagging policy. so i assume this behavior is specific to keystone auth

CB Updated by Casey Bodley 3 months ago Actions #7

  • Subject changed from Attached policy not delegating all features to keystone: Attached policy not delegating all features

PQ Updated by Pierre-Olivier Quirion 3 months ago Actions #8

Update:

We have just found -- today, to be precise -- a developer with the bandwidth to run the tests. So, no logs yet, but at least someone will officially working on it on our side.

Actions

Also available in: PDF Atom