Project

General

Profile

Actions

Bug #61916

open

qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth fail

Added by Casey Bodley 10 months ago. Updated 9 months ago.

Status:
Pending Backport
Priority:
Urgent
Target version:
-
% Done:

0%

Source:
Tags:
sts backport_processed
Backport:
pacific quincy reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

until https://github.com/ceph/ceph/pull/52216, we only ran the test cases marked sts_tests and webidentity_tests in this configuration. now that we run all test cases, these two ListBuckets tests are failing with the wrong error code

ex. http://qa-proxy.ceph.com/teuthology/cbodley-2023-06-30_13:14:21-rgw-main-distro-default-smithi/7322679/teuthology.log


Related issues 3 (1 open2 closed)

Copied to rgw - Backport #62412: reef: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth failResolvedKonstantin ShalyginActions
Copied to rgw - Backport #62413: pacific: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth failRejectedKonstantin ShalyginActions
Copied to rgw - Backport #62414: quincy: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth failIn ProgressKonstantin ShalyginActions
Actions #1

Updated by Casey Bodley 10 months ago

  • Assignee set to Pritha Srivastava
Actions #2

Updated by Pritha Srivastava 10 months ago

When sts is enabled, LocalEngine fails to aunthenticate, but error INVALID_ACCESS_KEY gets converted to error EACESS as shown in logs below:

s3:list_buckets cache get: name=default.rgw.meta+users.keys+badauth : hit (negative entry)
2023-07-14T13:42:28.672+0530 7fd0da7946c0 5 req 13384521065249685102 0.002000010s s3:list_buckets error reading user info, uid=badauth can't authenticate
2023-07-14T13:42:28.672+0530 7fd0da7946c0 20 req 13384521065249685102 0.002000010s s3:list_buckets rgw::auth::s3::LocalEngine denied with reason=-2028
2023-07-14T13:42:28.672+0530 7fd0da7946c0 20 req 13384521065249685102 0.002000010s s3:list_buckets rgw::auth::s3::AWSAuthStrategy denied with reason=-13
2023-07-14T13:42:28.672+0530 7fd0da7946c0 5 req 13384521065249685102 0.002000010s s3:list_buckets Failed the auth strategy, reason=-13

Whereas when sts is NOT enabled, then error INVALID_ACCESS_KEY remains as is, as shown in logs below:

2023-07-14T13:55:46.339+0530 7fe93279c6c0 5 req 13980072073565935116 0.000000000s s3:list_buckets error reading user info, uid=badauth can't authenticate
2023-07-14T13:55:46.339+0530 7fe93279c6c0 20 req 13980072073565935116 0.000000000s s3:list_buckets rgw::auth::s3::LocalEngine denied with reason=-2028
2023-07-14T13:55:46.339+0530 7fe93279c6c0 20 req 13980072073565935116 0.000000000s s3:list_buckets rgw::auth::s3::AWSAuthStrategy denied with reason=-2028

Need to figure out why the conversion is happening.

Actions #3

Updated by Pritha Srivastava 10 months ago

So according to the design, if sts auth or any external auth is enabled, then LocalEngine serves as a 'Fallback' auth engine, and in that case the error code of the previous auth engine has to be returned. And if LocalEngine is the only available auth engine, then whatever error code it returns is returned back. This means that if any auth engine other than Local Engine is enabled, the requests need to be authenticated by the other engine, and hence the error code - which is 'Access Denied' is returned in this case. And STS Engine returns EACCES, because there is no HTTP_X_AMZ_SECURITY_TOKEN, in the incoming request.
I am not sure why the design is such that we allow requests to be successfully authenticatedby the 'Fallback' LocalEngine (even when it would have been Denied by the other engines), and in case of failures we return the error code returned by the other (sts or external) auth engine.

Actions #4

Updated by Pritha Srivastava 10 months ago

Currently, the auth engines return deny with EACCES that indicates that it doesnt apply, and then while evaluating the policy, we can have this special handling which checks to see if the 'reason' for failure is 'EACCES' by the previous auth engine, then the error code returned by LocalEngine will be picked up. But EACCES, is returned by some auth engines for other failure scenarios also. We could either change the default error code to something else when the engine is not applicable, or we can change the error codes in the auth engines to NOT return EACCES in any other scenario. The latter might break some tests. Which approach do you think is preferable @casey?

Actions #5

Updated by Casey Bodley 9 months ago

  • Status changed from New to Fix Under Review
  • Backport set to pacific quincy reef
  • Pull request ID set to 52510
Actions #6

Updated by Casey Bodley 9 months ago

  • Status changed from Fix Under Review to Pending Backport
Actions #7

Updated by Backport Bot 9 months ago

  • Copied to Backport #62412: reef: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth fail added
Actions #8

Updated by Backport Bot 9 months ago

  • Copied to Backport #62413: pacific: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth fail added
Actions #9

Updated by Backport Bot 9 months ago

  • Copied to Backport #62414: quincy: qa/sts: test_list_buckets_invalid_auth and test_list_buckets_bad_auth fail added
Actions #10

Updated by Backport Bot 9 months ago

  • Tags changed from sts to sts backport_processed
Actions

Also available in: Atom PDF