Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS v4 authorization [JIRA: RCS-144] #897

Open
waxzce opened this issue Jun 22, 2014 · 27 comments
Open

AWS v4 authorization [JIRA: RCS-144] #897

waxzce opened this issue Jun 22, 2014 · 27 comments
Milestone

Comments

@waxzce
Copy link

waxzce commented Jun 22, 2014

AWS S3 have a new protocol to sign request, called aws4

seems not supported on riak-cs

@reiddraper
Copy link
Contributor

Further reading.

@reiddraper reiddraper added this to the 1.6.0 milestone Jun 23, 2014
@randysecrist
Copy link

@reiddraper
Copy link
Contributor

Thanks @randysecrist!

@waxzce
Copy link
Author

waxzce commented Jun 23, 2014

So you think about to port it in riakCS ?

@reiddraper
Copy link
Contributor

@waxzce We'll consider this for Riak CS.

@shino
Copy link
Contributor

shino commented Jan 9, 2015

s3cmd also implemented v4 auth and use it by default [1].
To access current Riak CS, one must add one configuration

signature_v2 = True

[1] s3tools/s3cmd#402

@Basho-JIRA Basho-JIRA changed the title implement aws4 v4 authorization [JIRA: RCS-91] Jan 9, 2015
@Basho-JIRA
Copy link

TODO list after some reading of AWS docs and a little trial to execute v4 to AWS S3
https://gist.github.com/shino/447a57ee9a6c2af10823

_[posted via JIRA by Shunichi Shinohara]_

@shino
Copy link
Contributor

shino commented Jan 28, 2015

temporary patch for boto
shino/boto@bb5e02b

Will be PRed or filed as issues to upstream repository.

@shino shino changed the title v4 authorization [JIRA: RCS-91] v4 authorization Jan 28, 2015
@shino shino changed the title v4 authorization AWS v4 authorization Jan 28, 2015
@shino
Copy link
Contributor

shino commented Jan 28, 2015

First round PR is #1062 .
Subsequent tasks are #1059 #1058 #1060 .

@kuenishi kuenishi modified the milestones: 2.0.0, 2.0.1 Feb 10, 2015
@brmzkw
Copy link

brmzkw commented Mar 11, 2015

Currently, riak-cs returns a 500 error when v4 signature is used. Shouldn't it return a HTTP/400 instead?

@Basho-JIRA Basho-JIRA changed the title AWS v4 authorization AWS v4 authorization [JIRA: RCS-144] Mar 11, 2015
@shino
Copy link
Contributor

shino commented Mar 12, 2015

@brmzkw I thought I changed riak_cs to return 400 at #1062 (merged to current develop branch).
What version do you use? Prior 1.5.x, riak cs does not consider v4 auth.

@brmzkw
Copy link

brmzkw commented Mar 12, 2015

I'm running version 1.5.4, so I guess I need to wait for the next release.

Returning a 500 in case of error is really disturbing, as it makes think to the client that riak-cs has some problems. A bad request should never raise HTTP/500.

Thanks for the response,

@shino
Copy link
Contributor

shino commented Mar 13, 2015

Returning a 500 in case of error is really disturbing

I tested Riak CS (almost) 1.5.4 with s3cmd with v4 enabled. I got 403. This is because Authorization header starts with AWS4-HMAC- but Riak CS 1.5.4 expected AWS, then CS could not get access key ID and (thru authz path...) responded with 403.

@kuenishi kuenishi removed this from the 2.0.1 milestone Apr 3, 2015
@kuenishi kuenishi modified the milestones: 2.1.0, 2.0.1 Apr 3, 2015
@dragonfax
Copy link

This would be great to have. I use golang. Amazon has an official s3 client for golang out now, but it only contains v4 auth. Which means it doesn't work with Riak CS.

@kuenishi
Copy link
Contributor

Although it is not generally available and is partial implementation, in 2.0.1 v4 authentication is included. Try adding {auth_v4_enabled, true} in advanced.config.

@dragonfax
Copy link

Ah, I tried their client with Riak CS 2.0.1 but didn't know about the config option. I'll try it again. Thanks.

@dragonfax
Copy link

Unfortunately this didn't work either. I'm not having much luck finding a workable solution for Riak CS and golang, together.

I've tried various client libraries, and combinations of v2 and v4 signing. I even patched them for #1166

But i just get crashes in the riak cs auth code. And my erlang isn't good enough to debug it.

No problems with using s3cmd to test these configurations and users.

@shino
Copy link
Contributor

shino commented Aug 26, 2015

@dragonfax Thanks for information and effort! Agree with the subtleness of debugging auth phase 😓

Current implementation is tested against boto [1] as automated testing and against s3cmd by some manual testing.

If you kindly try more, a hint for debugging, which you may know already :) , is turning debug log on in riak cs, then it prints out CanonicalString and StringToSign. (Scope should be output but not ...) [2]
I guess well-implemented client library also have such functionality, for example, go sdk seems to have it [3].

[1] https://github.com/basho/riak_cs/tree/develop/client_tests/python/boto_tests
[2] https://github.com/basho/riak_cs/blob/develop/src/riak_cs_s3_auth.erl#L210-L219
[3] https://github.com/aws/aws-sdk-go/blob/master/internal/signer/v4/v4.go#L141-L165

@dragonfax
Copy link

Hey, Thanks for the interest guys. Its always heartwarming to be heard. I did actually get this to work with a bit more effort.

Adding a patch to aws-sdk-go (for issue #1166) that you can see in this commit. dragonfax/aws-sdk-go@cd6e377

I was able to get an example s3 client to work. https://gist.github.com/dragonfax/58d40bf9469cd06b6dc2 And it works quite well, too. Kudos.

If Riak CS could be patched up to accept that whitespace more flexibly. Then that might all you need for good golang support.

@shino
Copy link
Contributor

shino commented Aug 27, 2015

@dragonfax Congrats! Also thanks a lot for sharing more information and suggestions!

@shino
Copy link
Contributor

shino commented Sep 4, 2015

Cross note: the spaces after commas will be trimmed by the fix #1235.

@edwardotis
Copy link

edwardotis commented Jan 31, 2017

I see this bug is still open 2.5 years later in 2017. As far as I can tell, the riaks project is not compatible with AWS S3 due to this bug. I cannot set a current aws sdk release to use signers older than v4.

@Basho-JIRA
Copy link

[~pbrewer] - This comment came in today. I wonder if this is something you or your team may be able to address?

[posted via JIRA by Derek Somogyi]

2 similar comments
@Basho-JIRA
Copy link

[~pbrewer] - This comment came in today. I wonder if this is something you or your team may be able to address?

[posted via JIRA by Derek Somogyi]

@Basho-JIRA
Copy link

[~pbrewer] - This comment came in today. I wonder if this is something you or your team may be able to address?

[posted via JIRA by Derek Somogyi]

@waxzce
Copy link
Author

waxzce commented Jun 14, 2017

Hi,
Does someone is working on this or contribution are welcome?

Best Regards,

@dragonfax
Copy link

My company dropped Riak CS for reasons such as this, and is moving away from Riak because of other various issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants