Skip to content

Commit

Permalink
Require SSL for logging bucket.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Grayson committed Sep 30, 2023
1 parent 083ee66 commit a15875f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infrastructure/cloudwatch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ resource "aws_s3_bucket_policy" "cloudwatch_bucket" {
"Bool" : {
"aws:SecureTransport" : "false"
}
},
}
}
]
})
Expand Down
17 changes: 17 additions & 0 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ resource "aws_s3_bucket" "logging_bucket" {
}
}

resource "aws_s3_bucket_policy" "logging_bucket" {
bucket = aws_s3_bucket.logging_bucket.id
policy = jsonencode({
"Sid" : "Require SSL for requests",
"Effect" : "Deny",
"Resource" : [
"arn:aws:s3:::${var.logging_bucket_name}",
"arn:aws:s3:::${var.logging_bucket_name}/*"
],
"Condition" : {
"Bool" : {
"aws:SecureTransport" : "false"
}
}
})
}

resource "aws_s3_bucket_acl" "logging_bucket" {
bucket = aws_s3_bucket.logging_bucket.id
acl = "private"
Expand Down

0 comments on commit a15875f

Please sign in to comment.