Learn how to check S3 public access configuration in Amazon S3 buckets to prevent unintended data exposure.

This playbook describes how to execute Tamnoon S3 automation to find which s3 buckets have public access.
The execution is based on AWS credentials configuration based on the next fallbacks:
After authentication via AWS API, the script execution will run on the same AWS account of those credentials defined in fallbacks 1-3 (see above)
This automation investigates policies and ACLs of S3 buckets that can allow public access to the buckets.
This automation investigates both bucket policies and ACLs to detect public accessibility. Public buckets are identified by permissions like s3:ListBucket or s3:* granted to Principal *, or by ACLs allowing READ or FULL_CONTROL to “AllUsers.”
On top of that, it checks whether S3 block public access settings are in place at both the bucket and account levels. Using this playbook is an essential step in tightening security and verifying exposure risks. As a complementary best practice, users should also enable S3 server access logging to track access and requests for audit and compliance purposes.
High: Publicly accessible S3 buckets pose serious security risks, including data leaks and unauthorized access. Immediate action is recommended if misconfigurations are found.
Use this playbook to audit S3 bucket configurations for public access exposure. It’s ideal during security reviews, compliance audits, or as part of a continuous cloud posture assessment.
Permission | Required for Operation |
s3:GetBucketPolicy | GET bucket policy |
s3:GetBucketAcl | GET bucket ACL |
s3:GetBucketPolicyStatus | GET bucket policy status |
s3:GetBucketPublicAccessBlock | GET bucket Block Public Access settings |
s3:GetAccountPublicAccessBlock | GET account Block Public Access settings |
2. Python v3.9 and above + boto3 package installed ( pip install boto3)
1. Clone the AWS folder from Tamnoon-Public-Playbooks
git clone --branch main --single-branch --no-checkout [email protected]:tamnoon-io/Tamnoon-Service.git
git sparse-checkout set TamnoonPlaybooks/AWS
git checkout
2. Execute the automation from AWS directory.
i. Using CLI parameters:
python3 -m Automations.S3Actions.S3Helper --profile <aws_profile> --action check_public_access --bucketNames <comma separated list of bucket name(s) or all>
or
python3 -m Automations.S3Actions.S3Helper --awsAccessKey <aws_access_key> --awsSecret <aws_secret> --action check_public_access --bucketNames <comma separated list of bucket names>
This automation does not require any action params.
The playbook checks S3 bucket policies and ACLs for any configuration that allows public access, such as permissions granted to Principal * or ACLs with global access rights like READ or FULL_CONTROL for “AllUsers.”
Buckets are flagged as public if they have policies allowing s3:ListBucket or s3:* to everyone, or if their ACLs grant permissions to the AllUsers group. Deny policies override Allow and prevent exposure even if such conditions exist.
You’ll need permissions like s3:GetBucketPolicy, s3:GetBucketAcl, s3:GetBucketPolicyStatus, and access to both bucket-level and account-level public access configurations.
The script queries both account-level and bucket-level S3 block public access settings, such as IgnorePublicAcls and RestrictPublicBuckets, to determine if public access is effectively restricted regardless of existing policies or ACLs.
Yes. You can run the script with -bucketNames all to scan every bucket in the authenticated AWS account for public access risks and permission misconfigurations.
Yes, it’s recommended to enable S3 server access logging for any sensitive or critical buckets. Logging tracks who accessed what and when, providing visibility for auditing and security monitoring.
Every repair Tamnoon executes is a named procedure you can read, clone and audit before anything touches your plane.