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
전문가
답변함 일 년 전
0

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

gopal30
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠