Storage exposure & secrets

Public S3 buckets, exposed metadata endpoints (SSRF to 169.254.169.254), leaked keys in git, secrets management. The classic real-world cloud incident.

About 28 min read3-question knowledge check

The mental model

Storage exposure is the cloud era's version of leaving the filing cabinet on the sidewalk. An S3 bucket (or any object store), a metadata endpoint, and a secret in git are all the same failure in different clothes: **data or credentials that should be reachable by exactly one narrow set of principals become reachable by everyone.** The reason this is the *classic* real-world cloud incident is brutal economics — an attacker does not need an exploit, a phish, or a foothold. They need a URL and a script that tries bucket names. The breach is a curl, and the victim often finds out from a journalist or a data-dump on a forum.

The analogy that sticks: think of three kinds of leaked keys. A **public S3 bucket** is a storage unit whose door you left unlocked, with the unit number printed on your business card — anyone who tries the door walks in. The **metadata endpoint** (169.254.169.254) is a valet key hidden under the floor mat of every cloud server; an attacker who can make your server "reach into its own glovebox" (SSRF) hands them the valet key to your whole account. A secret in git history is the spare key you taped inside a book, then donated the book to a public library — deleting the tape later does not help, because everyone who checked out the book already photographed the key. Each is data-or-credential reachability gone wrong; each is defended by default-deny access plus not having the secret reachable in the first place.

Why interviewers dwell on this: it tests whether you understand that the cloud fails open when you are not careful and fails closed when you configure it deliberately, and whether you know the three concrete controls that matter — Block Public Access for storage, IMDSv2 for metadata, and a secrets manager plus history-aware rotation for keys. Reciting "don't make buckets public" is the junior answer; the hire explains why deleting a leaked key from the latest commit is not remediation and why blocking a bucket policy is not enough without Block Public Access.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision