Skip to content

Instantly share code, notes, and snippets.

@ScriptAutomate
Last active June 29, 2019 04:00
Show Gist options
  • Save ScriptAutomate/ce89e0b64fe135c4e954078b038d2024 to your computer and use it in GitHub Desktop.
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
# 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
}
}
@ScriptAutomate
Copy link
Author

I made a repo that includes each of the example gists: https://github.com/ScriptAutomate/s3nakedinpublic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment