s3: feature flag to make AWS's new blockPublicAccess and ownershipControls defaults explicit #26788
Labels
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
documentation
This is a problem with documentation.
p1
Describe the feature
A feature flag that removes reliance on Cloudformation defaults for
blockPublicAccess
andownershipControls
(orobjectOwnership
asBucketProps
calls it) and instead sets them explicitly in the generated Cloudformation.https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#blockpublicaccess says:
Which I think is a usability bug, and I think "users can modify bucket policies or object permissions to allow public access" might be false as of 27th April 2023.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html#objectownership say:
Which I think might actually be false as of 27th April 2023.
Use Case
In the light of https://aws.amazon.com/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/, we have a problem where the birthdate of a bucket affects how they behave unless that behaviour is set explicitly.
So we have CDK projects where the same code deployed two essentially identical stacks, but either side of the behaviour change date. A diff or update to the older stack finds no changes. But I don't want this variance, I want two CDK stacks that are the same - up to naming - behave the same.
Proposed Solution
A CDK feature flag so that there is some consistent default behaviour explicitly applied to all
s3.Bucket
resources.This should almost certainly match S3's new defaults, so should set:
In other words:
would produce an L1 like
Enabling this feature flag would mean ensure that all buckets managed by the CDK would have consistent behaviour regardless of creation date.
Other Information
No response
Acknowledgements
CDK version used
2
Environment details (OS name and version, etc.)
n/a
The text was updated successfully, but these errors were encountered: