-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot add x-amz-server-side-encryption header to S3 upload part #471
Comments
Actually, it appears that x-amz-server-side-encryption is not supported by the REST API when doing an upload part operation. Maybe this is actually a bug in the REST API? |
I can confirm this issue. It looks like that we have to update our model so that you can set the x-amz-server-side-encryption headers for the |
Any update on this? It would be great to enforce KMS on large uploads. |
There is an issue in that we do not support I'm not sure it's possible based on this document (http://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html), but you'll need to modify your bucket policy to only enforce KMS encryption on Initiate Multipart Upload operations. As far as getting this work via a policy to enforce KMS on all multi-part uploads, I suggest starting a forum thread on the Amazon S3 developer forums so that you can interact directly with S3 engineers to see if there is a workaround or if they will consider it for a feature request: https://forums.aws.amazon.com/forum.jspa?forumID=24 |
I have an S3 bucket with a policy restricting to only KMS encryption (similar to http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html but with 'aws:kms'). I am attempting to do a multipart upload as below:
This fails, apparently because the upload part request does not include an x-amz-server-side-encryption header.
Unlike PutObjectRequest, UploadPartRequest appears not to have a ServerSideEncryption member to set the x-amz-server-side-encryption header. This header is documented at http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPart.html (this documentation appears incomplete since aws:kms is not listed as a valid value).
Without the bucket policy, the code sample executes successfully (and the resulting object is encrypted); but this no longer enforces that all uploads use encryption.
The boto3 documentation at https://boto3.readthedocs.org/en/latest/reference/services/s3.html also states that SSECustomerAlgorithm can be set to aws:kms, but AFAICT that only sets the header for non-KMS SSE; the documentation appears to be faulty in listing aws:kms as an example value.
The text was updated successfully, but these errors were encountered: