Skip to Content
Asterrr's Handbook
3 · Infrastructure security

Large Uploads to SSE-KMS Buckets

Why multipart uploads to an SSE-KMS bucket fail with access denied, and the exact KMS permissions the uploader needs.

The decision: why does a large upload to an SSE-KMS bucket fail while small ones succeed, and which KMS permissions fix it?

The AWS CLI and SDKs switch to multipart upload automatically for big files. When the bucket encrypts with SSE-KMS, the uploading principal needs KMS permissions in addition to S3 permissions. Missing KMS rights is the classic cause of an Access Denied on large files while small files work.

multipart partsGenerateDataKeyDecryptUploaderS3 bucket withSSE-KMSKMS key
S3 calls KMS as the uploader. It generates a data key when the upload starts and decrypts it when parts arrive.

Permissions

API callKMS action needed by the requester
CreateMultipartUploadkms:GenerateDataKey
UploadPart and UploadPartCopykms:Decrypt
CompleteMultipartUploadkms:Decrypt (without it the object is created with no checksum value)

Grant both kms:Decrypt and kms:GenerateDataKey* on the key. Same account as the key: make sure both the IAM policy and the key policy allow it. Cross-account: the key policy of the key owner account and the caller's IAM policy must both allow it.

Core facts

  • Use multipart upload for objects of 100 MB or more. Part numbers run from 1 to 10,000.
  • A KMS key encrypts at most 4 KB directly. For larger data S3 uses envelope encryption with a data key, handled for you in SSE-KMS.
  • S3 must decrypt stored parts to assemble them, which is why kms:Decrypt is needed.
  • Unfinished uploads keep billing for stored parts. Add a lifecycle rule using AbortIncompleteMultipartUpload.

Exam signal

Small files upload, large files fail, and the bucket uses a customer managed KMS key: add kms:Decrypt and kms:GenerateDataKey for the uploader.

Further reading

On this page