Skip to content

Commit

Permalink
add s3 bucket policy deny for non HTTPS traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
eesa456 committed Aug 2, 2023
1 parent 3c2e72a commit eb4d58e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/opennext-assets/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ data "aws_iam_policy_document" "read_assets_bucket" {
identifiers = [var.server_function_role_arn]
}
}
statement {
effect = "Deny"
actions = ["s3:*"]
resources = [aws_s3_bucket.assets.arn, "${aws_s3_bucket.assets.arn}/*"]

condition {
test = "Bool"
values = ["false"]
variable = "aws:SecureTransport"
}

principals {
type = "*"
identifiers = ["*"]
}
}
}

# Static Assets
Expand Down

0 comments on commit eb4d58e

Please sign in to comment.