Skip to content

Instantly share code, notes, and snippets.

@bdeitte
Created July 27, 2018 17:52
Show Gist options
  • Save bdeitte/b5ff2592fc6409fbaa78b5bd69e2c49b to your computer and use it in GitHub Desktop.
Save bdeitte/b5ff2592fc6409fbaa78b5bd69e2c49b to your computer and use it in GitHub Desktop.
List of encrypted buckets
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