Description
S3 encrypts new uploads automatically. A new bucket without BucketEncryption uses S3-managed keys (SSE-S3) by default.
Potential impact
Uploads can remain encrypted yet fall outside a policy that requires a particular KMS key. Changing the default affects new uploads. Existing objects retain their current encryption.
Remediation
Set the required algorithm and key in BucketEncryption.ServerSideEncryptionConfiguration. For SSE-KMS, check uploader and reader permissions. If every upload must use a specific key, enforce it with a bucket policy. Check existing objects separately.
Examples
The second template uses aws:kms. Supply the ARN of an available symmetric customer-managed KMS key in the bucket’s Region as KmsKeyArn. After deploying, verify the key used on a new object.
Before
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub 'bucket-${AWS::Region}-${AWS::AccountId}'
After
Parameters:
KmsKeyArn:
Type: String
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub 'bucket-${AWS::Region}-${AWS::AccountId}'
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: aws:kms
KMSMasterKeyID: !Ref KmsKeyArn