Project

General

Profile

Actions

Bug #20527

closed

v2 presigned URLs don't work with radosgw.

Added by Marcus Watts almost 7 years ago. Updated over 2 years ago.

Status:
Can't reproduce
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

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

Description

s3cmd only supports v2 style presigned URLs (see https://github.com/s3tools/s3cmd/issues/765 ).
Also, it only supports "virtual host style" access, not path access.

Accepting these limitations, for a command like,
s3cmd signurl s3://my-new-bucket/services `date -d 'now + 1 year' +%s`
the output will be something like,
http://my-new-bucket.hybodus.eng.arb.redhat.com/services?AWSAccessKeyId=40JV0D93WB9U33YNQ0
L4&Expires=1530850939&Signature=HyCxD1QmQ5warS41aB%2B8YbPcYfE%3D

When this is given to ceph, the result will be:
<Error><Code>SignatureDoesNotMatch</Code><RequestId>
tx000000000000000000083-00595dbb60-1092-default</RequestId><HostId>1092-default-default</H
ostId></Error>

It's possible to munge that path into something that works with ceph, such as,
http://hybodus.eng.arb.redhat.com/my-new-bucket/services?AWSAccessKeyId=40JV0D93WB9U33YNQ0L4&Expires=1530850939&Signature=HyCxD1QmQ5warS41aB%2B8YbPcYfE%3D
However, there isn't any way to configure s3cmd to cause this to happen; prepending the bucket onto the hostname is hard-wired into s3cmd and happens even if the hostname is an IP address.

By appending "--debug" to the s3cmd command line, near the end, something like this will appear:
DEBUG: Signing plaintext: u'GET\n\n\n1530851096\n/my-new-bucket/services'

By running radosgw with "debug rgw = 20", it in turn reports:
2017-07-05 23:55:27.368575 7f74102f2700 15 string_to_sign=GET

1530849206
/services

According to "http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html",
when doing "virtual hosted style" access, the path has to be prefixed with the bucket name. Clearly, ceph is not doing this.

Actions

Also available in: Atom PDF