Skip to content

Commit 52c2d16

Browse files
authored
Merge pull request #278 from NHSDigital/feature/eja-eli-386-block-public-access-to-s3-at-account-level
eli-386 blocking s3 public access at account level
2 parents 570765a + da24293 commit 52c2d16

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

infrastructure/stacks/api-layer/s3_buckets.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ module "s3_audit_bucket" {
1616
stack_name = local.stack_name
1717
workspace = terraform.workspace
1818
}
19+
20+
resource "aws_s3_account_public_access_block" "block_public_access" {
21+
block_public_acls = true
22+
block_public_policy = true
23+
}

infrastructure/stacks/iams-developer-roles/github_actions_policies.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ resource "aws_iam_policy" "s3_management" {
164164
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-truststore-access-logs",
165165
"arn:aws:s3:::*eligibility-signposting-api-${var.environment}-truststore-access-logs/*",
166166
]
167+
},
168+
{
169+
Effect = "Allow",
170+
Action = [
171+
"s3:GetAccountPublicAccessBlock",
172+
"s3:PutAccountPublicAccessBlock"
173+
],
174+
Resource = "*"
167175
}
168176
]
169177
})

0 commit comments

Comments
 (0)