Bug 1974678 - rgw/sts: assumed-role: s3api head-object returns 403 Forbidden, even if role has ListBucket, for non-existent object
Summary: rgw/sts: assumed-role: s3api head-object returns 403 Forbidden, even if role ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RGW
Version: 4.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.2z3
Assignee: Matt Benjamin (redhat)
QA Contact: Gaurav Sitlani
Aron Gunn
URL:
Whiteboard:
Depends On:
Blocks: 1890121 2006184
TreeView+ depends on / blocked
 
Reported: 2021-06-22 09:47 UTC by Pritha Srivastava
Modified: 2024-12-20 20:18 UTC (History)
11 users (show)

Fixed In Version: ceph-14.2.11-187.el8cp, ceph-14.2.11-187.el7cp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2006184 (view as bug list)
Environment:
Last Closed: 2021-09-27 18:26:24 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ceph ceph pull 40631 0 None closed rgw/sts: read_obj_policy() consults iam_user_policies on ENOENT 2021-06-22 09:47:21 UTC
Red Hat Issue Tracker RHCEPH-384 0 None None None 2021-08-24 08:06:45 UTC
Red Hat Product Errata RHBA-2021:3670 0 None None None 2021-09-27 18:26:47 UTC

Description Pritha Srivastava 2021-06-22 09:47:21 UTC
From upstream tracker:


I am using 15.2.7 on CentOS 8, and am using awscli

1. If I access a bucket with the bucket owner credentials, and hence full access, including s3:ListBucket, and execute a head-object on a non-existent object, I get 404 Not Found. This is expected
2. If I access a bucket as a user without any permissions to the bucket, but first assuming a role via (sts assume-role) that grants me s3:* on the bucket, which includes s3:ListBucket, I get 403 Forbidden. (If the object exists I get the header back).

On AWS, using the same role and policy, (adjusting for usernames and bucket names) if I do #2, I get 404 Not Found, which is what I expect, given that I have s3:ListBucket on that bucket

According to the AWS documentation at: https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html , If I have s3:ListBucket, which the role policy gives me, then I should get 404 Not found if I do head-object on a non-existent object.

Thus this appears to be a bug. I found the following bug from the past that seems similar but for the bucket owner and/or bucket attached policies: https://tracker.ceph.com/issues/38638

This is causing our software to not work on Ceph but fine on AWS.

I have attached a doctored sample policy that has s3:*, originally retrieved via aws s3api get-role-policy

Comment 14 errata-xmlrpc 2021-09-27 18:26:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 4.2 Bug Fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3670

Comment 15 Red Hat Bugzilla 2023-09-15 01:10:20 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.