-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS::S3::PublicAccessBlock Account Wide Setting #168
Comments
any news on this? |
The private resource type Installation instructions:
Usage example: AWSTemplateFormatVersion: 2010-09-09
Resources:
S3AccountPublicAccessBlock:
Type: 'Community::S3::PublicAccessBlock'
Properties:
BlockPublicAcls: true
BlockPublicPolicy: false
IgnorePublicAcls: true
RestrictPublicBuckets: true |
This is a frustrating gap in CloudFormation. As AWS's infrastructure-as-code tool, CloudFormation should be able to build all desired AWS infrastructure in a brand new AWS account using code, right? But the inability to disable this account-wide feature via officially-supported CFN resource types means that CFN cannot do that when those resources include S3 buckets with public access. 😝 The error message associated with violating this account-wide public access block is also quite unhelpful: "MyBucket": {
"Type": "AWS::S3::Bucket"
}
"BucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {"Ref": "MyBucket"},
"PolicyDocument": {
"Statement":[
{
"Action":["s3:GetObject"],
"Effect":"Allow",
"Resource": { "Fn::Sub" : "${MyBucket.Arn}/*" },
"Principal": "*"
}
]
}
}
} Attempting to create this stack results in the error |
Just to add, this would be a great addition to use in StackSets applied to an Organization. All new and existing accounts could get BlockPublicAccess as a security baseline. |
any updates on this? ive found some workarounds but wondering if theres something in the works to make this a lot easier |
This can be deployed as a stack set:
|
Instructions for CloudFormation Coverage New Issues Template
Quick Summary:
The text was updated successfully, but these errors were encountered: