]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw: anonomous swift to obj that dont exist should 401
authorMatthew Oliver <moliver@suse.com>
Wed, 26 Feb 2020 06:15:22 +0000 (06:15 +0000)
committerMatthew Oliver <moliver@suse.com>
Thu, 27 Feb 2020 07:11:08 +0000 (07:11 +0000)
commitb03d9754e113d24221f1ce0bac17556ab0017a8a
tree3cdf1ecef92056f8eaf7c4d75558f17d225ab79e
parente79e42467970c1be210d674e90dab21ce73e2872
rgw: anonomous swift to obj that dont exist should 401

Currently, if you attempt to GET and object in the Swift API that
doesn't exist and you don't pass a `X-Auth-Token` it will 404 instead of
401.

This is actually a rather big problem as it means someone can leak data
out of the cluster, not object data itself, but if an object exists or
not.

This is caused by the SwiftAnonymousEngine's, frankly wide open
is_applicable acceptance. When we get to checking the bucket or object
for user acceptance we  deal with it properly, but if the object doesn't
exsit, because the user has been "authorised" rgw returns a 404.

Why? Because we always override the user with the Swift account.
Meaning as far as checks are concerned the auth user is the user, not
and anonymous user.

I assume this is because a swift container could have world readable
reads or writes and in slight s3 and swift api divergents can make these
interesting edge cases leak in.

This patch doesn't change the user to the swift account if they are
anonymous. So we can do some anonymous checks when it suits later in the
request processing path.

Fixes: https://tracker.ceph.com/issues/43617
Signed-off-by: Matthew Oliver <moliver@suse.com>
src/rgw/rgw_auth.h
src/rgw/rgw_op.cc
src/rgw/rgw_swift_auth.h