Skip to content

Commit 99e9cad

Browse files
authored
Explicitly enable S3 ACLs for logging bucket (#61)
This is needed due to default behaviour changes in S3[1]. The newbehaviour breaks new deployments due to AccessControl being an ACL directive, and ACLs being disabled-by-default. It is necessary for us to enable ACLs as currently CloudFront only supports logging to S3 buckets with ACLs enabled. Bucket policies are not an alternate option, CloudFront will refuse to deploy if the logging bucket does not support ACLs. The OwnershipControls rule enables ACL behaviours. Note that I have chosen to set this to "Bucket owner preferred" which is not the default value. This seems like the more appropriate option - it allows ACLs to continue to be enabled but makes new objects owned by the bucket owner's account. See the docs[3] for more info. References: https://aws.amazon.com/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/ https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
1 parent 4ea9735 commit 99e9cad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

templates/custom-resource.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Resources:
1313
Type: AWS::S3::Bucket
1414
DeletionPolicy: Retain
1515
Properties:
16-
AccessControl: LogDeliveryWrite
16+
OwnershipControls:
17+
Rules:
18+
- ObjectOwnership: BucketOwnerPreferred
1719
BucketEncryption:
1820
ServerSideEncryptionConfiguration:
1921
- ServerSideEncryptionByDefault:

templates/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Metadata:
1313
Mappings:
1414
Solution:
1515
Constants:
16-
Version: 'v0.8'
16+
Version: 'v0.9'
1717

1818
Rules:
1919
OnlyUsEast1:

0 commit comments

Comments
 (0)