{{ }} Substitute variables
Adjust the variable values according to your preference.
Policy Code
Referenced from: https://aws.amazon.com/premiumsupport/knowledge-center/s3-bucket-policy-for-config-rule/
1{
2 "Version" : "2012-10-17",
3 "Id" : "Require secure access to bucket and all files",
4 "Statement" : [
5 {
6 "Sid" : "Require secure access to all files",
7 "Effect" : "Deny",
8 "Principal" : "*",
9 "Action" : "*",
10 "Resource" : [
11 "arn:aws:s3:::{{bucket-name}}",
12 "arn:aws:s3:::{{bucket-name}}/*"
13 ]
14 "Condition" : {
15 "Bool" : {
16 "aws:SecureTransport" : "false"
17 }
18 }
19 }
20 ]
21}