Skip to content

Commit

Permalink
Merge pull request #59 from in4it/feature/only-ssl-s3
Browse files Browse the repository at this point in the history
allow only ssl connections to s3 bucket
  • Loading branch information
andrenarciso4 authored Apr 9, 2021
2 parents d6b7e79 + 0013dd2 commit 8d2649c
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 8d2649c

Please sign in to comment.