Skip to content

Commit

Permalink
2267 s3 buckets should deny non ssl requests (#2281)
Browse files Browse the repository at this point in the history
* Add 'Action': 's3:*' to RequireSSL permisions.
  • Loading branch information
Matthew-Grayson authored Oct 4, 2023
1 parent f5fefef commit fc737a5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions infrastructure/cloudtrail_bucket_policy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
{
"Sid": "RequireSSLRequests",
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": [
Expand Down
1 change: 1 addition & 0 deletions infrastructure/cloudwatch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ resource "aws_s3_bucket_policy" "cloudwatch_bucket" {
},
{
"Sid" : "RequireSSLRequests",
"Action" : "s3:*",
"Effect" : "Deny",
"Principal" : "*",
"Resource" : [
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ resource "aws_s3_bucket_policy" "reports_bucket" {
"Statement" : [
{
"Sid" : "RequireSSLRequests",
"Action" : "s3:*",
"Effect" : "Deny",
"Principal" : "*",
"Resource" : [
Expand Down Expand Up @@ -328,6 +329,7 @@ resource "aws_s3_bucket_policy" "pe_db_backups_bucket" {
"Statement" : [
{
"Sid" : "RequireSSLRequests",
"Action" : "s3:*",
"Effect" : "Deny",
"Principal" : "*",
"Resource" : [
Expand Down
1 change: 1 addition & 0 deletions infrastructure/frontend_bucket_policy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
{
"Sid": "RequireSSLRequests",
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": [
Expand Down
1 change: 1 addition & 0 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ resource "aws_s3_bucket_policy" "logging_bucket" {
"Version" : "2012-10-17",
"Statement" : [{
"Sid" : "RequireSSLRequests",
"Action" : "s3:*",
"Effect" : "Deny",
"Principal" : "*",
"Resource" : [
Expand Down
14 changes: 7 additions & 7 deletions infrastructure/worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,16 @@ resource "aws_s3_bucket_policy" "export_bucket" {
"Version" : "2012-10-17"
"Statement" : [
{
Sid : "RequireSSLRequests"
Effect : "Deny"
Principal : "*"
Action : "s3:*"
Resource : [
"Sid" : "RequireSSLRequests"
"Action" : "s3:*",
"Effect" : "Deny"
"Principal" : "*"
"Resource" : [
aws_s3_bucket.export_bucket.arn,
"${aws_s3_bucket.export_bucket.arn}/*"
]
Condition : {
Bool : {
"Condition" : {
"Bool" : {
"aws:SecureTransport" : false
}
}
Expand Down

0 comments on commit fc737a5

Please sign in to comment.