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回答
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ