Skip to content

Commit

Permalink
allow only ssl connections to s3 bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Narciso committed Apr 9, 2021
1 parent d6b7e79 commit 0013dd2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions terraform/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ resource "aws_s3_bucket" "roxprox" {
}
}
}

policy = <<EOF
{
"Id": "S3Policy",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSSLRequestsOnly",
"Action": "s3:*",
"Effect": "Deny",
"Resource": [
"arn:aws:s3:::${var.s3_bucket}",
"arn:aws:s3:::${var.s3_bucket}/*"
],
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
},
"Principal": "*"
}
]
}
EOF
}

resource "aws_s3_bucket_public_access_block" "roxprox" {
Expand Down

0 comments on commit 0013dd2

Please sign in to comment.