List all s3 buckets that are not encrypted in aws

0

I would like to get the list of all s3 buckets that are not encrypted.

It would be helpful if we can achieve it through aws cli command. if so please share the code here.

if not please share the other approach

  • please tag the answer as accepted if you feel it has provided the required information to your query. Thanks.

gopal30
asked a year ago650 views
3 Answers
1

Here is the script using AWS CLI , this lists all buckets and lists the status of each bucket encryption.

#!/bin/bash
buckets=( $(aws s3api list-buckets --query 'Buckets[*].Name' --output text))
for bucket in "${buckets[@]}";do 
    echo " $(echo $bucket),$(aws s3api get-bucket-encryption --bucket $bucket --query 'ServerSideEncryptionConfiguration.Rules[*].ApplyServerSideEncryptionByDefault.SSEAlgorithm' --output text)"
done
AWS
answered a year ago
0

Thanks, Likewise can we get the list of all resources (Like s3, Ec2, Snapshots etc) that are not encrypted in AWS

gopal30
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions