Created
June 11, 2014 12:03
-
-
Save steinsag/bcc29d9c304ed4925e76 to your computer and use it in GitHub Desktop.
S3 bucket policy to enforce encryption and https:// access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2008-10-17", | |
"Id": "Policy-GENERATED-ID", | |
"Statement": [ | |
{ | |
"Sid": "DenyUnSecureCommunications", | |
"Effect": "Deny", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:*", | |
"Resource": "arn:aws:s3:::S3-BUCKET-ID", | |
"Condition": { | |
"Bool": { | |
"aws:SecureTransport": false | |
} | |
} | |
}, | |
{ | |
"Sid": "DenyUnEncryptedObjectUploads", | |
"Effect": "Deny", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::S3-BUCKET-ID/*", | |
"Condition": { | |
"StringNotEquals": { | |
"s3:x-amz-server-side-encryption": "AES256" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your
DenyUnEncryptedObjectUploads
condition only denyaws:kms
and still allow no encryption at allTo disable no encryption (but sill allow both
aws:kms
andAES256
you should dosee https://aws.amazon.com/blogs/security/how-to-prevent-uploads-of-unencrypted-objects-to-amazon-s3/