Configuring block public access settings for your S3 buckets
Amazon S3 Block Public Access provides settings for access points, buckets, and accounts to help you manage public access to Amazon S3 resources. By default, new buckets, access points, and objects do not allow public access.
For more information, see Blocking public access to your Amazon S3 storage.
You can use the S3 console, AWS CLI, AWS SDKs, and REST API to grant public access to one or more buckets. You can also block public access to buckets that are already public. For more information, see the sections below.
To configure block public access settings for every bucket in your account, see Configuring block public access settings for your account. For information about configuring block public access for access points, see Performing block public access operations on an access point.
Amazon S3 Block Public Access prevents the application of any settings that allow public access to data within S3 buckets. This section describes how to edit Block Public Access settings for one or more S3 buckets. For information about blocking public access using the AWS CLI, AWS SDKs, and the Amazon S3 REST APIs, see Blocking public access to your Amazon S3 storage.
You can see if your bucket is publicly accessible from the Buckets list, in the IAM Access Analyzer column. For more information, see Reviewing bucket access using IAM Access Analyzer for S3.
If you see an Error
when you list your buckets and their public
access settings, you might not have the required permissions. Check to make sure you
have the following permissions added to your user or role policy:
s3:GetAccountPublicAccessBlock s3:GetBucketPublicAccessBlock s3:GetBucketPolicyStatus s3:GetBucketLocation s3:GetBucketAcl s3:ListAccessPoints s3:ListAllMyBuckets
In some rare cases, requests can also fail because of an AWS Region outage.
To edit the Amazon S3 block public access settings for a single S3 bucket
Follow these steps if you need to change the public access settings for a single S3 bucket.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the Bucket name list, choose the name of the bucket that you want.
-
Choose Permissions.
-
Choose Edit next to Block public access (bucket settings) to change the public access settings for the bucket. For more information about the four Amazon S3 Block Public Access Settings, see Block public access settings.
-
Choose one of the settings, and then choose Save changes.
-
When you're asked for confirmation, enter
confirm
. Then choose Confirm to save your changes.
You can also change Amazon S3 Block Public Access settings when you create a bucket. For more information, see Creating a general purpose bucket.
To block public access on a bucket or to delete the public access block, use the AWS CLI service s3api
. The bucket-level operations that use this service are as follows:
-
PutPublicAccessBlock
(for a bucket) -
GetPublicAccessBlock
(for a bucket) -
DeletePublicAccessBlock
(for a bucket) -
GetBucketPolicyStatus
For more information and examples, see put-public-access-block
For information about using Amazon S3 Block Public Access through the REST APIs, see the following topics in the Amazon Simple Storage Service API Reference.
-
Bucket-level operations