Created
May 1, 2018 22:24
-
-
Save djmetzle/961ea8a966a5f2ac88aefb8ef13f49ce to your computer and use it in GitHub Desktop.
Quick Script to find S3 buckets with logging enabled
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
#!/bin/bash -e | |
# Get list of buckets | |
S3_BUCKETS=( `aws s3api list-buckets --query "Buckets[].Name" --output=text` ) | |
for bucket in "${S3_BUCKETS[@]}"; do | |
BUCKET_LOGGING=`aws s3api get-bucket-logging --bucket $bucket` | |
if [ -n "$BUCKET_LOGGING" ]; then | |
echo "$bucket: $BUCKET_LOGGING" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment