Skip to content

Commit

Permalink
force tls on the bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcallis committed May 31, 2023
1 parent c9a827a commit c309e8a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aws_s3_origin_bucket_policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,25 @@ data "aws_iam_policy_document" "cloudfront" {
]
}
}

statement {
sid = "AllowSSLRequestsOnly"
effect = "Deny"
actions = [
"s3:*",
]
condition {
test = "Bool"
variable = "aws:SecureTransport"
values = ["false"]
}
principals {
type = "*"
identifiers = ["*"]
}
resources = [
data.aws_s3_bucket.origin_bucket.arn,
"${data.aws_s3_bucket.origin_bucket.arn}/*"
]
}
}

0 comments on commit c309e8a

Please sign in to comment.