Last active
June 29, 2019 04:00
-
-
Save ScriptAutomate/ce89e0b64fe135c4e954078b038d2024 to your computer and use it in GitHub Desktop.
[PowerShell Core / AWSPowerShell.NetCore / 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
# Requires AWSPowerShell.NetCore Module | |
# Install-Module AWSPowerShell.NetCore | |
# https://www.powershellgallery.com/packages/AWSPowerShell.NetCore | |
foreach ($OhNoes in Get-S3Bucket) { | |
if (($OhNoes | Get-S3ACL).Grants.Grantee | where {$_.URI -eq 'http://acs.amazonaws.com/groups/global/AllUsers'}) { | |
$OhNoes | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a repo that includes each of the example gists: https://github.com/ScriptAutomate/s3nakedinpublic