Identity & Access Management — the complete mental model
Every IAM decision answers one question:
who
can do what
on which
Principal
→
Role
→
Resource
bound together by
the glue
IAM Policy
{ bindings: [{ role, members }] }
A principal is any identity that can be authenticated. These are the “who” in IAM.
Google Account
user:alice@example.com
A real human user
Service Account
serviceAccount:api@proj.iam.gserviceaccount.com
Identity for apps/workloads — also a resource!
Google Group
group:backend-team@company.com
Bundle of users — recommended for scale
Domain
domain:company.com
Everyone in a Workspace domain
allUsers
allUsers
Anyone — including anonymous
allAuthenticatedUsers
allAuthenticatedUsers
Any logged-in Google account
Service accounts have a dual nature — they act as an identity (can call APIs), but are also a resource (you can grant others permission to impersonate them).
Roles are bundles of permissions. You never assign permissions directly — always through roles.
AVOID IN PRODBasic Roles
OwnerEditorViewer
Very broad — Editor gives write to almost everything. Violates least privilege.