Skip to content

Commit cff34d3

Browse files
committed
[NRL-1938] Add HTTPSOnly to policy for new ci-data bucket
1 parent 9f97bc7 commit cff34d3

File tree

1 file changed

+26
-0
lines changed
  • terraform/account-wide-infrastructure/mgmt

1 file changed

+26
-0
lines changed

terraform/account-wide-infrastructure/mgmt/s3.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,29 @@ resource "aws_s3_bucket_versioning" "ci_data" {
3434
aws_s3_bucket.ci_data
3535
]
3636
}
37+
38+
resource "aws_s3_bucket_policy" "ci_data" {
39+
bucket = aws_s3_bucket.ci_data.id
40+
41+
policy = jsonencode({
42+
Version = "2012-10-17"
43+
Id = "${local.prefix}--ci-data-bucket-policy"
44+
Statement = [
45+
{
46+
Sid = "HTTPSOnly"
47+
Effect = "Deny"
48+
Principal = "*"
49+
Action = "s3:*"
50+
Resource = [
51+
aws_s3_bucket.ci_data.arn,
52+
"${aws_s3_bucket.ci_data.arn}/*",
53+
]
54+
Condition = {
55+
Bool = {
56+
"aws:SecureTransport" = "false"
57+
}
58+
}
59+
},
60+
]
61+
})
62+
}

0 commit comments

Comments
 (0)