The idea
Corinne runs the platform at Lodestar Maps, a small firm that serves map tiles to its customers' websites. The tiles live in cloud object storage, in a bucket that is meant to be public: anyone's browser has to fetch them. This morning a customer emailed: a second Lodestar bucket, full of customer records, also answers without a login.
You are at Corinne's desk with the aws command-line tool and no credentials, the same view anyone on the
internet has. Confirm the tip from the outside, find the one setting that makes a bucket answer strangers, turn
it off, and prove the fix from the outside.
Steps
-
Public on purpose
Cloud object storage keeps files in buckets. Every request goes to one address, the storage endpoint, and names the bucket it wants. A bucket is private by default: a request with no valid credentials (no access key proving who is asking) is refused. Lodestar's map tiles are the exception: a browser loading a customer's map has no Lodestar login, so the tiles bucket is deliberately marked public.
You are on
operator, a machine with theawstool and no keys set up. Point it at Lodestar's endpoint with--endpoint-url(hereapi, at10.0.1.20) and list the tiles bucket with--no-sign-request, the flag that tellsawsto send no credentials at all, as a stranger would.operator:~# aws --endpoint-url http://10.0.1.20 s3 ls s3://lodestar-tiles --no-sign-request
-
The bucket that should not answer
The customer's tip named a different bucket:
lodestar-exports, where Lodestar drops its quarterly customer extracts. Nothing on a public website ever needs it, so it should be private: a stranger's unsigned request should be refused. Run the same anonymous listing against it and see.operator:~# aws --endpoint-url http://10.0.1.20 s3 ls s3://lodestar-exports --no-sign-request
-
Read what leaked
A listing is bad; a read is worse. The same
--no-sign-requestthat listed the bucket will download an object from it. Copy the export to your screen (cp <object> -writes it to standard output) and see exactly what a stranger could take.One honest note before you do: reading data from a system whose owner has not authorised you in writing is unauthorised access, public bucket or not. It is lawful here only because this bucket is Lodestar's own, which is Corinne's to inspect.
operator:~# aws --endpoint-url http://10.0.1.20 s3 cp s3://lodestar-exports/customers-2026-q1.csv - --no-sign-request
-
Why it answers
Why does one bucket answer strangers and another not? In a real cloud, a bucket is anonymously readable only when something explicitly opens it: a bucket policy that grants public read, or per-object access lists (ACLs) set to public, with the account's "block public access" guard switched off. This lab folds all of that into one setting: each bucket in Lodestar's account config carries a
publicflag, and the endpoint reads it on every request. You are onapinow: the box that serves the config, not the outsider'soperator. Look at the config withjq, which pretty-prints thebucketssection of the file.Read the two entries side by side.
lodestar-tilesis"public": trueon purpose: the map widget needs it.lodestar-exportsis"public": trueby mistake: nothing needs it, and it holds customer data. The fix is not to delete the file or move it; it is to turn that one flag off for the bucket that should never have carried it.api:~# jq .buckets /opt/cloud/seeds/bucket-exposure.json
-
Lock it, and prove it from outside
Make
lodestar-exportsprivate. Write the account config back with itspublicflag set tofalse, leaving the tiles bucket untouched: a real fix never breaks the thing that was meant to work. The endpoint re-reads the config the moment the file changes, so no restart is needed.Then do the only test that matters: run the attacker's own command again, from
operator, with no credentials. The exports bucket must now refuse you, and the tiles bucket must still serve.operator:~# aws --endpoint-url http://10.0.1.20 s3 ls s3://lodestar-exports --no-sign-request operator:~# aws --endpoint-url http://10.0.1.20 s3 ls s3://lodestar-tiles --no-sign-request
Run these steps on real machines