Skip to content

Commit 44a7aa9

Browse files
Update s3.tf
Snyk security fixes
1 parent 8126701 commit 44a7aa9

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

s3.tf

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
resource "aws_s3_bucket" "this" {
22
bucket = "${var.project_name}-${var.aws_account_id}"
3-
4-
block_public_acls = true
5-
aws_s3_bucket_public_access_block = true
6-
7-
website {
3+
website {
84
redirect_all_requests_to = "https://${var.target_domain}"
95
}
106

@@ -16,6 +12,15 @@ resource "aws_s3_bucket" "this" {
1612
)
1713
}
1814

15+
resource "aws_s3_bucket_public_access_block" "this" {
16+
bucket = aws_s3_bucket.this.id
17+
18+
block_public_acls = true
19+
block_public_policy = true
20+
ignore_public_acls = true
21+
restrict_public_buckets = true
22+
}
23+
1924
resource "aws_kms_key" "this" {
2025
deletion_window_in_days = 10
2126
enable_key_rotation = true
@@ -56,6 +61,15 @@ resource "aws_s3_bucket" "log_bucket" {
5661

5762
}
5863

64+
resource "aws_s3_bucket_public_access_block" "log" {
65+
bucket = aws_s3_bucket.log_bucket.id
66+
67+
block_public_acls = true
68+
block_public_policy = true
69+
ignore_public_acls = true
70+
restrict_public_buckets = true
71+
}
72+
5973
resource "aws_s3_bucket_acl" "log_bucket_acl" {
6074
bucket = aws_s3_bucket.log_bucket.id
6175
acl = "log-delivery-write"

0 commit comments

Comments
 (0)