Notes
Why buckets leak
Why do buckets leak? Because several settings can each make a bucket public, and that is the trap. An access control list set to public-read. A bucket policy allowing a wildcard principal, meaning everyone. A careless make-public click to share a file. Config copied from a tutorial. The real problem is the confusion: multiple overlapping controls, and getting any one wrong exposes the data. That is why the providers added a single master switch, which we come to next.
- a bucket ACL set to public- read
- a bucket policy allowing "Principal": "*"
- a careless "make public" click for convenience
- copied config from a tutorial
- the confusion: several controls, any one can expose it
Block public access
The most important control is block public access, an account-wide master switch. When on, it overrides any bucket policy or ACL that would make data public, so even a mistaken public setting has no effect. Turn it on for the entire account, and exempt a specific bucket only through a deliberate, reviewed process. This one setting prevents the classic public-bucket leak outright, so it should be a non-negotiable guardrail, and every cloud has an equivalent. Enable it everywhere and most of this risk disappears.
- account-wide "block public access" setting
- overrides any bucket policy or ACL that would make data public
- turn it ON for the whole account; exempt only with review
- this one setting prevents the classic leak
- GCP/Azure have equivalents
Layered access
Beneath the master switch, access is controlled by policies. IAM policies govern what identities in your account may do. Bucket policies handle cross-account and fine-grained access. The same rules as cloud IAM apply: avoid wildcard principals, grant least privilege, scope to specific identities and actions. Modern practice is to disable the older ACL mechanism and use policies only. Storage is private by default, like the network, and you open access deliberately.
- IAM policies: what identities in your account can do
- bucket (resource) policies: cross-account and fine- grained rules
- avoid wildcards; grant least privilege
- disable ACLs where you can (prefer policies)
- private by default, like the network
Encrypt and version
Two protections for the data itself. Encryption at rest is on by default now, and using a managed key gives you control and an audit trail, as the KMS episode covers. Versioning keeps old copies, so an accidental or malicious delete or overwrite can be recovered, which also helps against ransomware. Object lock can make objects undeletable for a period. Add lifecycle rules to expire old data and access logging to see who read what. These turn a bucket into a well-managed store.
- encryption at rest: on now, use KMS keys for control
- versioning: keep old versions so deletes are recoverable
- object lock: prevent deletion (ransomware, tampering)
- lifecycle rules to expire old data
- access logging on
Detect exposure
Even with good defaults, mistakes happen, so detect exposure continuously. Posture management tools, which the coming episodes cover, flag public buckets across your accounts. Access analyzers report any resource shared outside your account. Alerts fire on policy or ACL changes that expose data. And you can scan your own storage like attackers do. The goal is to catch an accidental exposure in minutes, not months later in a breach report. Prevention plus detection is the full defence.
- posture tools (CSPM) flag public buckets continuously
- access analyzer reports externally shared resources
- alert on policy/ACL changes that expose data
- scan your own storage like attackers do
- catch it in minutes, not a breach report
Common mistakes
Mistakes. Block-public-access left off at the account level, removing the one control that would prevent a leak. Wildcard principals in bucket policies, which grant everyone access. Making a whole bucket public to share a single file instead of using a signed URL. Relying on the confusing ACL mechanism rather than policies. No versioning, so an accidental or malicious delete is permanent. And no monitoring, so a bucket that becomes public stays that way unnoticed until it is found by someone else.
- block-public-access off at the account level
- wildcard principals in bucket policies
- making a bucket public to share one file
- ACLs instead of policies
- no versioning, so a delete is permanent
- no monitoring for newly public buckets
Say it like this
In the interview: the most important control is account-wide block-public-access, enforced as a guardrail, because it overrides any mistaken public policy or ACL. On top, storage is private by default with least-privilege bucket policies, no wildcard principals, ACLs disabled. I turn on encryption at rest and versioning so deletes are recoverable. For sharing, I use time-limited signed URLs or a CDN, not public. And I continuously scan for exposure, so an accidental public bucket is caught in minutes.
- "Turn on account-wide block- public-access as a guardrail;
- it overrides any mistaken
- public policy. Private by default, least-privilege
- bucket policies, no wildcards, ACLs disabled. Encryption and versioning on. Share with signed URLs, not public, and scan continuously for exposure."