Created
July 27, 2018 17:52
-
-
Save bdeitte/b5ff2592fc6409fbaa78b5bd69e2c49b to your computer and use it in GitHub Desktop.
List of encrypted buckets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
# Create an S3 client | |
s3 = boto3.client('s3') | |
# Call S3 to list current buckets | |
response = s3.list_buckets() | |
# Get a list of all bucket names from the response | |
for bucket in response['Buckets']: | |
bucket_encryption = True | |
try: | |
s3.get_bucket_encryption(Bucket=bucket['Name']) | |
except: | |
bucket_encryption = False | |
print(bucket['Name'], bucket_encryption) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment