Created
June 12, 2017 21:24
-
-
Save dannenberg/1d09f00afea5869a8ca72d98df1bd833 to your computer and use it in GitHub Desktop.
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
echo "buckets logging to a folder other than <theirname>/:" | |
for bucket in $(aws s3 ls | awk '{print $3}') | |
do | |
bucket_status=$(aws s3api get-bucket-logging --bucket $bucket | grep -v "$bucket/") | |
if [[ $bucket_status != "" ]]; then | |
echo "\t$bucket" | |
fi | |
done | |
echo "buckets logging to a bucket other than s3.bucket.access.logs:" | |
for bucket in $(aws s3 ls | awk '{print $3}') | |
do | |
bucket_status=$(aws s3api get-bucket-logging --bucket $bucket | grep -v 's3.bucket.access.logs') | |
if [[ $bucket_status != "" ]]; then | |
echo "\t$bucket" | |
fi | |
done | |
echo "buckets without logging:" | |
for bucket in $(aws s3 ls | awk '{print $3}') | |
do | |
bucket_status=$(aws s3api get-bucket-logging --bucket $bucket) | |
if [[ $bucket_status == "" ]]; then | |
echo "\t$bucket" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment