Follow | Working with Amazon S3 BucketsWorking with Amazon S3 Bucket PoliciesA bucket policy is a JSON document that controls access to a bucket and the files it contains. You can grant or deny access based on the requester, action, file path, and optional conditions such as an IP address. Each bucket has a single bucket policy document. Editing the policy replaces the current document. To edit an Amazon S3 Bucket Policy
To remove the current bucket policy, click remove policy, then click Apply. The link clears the editor; the stored policy is deleted only after you apply the change. See the examples below. For more details, see Policies and permissions in Amazon S3 and the official bucket policy examples. Examples of Amazon S3 Bucket PoliciesReplace the sample bucket name, IAM role, and network range with your own values before applying a policy. Test the result carefully to avoid granting unintended access. Grant public-read access to files in a folder
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-brand-new-bucket/public-folder/*"
}
]
} This policy makes every file under public-folder publicly readable. Amazon S3 Block Public Access may prevent the policy from being saved or taking effect. Disable it only when anonymous access is intentional. Grant an IAM role access to a bucket and its files
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRoleBucketOperations",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:role/MyS3Role"
},
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::my-brand-new-bucket"
},
{
"Sid": "AllowRoleFileOperations",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:role/MyS3Role"
},
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::my-brand-new-bucket/*"
}
]
}Replace the account ID and role name with the ARN of an existing IAM role. Additional permissions may be required for file versions, multipart uploads, or AWS KMS encryption. Grant public-read access from a specific IP address range
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAnonymousReadFromSpecificPublicCidr",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-brand-new-bucket/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": "192.0.2.0/24"
}
}
}
]
}The range 192.0.2.0/24 is reserved for documentation; replace it with your public network range. This statement does not revoke access granted by other policies. For requests through an Amazon VPC endpoint, use aws:SourceVpc, aws:SourceVpce, or aws:VpcSourceIp instead of aws:SourceIp. | CS Browser 13.5.5 Freeware ![]() Social Connection Our customers say "CS Browser is an invaluable tool to me as a web developer to easily manage my automated site backups" -Bob Kraft, Web Developer "Just want to show my appreciation for a wonderful product. I use CS Browser a lot, it is a great tool." -Gideon Kuijten, Pro User "Thank You Thank You Thank You for this tool. A must have for anyone using Amazon S3!" -Brian Cummiskey, USA Related Products TntDrive Easily mount Amazon S3 Bucket as a Windows Drive. RdpGuard protects your Windows Server from RDP Brute-force Attacks. |