Feature #10333
rgw: support AWS4 authentication
0%
Related issues
Associated revisions
rgw: AWS4 authentication minimal support
Amazon S3 supports Signature Version 4. This patch contains the minimal
implementation supporting AWS4 in RGW. It implements AWS4 authentication
on http methods without body content and vars not shipping in the
request query string.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: handle AWS4 auth case when query string exists
Crafts the canonical query string. URI-encode each parameter name and
value properly.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: add proper AWSv4 and AWSv2 auth detection
Adds a new authorize function to identify/handle AWSv4 and AWSv2 auth
properly, handling common code, etc.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: AWS4 auth support when using request params
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: avoid re-encoding already encoded query strings in AWS4 auth
When computing V4 signature, we need to encode the query string. But it
could come already encoded, at least partially.
So do not encode the entities that are already encoded.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: UNSIGNED-PAYLOAD support in AWS4 auth
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: AWS4 auth support for positive content-length
Handle AWS4 auth on requests with positive content-length. It splits the
auth process along several steps to process the body content on the fly
instead of reading the whole body in memory. After that, it completes
the delayed AWS4 auth properly.
Requests with content-length <= 0 are validated as usual. They don't
require any kind of completion.
Requests with content-length > 0 use a streaming approach together with
a completion step.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: initialize aws4_auth_complete
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: verify Content-MD5 is a valid base64 value
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: check if x-amz-date has a value
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: validate x-amz-sha256
Verify content's sha256 sum matches the expected value.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
rgw: achieve same error behaviour in S3 and RGW when processing signedheaders
This patch gets the same error response in S3 and RGW when the error is related
to the signedheaders processing.
Fixes: #10333
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
History
#1 Updated by Yehuda Sadeh almost 9 years ago
- Subject changed from rgw: support AWS4 to rgw: support AWS4 authentication
#2 Updated by Javier M. Mellid over 8 years ago
I started this feature and I have some initial bits working now but I don't have the right permissions to ask for assignation or update the "Assignee" field in tracker.
Would it be possible taking care of this feature implementation? If so, anybody updating the 'Assignee' field to jmunhoz? Thanks!
#3 Updated by Yehuda Sadeh over 8 years ago
- Assignee set to Javier M. Mellid
Done. You should be able to modify these fields under the rgw project now.
#4 Updated by Javier M. Mellid over 8 years ago
Thanks Yehuda.
#5 Updated by Javier M. Mellid over 8 years ago
I've just created a pull request to merge a first version for supporting Amazon's S3 signature V4 (from now on, AWS4).
The patch implements the basic required primitives to work with AWS4 (sha256 crypto, encoding, and so on), and is able to authenticate HTTP requests that don't include the parameters in the query string (only as HTTP headers) and that do not contain a body. This is work in progress, and I hope to submit a new pull request for this part as soon as possible.
The patch is fully mergeable, so if done it will partially support V4. As said before, I am working on bringing the remaining features.
Note that V2 authentication continues to work as usual.
Any feedback is welcomed.
Pull request is available at:
#6 Updated by Josh Durgin over 8 years ago
- Status changed from New to Fix Under Review
#7 Updated by Javier M. Mellid over 8 years ago
Pull request updated with the missing bits. It contains the whole feature.
#8 Updated by Sage Weil over 7 years ago
- Status changed from Fix Under Review to Resolved