Skip to content

Files

Latest commit

 

History

History
35 lines (23 loc) · 758 Bytes

AWS074.md

File metadata and controls

35 lines (23 loc) · 758 Bytes

Pattern: S3 Access block should block public ACL

Issue: -

Description

S3 buckets should block public ACLs on buckets and any objects they contain. By blocking, PUTs with fail if the object has any public ACL a.

Resolution: Enable blocking any PUT calls with a public ACL specified.

Examples

Example of incorrect code:

resource "aws_s3_bucket_public_access_block" "bad_example" {
	bucket = aws_s3_bucket.example.id
}

resource "aws_s3_bucket_public_access_block" "bad_example" {
	bucket = aws_s3_bucket.example.id
  
	block_public_acls = false
}

Example of correct code:

resource "aws_s3_bucket_public_access_block" "good_example" {
	bucket = aws_s3_bucket.example.id
  
	block_public_acls = true
}