Amazon S3 (Simple Storage Service) is AWS's object storage service, and misconfigured S3 buckets are one of the most common sources of cloud data breaches. Think of S3 buckets like filing cabinets that can accidentally be left unlocked and placed on the sidewalk - if you don't explicitly secure them, anyone walking by can look inside.
Public S3 bucket exposures have leaked millions of records: voter databases, military intelligence, healthcare records, and source code. Understanding S3 security is essential for both attackers finding exposed data and defenders preventing these catastrophic leaks.
Real-World Impact
Major S3 breaches: Capital One (100M records), Verizon (14M records), US Military (classified data), Twitch (source code). Many breaches could have been prevented with proper bucket policies.
S3 Security Model
ACLs Are Legacy
AWS now recommends disabling ACLs entirely (BucketOwnerEnforced). Use bucket policies instead. When auditing, check both ACLs and policies for misconfigurations.
S3 Bucket Discovery
S3 Exploitation
Bucket Policy Analysis
Principal: AWS: * vs Principal: *
Principal: "*" means completely public (no auth). Principal:{"AWS": "*"} means any authenticated AWS user (still very dangerous). Both are usually misconfigurations.
Pre-signed URLs
S3 Security Defenses
S3 Attack Methodology
S3 Security Assessment
1
DiscoveryFind S3 buckets via brute force naming, DNS enumeration, Google dorks, certificate transparency, and code analysis.
2
Check Public AccessTest with --no-sign-request. Try listing, reading, and writing. Check both bucket and object-level permissions.
3
Check Authenticated AccessUse your own AWS credentials. If access works with auth but not without, bucket allows any AWS user.
4
Analyze PoliciesGet bucket policy and ACLs. Look for Principal: *, wildcards, and overly permissive actions.
5
Search for Sensitive DataLook for .sql, .env, .git, terraform.tfstate, credentials, backups. Download and analyze findings.
6
Check for Write AccessTest if you can upload files. Write access enables web defacement, malware hosting, or data poisoning.
Knowledge Check
Challenges
Key Takeaways
- S3 misconfigurations are among the most common cloud vulnerabilities
- Principal: * = completely public, Principal: AWS: * = any AWS account
- S3 Block Public Access overrides policies/ACLs - enable it!
- Look for .sql, .env, .git, terraform.tfstate files in exposed buckets
- WRITE_ACP permission lets you escalate to full control
- Pre-signed URLs can leak sensitive data if long-lived or logged