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
已提问 1 年前690 查看次数
3 回答
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
专家
已回答 1 年前
0

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

gopal30
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容