Last active
June 16, 2021 21:03
-
-
Save hatchcanon/698dcba8b9854b5a2a754c0e5ebbc4e8 to your computer and use it in GitHub Desktop.
list encryption status of all S3 buckets
This file contains 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
for bucket_name in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do | |
echo -ne "${bucket_name}," | |
encryption_info=$(aws s3api get-bucket-encryption \ | |
--bucket ${bucket_name} 2>/dev/null) | |
if [[ $? != 0 ]]; then | |
echo "no-encryption" | |
else | |
echo "${encryption_info}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment