You discover an S3 bucket with customer data has been public for three months. What now?
IntermediateScenarioSecurity incidents
Answer
Situation read → Close it first, then work out whether anyone actually downloaded it. That answer decides whether this is a reportable breach.
What I'd do →
- Block public access on the bucket immediately, then at the account level.
aws s3api put-public-access-block --bucket customer-exports \
--public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
aws s3control put-public-access-block --account-id 111122223333 \
--public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
- Check access evidence: S3 server access logs or CloudTrail data events, if enabled. Look for
GetObjectfrom unknown IPs. - Bring in security, legal and privacy early; breach notification deadlines (like GDPR's 72 hours) start when you become aware.
- Find out how it happened (bucket policy, ACL, a Terraform change) via CloudTrail.
- Prevent: account-level Block Public Access in every account, an SCP stopping anyone from disabling it, and AWS Config or Security Hub rules alerting on public buckets.
Why → Account-level Block Public Access overrides bucket policies, so one change protects every bucket.
Interview tip → If data events weren't enabled, say so honestly; you may not be able to prove no one accessed it.
More on Security incidents
An AWS access key for a production IAM user was pushed to a public GitHub repo 20 minutes ago. What do you do in the first 30 minutes?AdvancedYou find pods in your cluster running a crypto miner. What do you do?AdvancedA critical CVE is announced in a library you use. You have 200 images across 40 repos. How do you find and patch everything fast?IntermediateGuardDuty reports an EC2 instance talking to a known command-and-control IP. What do you do?AdvancedAn engineer left the company three weeks ago and you find their access key was used yesterday. How do you respond and fix the process?BeginnerA secret was printed in plain text in a CI job log. What do you do?Beginner