Protecting S3 Data with Access Controls and Encryption
This lesson explains how access to Amazon S3 is controlled through IAM policies, bucket policies and access points, and how data is encrypted in transit and at rest with several key-management options.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish SSE-S3, SSE-KMS, SSE-C and client-side encryption by who controls the key.
- Explain how bucket policies, IAM policies, Block Public Access and access points combine to control access.
- Explain why reading an SSE-KMS encrypted object also requires permission on the KMS key.
Encryption at rest
Every new object is encrypted with SSE-S3 by default, so the question is never whether to encrypt but who controls the key. The options differ in how much control and audit they give, and in how much work they require.
With SSE-S3, S3 creates and manages the keys entirely; there is nothing to configure and no extra cost. With SSE-KMS, S3 encrypts each object with a data key protected by a KMS key that you choose. The key policy decides who can decrypt, so a principal needs both S3 permissions and kms:Decrypt to read an object, and kms:GenerateDataKey to upload one. Every use of the key is recorded in CloudTrail, which is why SSE-KMS is the usual answer when a requirement mentions key control or auditing.
With SSE-C, the client sends its own key in the headers of every request over HTTPS; S3 uses the key to encrypt or decrypt and then discards it, so losing the key means losing the data. With client-side encryption, the application encrypts data before uploading it, for example with the AWS Encryption SDK, so S3 never sees plaintext. The following table summarises the options.
| Option | Who manages the key | Choose when |
|---|---|---|
| SSE-S3 | S3 | You need encryption with no extra management (the default) |
| SSE-KMS | AWS KMS, with your key policy | You need control over the key and a CloudTrail audit of its use |
| SSE-C | You, sending the key with every request over HTTPS | You must hold the keys yourself |
| Client-side | You, before upload | Data must be encrypted before it reaches AWS |
SSE-KMS calls KMS for every object operation, so very high request rates can hit KMS quotas. S3 Bucket Keys greatly reduce those calls.
Since April 2026, new general purpose buckets block SSE-C by default. A bucket that must accept SSE-C requests needs the blocked encryption types in its default encryption configuration set to allow it; otherwise SSE-C uploads fail with 403 Access Denied.
Example. Default all new objects to SSE-KMS with Bucket Keys enabled:
aws s3api put-bucket-encryption --bucket customer-docs --server-side-encryption-configuration '{
"Rules": [{
"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "aws:kms", "KMSMasterKeyID": "alias/customer-docs"},
"BucketKeyEnabled": true
}]
}'Controlling access
Access to S3 buckets and objects is controlled by several mechanisms. The following list describes them.
- Bucket policies and IAM policies control access; an explicit deny in any of them wins.
- ACLs are disabled by default (Bucket owner enforced), so objects uploaded from other accounts belong to the bucket owner.
- Block Public Access overrides any policy that would make data public.
- Access points give each application on a shared bucket its own endpoint and policy, optionally restricted to a VPC.
Example. Deny any request made over plain HTTP. As an explicit deny, it cannot be overridden.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::customer-docs", "arn:aws:s3:::customer-docs/*"],
"Condition": {"Bool": {"aws:SecureTransport": "false"}}
}]
}An access denied on a KMS-encrypted object
A Lambda function can list a bucket and read most objects, but receives AccessDenied on files uploaded by the finance team. Those files are encrypted with SSE-KMS using the finance key.
| Permission | Status |
|---|---|
s3:GetObject on the bucket in the execution role | Present |
kms:Decrypt on the finance key in the execution role | Missing |
| The finance key policy allows the account to use IAM for permissions | Yes (default) |
Adding kms:Decrypt on that key fixes the problem. Reading an SSE-KMS object is two authorisation decisions, one by S3 and one by KMS, and either can deny it. SSE-S3 objects need no KMS permission, which is why only some files failed.
A bucket must reject any upload that is not encrypted with SSE-KMS. How is this enforced?
Show answer
With a bucket policy that denies s3:PutObject when the s3:x-amz-server-side-encryption header is not aws:kms. Default encryption alone encrypts objects but does not reject requests that ask for a different method.
Exam Tips
Remember for the exam
- To audit who used the encryption key, choose SSE-KMS.
- KMS throttling caused by S3 traffic is fixed by enabling S3 Bucket Keys.
- To deny requests that do not use HTTPS, use a bucket policy with the
aws:SecureTransportcondition. - For different access rules per application on one shared bucket, use S3 access points.
- ACLs are disabled by default; control access with bucket policies and IAM.