-
-
Save tiagocordeiro/e5af3fe257c59f097a12123662b01533 to your computer and use it in GitHub Desktop.
[Python 3 / boto3 / AWS] List all S3 buckets, in the default region config, that have 'Public' permissions listed anywhere in the ACL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
s3 = boto3.resource('s3') | |
for bucket in s3.buckets.all(): | |
for oh_noes in s3.BucketAcl(bucket.name).grants: | |
if oh_noes['Grantee']['Type'] == 'Group' and oh_noes['Grantee']['URI'] == 'http://acs.amazonaws.com/groups/global/AllUsers': | |
print(bucket) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment