Last active
March 8, 2018 16:14
-
-
Save brandongalbraith/d81aaa447e6440f3aa9a156f8abc7b9c to your computer and use it in GitHub Desktop.
AWS S3 Bucket Policy: Require TLS for data transport, enforce object encryption using any KMS key
This file contains 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": "2012-10-17", | |
"Id": "PolicyIdentifierGUIDgoesHere", | |
"Statement": [{ | |
"Action": "s3:*", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Resource": "arn:aws:s3:::<bucketname>", | |
"Condition": { | |
"Bool": { | |
"aws:SecureTransport": false | |
} | |
} | |
}, { | |
"Action": "s3:*", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Resource": "arn:aws:s3:::<bucketname>/*", | |
"Condition": { | |
"Bool": { | |
"aws:SecureTransport": false | |
} | |
} | |
}, { | |
"Sid": "DenyIncorrectEncryptionHeader", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::<bucket_name>/*", | |
"Condition": { | |
"StringNotEquals": { | |
"s3:x-amz-server-side-encryption": "aws:kms" | |
} | |
} | |
}, { | |
"Sid": "DenyUnEncryptedObjectUploads", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::<bucket_name>/*", | |
"Condition": { | |
"Null": { | |
"s3:x-amz-server-side-encryption": true | |
} | |
} | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment