]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: anonomous swift to obj that dont exist should 401 35120/head
authorMatthew Oliver <moliver@suse.com>
Wed, 26 Feb 2020 06:15:22 +0000 (06:15 +0000)
committerVicente Cheng <freeze.bilsted@gmail.com>
Tue, 19 May 2020 06:44:18 +0000 (06:44 +0000)
commitcd2c08a07d404997539895d3394882cf48495ef3
treefc23a7a98e70bc73d625abb90fb2060b4402ff99
parent0c857e985a29d90501a285f242ea9c008df49eb8
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>
(cherry picked from commit b03d9754e113d24221f1ce0bac17556ab0017a8a)
src/rgw/rgw_auth.h
src/rgw/rgw_op.cc
src/rgw/rgw_swift_auth.h