Project

General

Profile

Actions

Bug #62105

open

SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 auth

Added by Joshua Haas 10 months ago. Updated 6 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
adminapi subuser sigv4 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

I'm not sure if this should be treated as a bug in the RGW auth code, or a bug in the RGW Admin Ops API spec, but attempting to perform certain actions fails with SignatureDoesNotMatch. This came to my attention when I upgraded the python rgwadmin package from 2.3.3 to latest. During that time, the library switched from using awsauth (which I think was doing v2) to requests-aws4auth which does v4:

Some endpoints in the RGW Admin Ops API use duplicate query params. For example, Create Subuser:

Defines the endpoint as:

PUT /{admin}/user?subuser&format=json

But one of the required params is subuser, resulting in something like this:

PUT /{admin}/user?subuser&format=json&uid=bob&subuser=sub1

Which results in SignatureDoesNotMatch. If instead I make the request omitting the initial subuser param, then everything works fine (but this isn't the documented API spec):

PUT /{admin}/user?format=json&uid=bob&subuser=sub1

I haven't exhaustively looked through the entire API, but at a glance at least these actions are affected:

  • create subuser
  • modify subuser
  • remove subuser
  • remove object

My best guess is this is happening because we're using a map in the logic that parses and sorts the query params, thereby only preserving one of them (but I'm not that great at C++):

While I don't think there's a spec that forbids it, sending non-unique query params seems like a significant foot gun to me.

I tested this on 17.2.5-8-g7aafe175b8 but I believe it probably affects all versions.


Related issues 3 (1 open2 closed)

Copied to rgw - Backport #63624: pacific: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 authRejectedKonstantin ShalyginActions
Copied to rgw - Backport #63625: quincy: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 authIn ProgressKonstantin ShalyginActions
Copied to rgw - Backport #63626: reef: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 authResolvedKonstantin ShalyginActions
Actions #1

Updated by Joshua Haas 10 months ago

Forgot to explicitly mention the documented API spec (with the double query param) works fine when using v2 auth.

Actions #2

Updated by Casey Bodley 10 months ago

  • Assignee set to Ali Maredia
  • Tags set to adminapi subuser sigv4
  • Backport set to pacific quincy reef
Actions #4

Updated by Casey Bodley 6 months ago

  • Status changed from New to Pending Backport
Actions #5

Updated by Backport Bot 6 months ago

  • Copied to Backport #63624: pacific: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 auth added
Actions #6

Updated by Backport Bot 6 months ago

  • Copied to Backport #63625: quincy: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 auth added
Actions #7

Updated by Backport Bot 6 months ago

  • Copied to Backport #63626: reef: SignatureDoesNotMatch for certain RGW Admin Ops endpoints when using v4 auth added
Actions #8

Updated by Backport Bot 6 months ago

  • Tags changed from adminapi subuser sigv4 to adminapi subuser sigv4 backport_processed
Actions #9

Updated by Konstantin Shalygin 6 months ago

  • Assignee deleted (Ali Maredia)
  • Pull request ID set to 53504
Actions

Also available in: Atom PDF