Securing Cloud Storage
Misconfigured cloud storage is the single most common cause of cloud data breaches. S3 buckets, Azure Blob containers, and GCP Cloud Storage buckets have exposed billions of records due to public access misconfigurations, weak bucket policies, and missing encryption. This lesson teaches you how cloud storage security works, how attackers find and exploit exposed buckets, and how to audit and harden storage configurations.
Learning Objectives — Deep Dive
Each objective below is broken down into plain English so you know exactly what you are learning, why it matters, and what you will be able to do when you are done. Mark each one complete as you work through the lesson.
Check for public buckets
List all S3 buckets and check their public access block settings.
aws s3api list-buckets --query "Buckets[*].Name" --output textEnable Block Public Access account-wide
Apply Block Public Access at the account level to prevent any bucket from being made public.
aws s3control put-public-access-block --account-id $(aws sts get-caller-identity --query Account --output text) --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=trueEnable default SSE-KMS encryption
Set SSE-KMS as the default encryption for all new objects in a bucket.
aws s3api put-bucket-encryption --bucket my-bucket --server-side-encryption-configuration file://sse-kms.jsonEnable access logging
Configure S3 server access logging to write to a separate audit bucket.
aws s3api put-bucket-logging --bucket my-bucket --bucket-logging-status file://logging.json