Skip to Content
Asterrr's Handbook
5 · Data protection

S3 encryption options

SSE-S3, SSE-KMS, DSSE-KMS, SSE-C and client-side encryption, with the bucket policy tricks that enforce them.

Exam tasks: 5.2.1 (client- vs server-side encryption)

The decision: for this bucket, which key encrypts objects, who can use it, and how do you enforce that choice on every upload?

Since 5 January 2023 every new S3 object is encrypted at rest with SSE-S3 at no cost, so "encrypted at rest" is the baseline. The exam asks which option adds the control you need.

PUT + SSE headerGenerateDataKeykey usage logUploaderS3 bucketKMS keyCloudTrail
Where the key lives decides the option. SSE-KMS adds a KMS call per object and an audit trail in CloudTrail. Client-side encryption never shows plaintext to S3.
99%
Maximum reduction in KMS requests with S3 Bucket Keys.
April 2026
SSE-C blocked by default on new buckets.

Which one to use

SSE-S3SSE-KMSDSSE-KMSSSE-CClient-side
Keys held byS3KMS (managed or customer managed key)KMSCaller, sent on every requestYour application or KMS via an SDK
LayersOneOneTwo independent layersOneWhatever you apply
Request headerAES256aws:kms plus optional key ID headeraws:kms:dssecustomer-algorithm, customer-key, customer-key-MD5none
Needs a KMS permission to readNoYesYesNoDepends
Key use in CloudTrailNoYesYesNoIf KMS is used
Status on new bucketsDefault for every objectOpt-in default or per requestOpt-inBlocked by default since April 2026Not visible to S3
Good fitBaselineSeparation of duties, revocation, auditRules that name dual-layer encryptionLegacy apps that already manage keysS3 must never see plaintext
  • SSE-C. S3 does not store the key, so a lost key means lost data. HTTPS is mandatory and the key is AES-256. SSE-C is blocked by default on new general purpose buckets (and on existing buckets without SSE-C data, in most Regions) since April 2026. Allow it deliberately by setting BlockedEncryptionTypes to NONE in the bucket encryption configuration. Requests on a blocked bucket get 403 AccessDenied.
  • SSE-KMS. The caller needs kms:GenerateDataKey to upload and kms:Decrypt to read, in addition to S3 permissions. Heavy request rates can hit KMS request quotas, and S3 Bucket Keys cut the calls.
  • Default encryption. The bucket default can be SSE-S3, SSE-KMS or DSSE-KMS. It applies only to new writes. Existing objects keep their encryption until rewritten, for example with an S3 Batch Operations copy.
  • Client-side. Use the Amazon S3 Encryption Client or the AWS Encryption SDK with a KMS key. You manage keys and decryption.

Exam signal

"Audit who decrypted each object" or "revoke access by disabling the key" means SSE-KMS. "Customer supplies and holds the key, AWS stores nothing" means SSE-C. "Encrypt before it leaves the application" means client-side.

S3 Bucket Keys

  • S3 asks KMS for a short-lived bucket-level key and derives object data keys from it, cutting KMS requests by up to 99%. Fixes both KMS cost and ThrottlingException on busy buckets.
  • The encryption context changes from the object ARN to the bucket ARN. Key policies or grants that condition on aws:s3:arn for individual objects need updating, and CloudTrail shows fewer, bucket-level events.

Enforcing encryption

GoalHow
Reject unencrypted uploadsBucket policy deny when s3:x-amz-server-side-encryption is absent
Require SSE-KMSDeny unless header equals aws:kms
Require TLSDeny when aws:SecureTransport is false
Detect driftAWS Config rule s3-default-encryption-kms, S3 Storage Lens encrypted-bytes metrics
Block SSE-CLeave the new default, or set it through PutBucketEncryption

Enforcing a specific key

Because every object is encrypted anyway, the modern question is "encrypted with which key?"

{
  "Sid": "OnlyTheLedgerKey",
  "Effect": "Deny",
  "Principal": "*",
  "Action": "s3:PutObject",
  "Resource": "arn:aws:s3:::ledger-exports-5520/*",
  "Condition": {
    "StringNotEqualsIfExists": {
      "s3:x-amz-server-side-encryption-aws-kms-key-id": "arn:aws:kms:eu-west-1:210987654321:key/7c1e9f0a-example"
    }
  }
}
  • Pair it with default encryption set to SSE-KMS with that key, so uploads that send no headers still land on the right key.
  • A deny on s3:x-amz-server-side-encryption being Null rejects every upload that relies on default encryption. That is usually more disruptive than needed.

SSE-KMS permissions that catch people out

OperationKMS permissions on the key
PutObjectkms:GenerateDataKey
GetObject, CopyObject sourcekms:Decrypt
Multipart uploadkms:GenerateDataKey and kms:Decrypt (S3 decrypts the data key to finish the upload)
Replication to an SSE-KMS destinationReplication role: kms:Decrypt on the source key, kms:Encrypt on the destination key
Cross-account readBucket policy and key policy must both allow the other account

Big uploads fail, small ones work

The AWS CLI switches to multipart upload for large files. A role with only kms:GenerateDataKey can upload small objects to an SSE-KMS bucket but gets AccessDenied on large ones. Add kms:Decrypt on the key; changing the bucket policy doesn't help.

Exam trap

A cross-account reader with S3 access still fails on SSE-KMS objects unless the key policy and their IAM policy allow kms:Decrypt. Using the aws/s3 AWS managed key blocks cross-account sharing completely.

Scenarios

Scenario
A media company's upload service can store thumbnails in an SSE-KMS bucket, but uploads of 4 GB video files fail with AccessDenied. The service's role allows s3:PutObject on the bucket and kms:GenerateDataKey on the bucket's customer managed key. What should the security engineer change?

Further reading

On this page