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.

3 Antworten
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
EXPERTE
beantwortet vor einem Jahr
0

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

gopal30
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen