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

s3 kms encryption fails due to auth protocol mismatch #377

Closed
quiver opened this issue Nov 14, 2014 · 2 comments · Fixed by #137
Closed

s3 kms encryption fails due to auth protocol mismatch #377

quiver opened this issue Nov 14, 2014 · 2 comments · Fixed by #137

Comments

@quiver
Copy link
Contributor

quiver commented Nov 14, 2014

API http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html

$ aws s3api put-object --bucket bucket_name --key key_name --server-side-encryption aws:kms --ssekms-key-id kms_id
A client error (InvalidArgument) occurred when calling the PutObject operation: Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4.

Debug message shows that hmacv1 auth is used while sse-kms requires sigv4 auth.

Changing "signatureVersion" of botocore/data/aws/s3/2006-03-01.api.json from s3 to s3v4 solved my problemn, but I won't PR because

  • I've been told before that data/aws files are maintained by aws
  • Small subsets of s3 api calls require sigv4. I'm not sure if changing whole s3 auth protocol is a good approach.

This may be related to https://forums.aws.amazon.com/thread.jspa?threadID=165286

@jamesls
Copy link
Member

jamesls commented Nov 19, 2014

We're going to look into automatically switching the signature version dynamically, but in the next AWS CLI release, you can now explicitly set the signature version of S3 in the config file:

aws configure set default.s3.signature_version s3v4

See #382 for more info. For backwards compat reasons we can't switch over to s3v4 so for now users will have to specify the signature version explicitly when working with kms.

@jamesls jamesls closed this as completed Nov 19, 2014
@quiver
Copy link
Contributor Author

quiver commented Nov 20, 2014

aws configure set default.s3.signature_version s3v4

Nice work, James.

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

Successfully merging a pull request may close this issue.

2 participants