Lesson 8 of 14 · 14m
GCS: `allUsers` Means All Users, and `allAuthenticatedUsers` Still Means All Users
The two bucket principals that put objects on the internet, and the two switches that kill the whole mistake class.
The two literals
Bind roles/storage.objectViewer to member allUsers on a bucket and the bucket is on the internet — anonymous HTTPS GETs work, no Google account required, no session, nothing. Bind it to allAuthenticatedUsers and the bucket is still on the internet: the member means any identity authenticated to Google at all — every gmail.com account in existence, every Workspace tenant on earth, every service account in every project ever created. It does not mean "authenticated users of your project" or "users in your org." The name reads like a scope and operates like the open internet; Google's documentation spends a paragraph warning about the misreading because it keeps happening.
roles/storage.objectViewer carries storage.objects.list alongside storage.objects.get, so a public bucket isn't one known URL — it's a directory listing of every object in it. Enumeration tooling brute-forces storage.googleapis.com/<bucket-name> candidates continuously; if the binding is open, the listing lands in the scan output.
Two access models, one footgun class
Buckets historically carried two permission systems: bucket-level IAM, and per-object ACLs — XML access control lists, the S3-era model. With uniform bucket-level access enabled — the state you want — ACLs are disabled and bucket IAM is the only surface. The ACL model's failure mode is disagreement: an object ACL saying public-read inside a bucket whose IAM says private. Two systems, and the more permissive one wins. Set uniformBucketLevelAccess on the bucket; better, enforce constraints/storage.uniformBucketLevelAccess at the org node so new buckets can't split-brain at all.
Public access prevention is the second switch: publicAccessPrevention: enforced on a bucket — or constraints/storage.publicAccessPrevention org-wide — rejects allUsers/allAuthenticatedUsers IAM bindings and refuses anonymous ACLs outright. It converts "don't make that mistake" into "that mistake cannot be made."
Sharing objects correctly
The legitimate reason people reach for allUsers is "I need to share one file." The mechanism for that is the V4 signed URL: a URL carrying X-Goog-Algorithm=GOOG4-RSA-SHA256, X-Goog-Credential, X-Goog-Date, X-Goog-Expires (capped at seven days), and X-Goog-Signature, produced by signing a canonical request with a service account's signBlob — via gcloud storage sign-url when a key exists, or iamcredentials signBlob when it doesn't (the latter is the point: mint signatures without ever possessing a key). Scoped to one object, one verb, bounded expiry. A signed URL is still a bearer token in URL form — leakable, unauthenticated — but it's time-bounded and object-scoped rather than a standing hole in the bucket.
One property makes open bindings worse than they look: bucket names are globally unique and enumerable. storage.googleapis.com/<guess> distinguishes 403 from 404, so scanners brute-force plausible names — company-backups, company-prod, company-terraform-state — and an open binding converts a guessed name into a full listing. Most public bucket leaks in the record are exactly this shape: a guessable name plus allUsers, not an exotic exploit.
The signed-URL caveat that bites later: there is no per-URL revocation. Killing a live signed URL means rotating or deleting the signing key version, which invalidates every URL that version minted. Keep signing SAs per-purpose so revocation is a scalpel, not an amputation.
Land it
Uniform bucket-level access on, public access prevention enforced, constraints/iam.allowedPolicyMemberDomains limiting bindings to your domains — a contractor's gmail can't be named even if someone tries. Audit existing buckets: Policy Analyzer's "resources shared with external principals" query, plus gcloud storage buckets describe gs://bucket — it reports uniform_bucket_level_access and public_access_prevention directly, which are the fields that decide whether the mistake class is open or structurally closed. And when sharing is real, mint signed URLs from a dedicated SA whose only power is the objects it serves. And run the allAuthenticatedUsers audit separately — that member literal reads as scoped and operates as public.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.
Big Tech Plans to Work with the Public Sector for Cybersecurity
Both Microsoft, Inc. and Alphabet, Inc. will put a combined $30 billion dollars into cybersecurity over the next five years and work with the public sector on several initiatives to help improve cybersecurity.
Zero Trust Everything: The Complete Guide to Self-Hosting Teleport for Secure Infrastructure Access
SudoSecurity runs Teleport internally for everything — admin panel access, secure database connections, Kubernetes, and zero-trust philosophy across our entire team. This is the complete technical guide to installing, configuring, and running your own self-hosted Teleport cluster from scratch.
What is SSRF? Server-Side Request Forgery and the Attack That Breached Capital One
SSRF tricks your server into making requests to internal systems — cloud metadata services, internal APIs, AWS credentials endpoints. It turned a WAF misconfiguration into 100 million stolen Capital One records