Identity and Access Management (IAM) in Google Cloud: Who Can Do What, and Where

Identity and Access Management (IAM) in Google Cloud: Who Can Do What, and Where

A beginner-friendly guide to the system that decides who may do what on which Google Cloud resource: principals, roles, permissions, policies, inheritance, service accounts, and the habits that keep access safe.

Picture a large office building. Hundreds of people walk in every day: employees, visitors, cleaners, delivery drivers, and the occasional robot that restocks the vending machines. Some may enter only the lobby, some may enter the server room, and a very few may open the safe in the finance office. Someone has to decide, for every person and every door, who gets in. In Google Cloud, that someone is Identity and Access Management, usually shortened to IAM. Almost every action you take in Google Cloud, from creating a virtual machine to reading a file, passes through IAM first. Understanding it is the single most valuable security skill for a cloud beginner. This tutorial builds that understanding from zero, one idea at a time.

1What Is IAM?

IAM is Google Cloud’s system for deciding who can do what on which resource.

Google’s documentation describes IAM as a fine-grained authorization system. Authorization means deciding what an already identified person or program is allowed to do. Before any action runs, such as creating a virtual machine or viewing a dataset, IAM checks that the requester has the permissions needed, and blocks the action if they do not.

Every access rule in IAM is built from three simple pieces. The first is a principal, which is the identity receiving access. The second is a role, which is a bundle of permissions. The third is a resource, which is the thing being accessed. You connect the three by granting a role to a principal on a resource. That is the whole idea, and almost everything else in this tutorial is a refinement of it.

Simple Analogy

Think of a hotel. The principal is a guest or staff member. The role is the type of key card they carry, such as guest, housekeeper, or manager. The resource is a specific room or floor. IAM is the rulebook and the lock system that decides whether a card opens a given door.

Who
The principal: a person, group, or program
Can do what
The role: a bundle of permissions
On which resource
A project, a bucket, a virtual machine, and so on
i
Good to Know

IAM is not a separate product that you switch on. It is built into Google Cloud, and every project already uses it. Your job is not to enable it but to configure it carefully.

2Authentication Versus Authorization

Proving who you are is a different step from deciding what you may do.

Beginners often mix up two words that sound alike. Authentication is the step where you prove your identity, for example by signing in with a password and a second verification step. Authorization is the step that follows, where the system checks whether that proven identity is allowed to perform the requested action. IAM is mainly about authorization. Identity systems such as Google Accounts, Cloud Identity, and federation with outside identity providers handle the proving of identity.

Simple Analogy

At an airport, showing your passport at the check-in desk is authentication: it proves who you are. Having a boarding pass for a particular flight and gate is authorization: it decides where you may go. A real passport does not let you board any plane you like.

sequenceDiagram
  participant U as User or program
  participant A as Identity check
  participant I as IAM
  participant R as Google Cloud resource
  U->>A: Sign in and prove identity
  A-->>U: Identity confirmed
  U->>I: Request an action on a resource
  I->>I: Check policies for permission
  alt Permission found
    I->>R: Allow the action
    R-->>U: Result returned
  else Permission missing
    I-->>U: Access denied
  end
        
FIG 1 — Authentication proves identity first; IAM then decides whether the action is allowed
!
Common Mistake

Believing that a successful sign-in means a person can do everything. Signing in only proves who they are. Access to each resource still depends on the permissions granted through IAM.

3Principals: Who Is Asking?

A principal is any authenticated identity that can be given access.

Google’s documentation says principals are authenticated identities and notes that they were formerly called members, a word some interfaces and tools still use. It groups them into two families: human users and workloads.

Human

Google Accounts

An individual person’s account, such as a work account managed through Google Workspace or Cloud Identity.

Human

Google groups

A named collection of users. Granting a role to a group gives it to every member and updates automatically as people join or leave.

Human

Workforce identity federation

Identities from an outside identity provider, such as a company’s existing sign-in system, placed in workforce identity pools.

Workload

Service accounts

Special accounts that belong to applications or virtual machines, not to people.

Workload

Workload identity federation

Identities for programs running outside Google Cloud, placed in workload identity pools, so they can be recognized without long-lived keys.

Simple Analogy

Principals are the different kinds of visitors to the building. Employees are Google Accounts, departments are groups, visitors from partner companies come through federation, and the delivery robots are service accounts. Each needs its own kind of badge.

i
Prefer Groups

Google’s guidance on access governance recommends granting access to groups rather than to individual users. When someone changes team, you update the group membership and never touch the policies.

!
Common Mistake

Granting roles to dozens of individual people one by one. Over time nobody remembers why each grant exists, and former employees keep access nobody notices.

4Permissions: The Smallest Unit of Access

A permission is a single allowed operation, such as listing projects or publishing a message.

Permissions are written in a consistent pattern: the service, then the resource type, then the action. Google’s documentation gives the form as service, resource, and verb joined by dots, and offers the example of a permission that lets a user list Resource Manager projects. Permissions often match one-to-one with the methods of a service’s programming interface, so if an action exists in the interface, a permission usually guards it.

The crucial rule is that you cannot grant a permission directly to a principal. Permissions are only granted by way of roles. This keeps access manageable, because a person sees roles, not hundreds of tiny permissions.

Simple Analogy

A permission is like a single instruction on a checklist: “may open the supply cupboard,” “may sign for deliveries,” “may reset the alarm.” You do not hand out single instructions one by one; you give people a job description that contains the right set.

Part 1

Service

Which Google Cloud product the permission belongs to.

Part 2

Resource type

Which kind of object inside that product it applies to.

Part 3

Verb

The action itself, such as get, list, create, update, or delete.

i
Reading Error Messages

When access is denied, the error message often names the missing permission. Reading that name tells you the service, the resource type, and the action, which points straight to the role you need.

5Roles: Bundles of Permissions

A role groups the permissions needed for a job, and you grant the role.

Google describes three types of role. Predefined roles are maintained by Google Cloud services and designed for common tasks; for example, a Pub/Sub publisher role allows publishing to a topic. Custom roles are created by you and contain only the permissions you choose. Basic roles are broad roles covering many services, intended mainly for testing.

Role typeWho maintains itHow wide it isUse it for
BasicGoogleVery broad across many servicesQuick tests and learning; Google advises against them in production
PredefinedGoogle Cloud servicesFocused on a service and a jobMost real-world grants
CustomYouExactly the permissions you selectSpecial cases where no predefined role fits
flowchart LR
  P1["Permission: list items"] --> R1["Viewer-style role"]
  P2["Permission: read item"] --> R1
  P1 --> R2["Editor-style role"]
  P2 --> R2
  P3["Permission: create item"] --> R2
  P4["Permission: delete item"] --> R2
  R1 --> U["Principal receives the role"]
  R2 --> U
        
FIG 2 — Permissions are packed into roles, and principals receive roles, never single permissions
Simple Analogy

Roles are job titles. A “librarian” title bundles the right to shelve, lend, and catalogue books. Basic roles are like handing someone a master key because it was easier than figuring out which doors they need. Predefined roles are standard job descriptions. Custom roles are a tailored description for an unusual job.

!
Common Mistake

Using basic roles such as Owner or Editor for convenience. They are very permissive and cover many services at once. Google’s documentation recommends avoiding them in production environments and choosing narrower predefined roles instead.

i
Custom Roles Have a Cost

Custom roles give precise control, but you must maintain them as services add new permissions, and Google applies limits on how many you can create per project and organization. Use them only when predefined roles genuinely do not fit.

6Resources and the Resource Hierarchy

Google Cloud organizes everything in a tree, and access flows down the tree.

Resources are the things you want to protect: virtual machines, storage buckets, datasets, and many more. Google Cloud arranges them in a hierarchy. At the top is the organization, which represents a company. Beneath it are optional folders, used to group projects, for example by department or environment. Beneath folders are projects, which hold your actual resources. Inside projects are the individual service resources.

flowchart TD
  ORG["Organization"] --> F1["Folder: Engineering"]
  ORG --> F2["Folder: Finance"]
  F1 --> P1["Project: Web app dev"]
  F1 --> P2["Project: Web app prod"]
  F2 --> P3["Project: Reporting"]
  P1 --> R1["VM, bucket, dataset"]
  P2 --> R2["VM, bucket, dataset"]
  P3 --> R3["Dataset"]
        
FIG 3 — The resource hierarchy: organization, folders, projects, then individual resources
Simple Analogy

The hierarchy is like a company’s office campus. The organization is the whole campus, folders are buildings, projects are floors, and resources are the rooms and cabinets on each floor. A master pass for a building opens every floor and room inside it.

i
Why the Tree Matters

Where you grant a role decides how far it reaches. A role granted on a folder affects every project and resource beneath it. A role granted on a single bucket affects only that bucket.

!
Common Misconception

Thinking all resources can hold their own access rules. Google notes that not all resources accept roles directly. Sometimes the only way to give access is to grant a role on a parent such as the project.

7Allow Policies and Role Bindings

An allow policy is the document that records who has which role on a resource.

An allow policy is attached to a resource. Google’s documentation explains that it contains role bindings that link roles to principals, and that older documents may call it an IAM policy. When someone requests access, IAM checks the allow policy of that resource. If a binding grants a role that contains the required permission to that person, the request is allowed.

Piece 1

Role binding

A link between one role and a list of principals.

Piece 2

Allow policy

The collection of all role bindings on a single resource.

Piece 3

Optional condition

A rule attached to a binding so it applies only in certain circumstances.

Simple Analogy

An allow policy is the access sheet pinned beside a door. It lists job titles and the names of the people holding them: “Managers: Asha, Ravi. Cleaners: the Cleaning Team group.” The guard at the door looks at the sheet, and if your name or your group appears next to a suitable title, you walk in.

Policies are additive

Allow policies only add access. If any binding in the applicable policies grants the permission, the action can be allowed. Removing access therefore means removing the binding that grants it, not adding a rule saying “no” in the same place. For explicit blocking, Google offers a different policy type called deny policies, covered later.

!
Common Mistake

Removing a user from one policy and assuming they have lost access. They may still hold the same permission through a group, or through a policy on a parent resource. Always look at the effective policy, described next.

8Policy Inheritance and the Effective Policy

Roles granted on a parent flow down to everything beneath it.

Container resources, namely organizations, folders, and projects, pass their allow policies down to everything below them. Google highlights three benefits. You can grant broad access with one binding, such as giving a security team a role at the organization level. You can reach resources that cannot hold their own policy, such as log buckets, by granting a role on an ancestor project. And you can determine full access by reviewing the effective allow policy, which is the combined set of the resource’s own policy and the policies of all its ancestors.

flowchart TD
  O["Organization policy: Security team can view everything"] --> F["Folder policy: Developers group can deploy"]
  F --> P["Project policy: Intern can read logs"]
  P --> R["Resource: effective access is the union of all three"]
        
FIG 4 — Effective access on a resource is the combination of its own policy and every ancestor’s policy
Simple Analogy

Inheritance is like a building master key. If the building manager can open every door in the building, you do not need to list the manager on every individual door. But it also means that to know who can open a particular door, you must check the door’s own sheet and the sheets for the floor and the building.

Granting access to a whole department

A company puts all finance projects in one folder, then gives the finance group a viewer role on that folder. New finance projects added later are covered automatically.

Auditing who can reach a database

A security reviewer checks the dataset’s own policy, then the project, folder, and organization above it. Only the combined result tells them who can truly read the data.

!
Common Mistake

Granting a powerful role high in the tree “to save time”. Because the role flows down, a single high-level grant can expose every project beneath it. Grant at the lowest level that does the job.

9Service Accounts: Identities for Programs

Service accounts let applications act in Google Cloud without borrowing a person’s identity.

Applications often need to call Google Cloud services: a web server reading from a database, a nightly job writing to storage. They need an identity to do so. A service account is that identity. Unlike a Google Account, it belongs to an application or virtual machine rather than a person. Google’s documentation lists service accounts as one of the workload principal types.

A service account is both a principal and a resource. It is a principal because it can be granted roles on other resources. It is a resource because other principals can be granted roles on it, such as the ability to use it or to act as it.

Simple Analogy

A service account is like a company credit card issued to a department instead of a person. The department can spend only what its limit and purpose allow, and when a staff member leaves, the card keeps working for the department. You would never lend your personal card for office purchases.

flowchart LR
  APP["Application on a virtual machine"] -->|"runs as"| SA["Service account"]
  SA -->|"has role"| B["Storage bucket"]
  SA -->|"has role"| Q["Message queue"]
  SA -.->|"no role"| DB["Database: access denied"]
        
FIG 5 — An application runs as a service account and can reach only what that account’s roles allow

Good habits for service accounts

1

One account per workload

Give each application its own service account, so one compromise does not expose everything.

2

Grant only needed roles

Start with nothing and add narrow roles until the application works.

3

Avoid downloaded keys

A downloaded key file is a password that never expires unless you manage it. Prefer attaching the service account to the workload or using federation.

4

Delete unused accounts

Abandoned service accounts are a quiet risk. Google’s governance guidance lists them among things to clean up.

5

Watch who can impersonate

Anyone allowed to act as a service account effectively has its power. Review those grants carefully.

!
Common Mistake

Using a single, powerful service account for everything, or leaving a key file in a code repository. Either choice turns one leak into a full-scale breach.

10Federation: Using Identities You Already Have

Federation lets outside identities work in Google Cloud without creating duplicate accounts.

Many companies already have a system that knows their employees, such as a corporate directory. Rather than creating a second set of accounts, Google Cloud can trust that existing system. This is called federation. Google’s documentation names two forms in its list of principals: workforce identity federation for human users, and workload identity federation for programs.

For people

Workforce identity federation

Employees sign in with their company identity provider and receive access to Google Cloud according to roles granted to their federated identities.

For programs

Workload identity federation

Applications running in other environments, such as another cloud or an on-premises system, are recognized by their own identity, so no downloaded service account key is needed.

Simple Analogy

Federation is like a visitor from a partner company being admitted because the front desk trusts the partner’s staff badge. You do not need to create a new badge for every visitor; you agree on whom you trust and what that badge allows.

Single sign-on for staff

A company connects its existing directory, so employees use one login everywhere. When someone leaves and is removed from the directory, their cloud access ends with it.

Pipelines from another platform

A build pipeline running outside Google Cloud needs to deploy. Workload identity federation lets it prove its identity and receive short-lived access, avoiding a stored key.

i
Why It Is Safer

Federation reduces long-lived secrets. Short-lived credentials that expire on their own are much less damaging if stolen than permanent key files.

11Deny Policies: Saying No on Purpose

Deny policies block specific permissions even when a role would otherwise allow them.

Allow policies are additive, so by themselves they cannot forbid something. Deny policies fill that gap. As Google describes them, deny policies prevent principals from using certain permissions even if they hold a role that includes those permissions. They give central teams a way to set guardrails that individual project owners cannot override with their own grants.

flowchart TD
  REQ["Request arrives"] --> D{"Deny policy blocks it?"}
  D -->|"Yes"| X["Access denied"]
  D -->|"No"| A{"Allow policy grants it?"}
  A -->|"Yes"| OK["Access allowed"]
  A -->|"No"| X
        
FIG 6 — Deny rules are checked first; an allow only matters if nothing denies the request
Simple Analogy

A deny policy is a “do not enter” sign that overrides everyone’s key card. Even the manager’s key opens nothing in a room marked with the sign. Allow rules are the key cards; deny rules are the signs.

Protecting dangerous actions

A security team denies the permission to delete important logging settings for everyone except a small break-glass group, so no project owner can switch off auditing by accident.

i
Use Sparingly

Deny rules are powerful and can make troubleshooting harder, because access that “should” work is blocked by a rule somewhere else. Document each deny rule and test it carefully before applying it widely.

12Principal Access Boundaries

A principal access boundary limits which resources a principal can ever reach.

Google’s overview describes Principal Access Boundary policies as policies that define which resources a principal is eligible to access. A principal cannot reach resources outside that scope, even if a role has been granted on them. Where deny policies block specific permissions, this boundary draws a fence around the set of resources.

Simple Analogy

Imagine an employee badge that works only in one building of the campus, no matter what any individual floor’s sheet says. The building limit is the boundary. Inside that building, the usual role rules still apply.

ControlQuestion it answersEffect
Allow policyWho is granted which role on this resource?Adds access
Deny policyWhich permissions are blocked regardless of roles?Removes specific access
Principal access boundaryWhich resources is this principal eligible to reach at all?Limits the overall scope
i
Check Availability

Advanced policy types are newer than basic allow policies, and their supported services and details evolve. Check Google’s current documentation before designing around them.

13IAM Conditions: Access Only When Rules Are Met

Conditions make a grant depend on attributes such as time or the target resource.

Google describes IAM Conditions as attribute-based logic added to policies, including role bindings. A condition can look at attributes such as the resource being accessed or the time of the request. The simplest example is a role that applies only during certain hours, or a temporary grant that expires automatically on a chosen date.

Simple Analogy

A conditional grant is like a visitor pass that is valid only on Tuesday afternoons, or only for the third-floor meeting room. The pass is real, but it stops working outside its conditions.

Temporary contractor access

A contractor gets a viewer role that expires at the end of a three-week engagement. Nobody has to remember to remove it.

Limiting by resource name

A team may manage only the storage buckets whose names begin with their team prefix, even though they hold a storage role on the whole project.

i
Governance Guidance

Google’s access governance guidance recommends conditional role bindings so that temporary access expires automatically, rather than relying on someone to clean up later.

!
Common Mistake

Making conditions too clever. Complex expressions are hard to read, test, and audit. Keep them simple, and write down what each one is meant to achieve.

14Privileged Access Manager: Temporary Power

Privileged Access Manager gives people strong access only for a short, recorded time.

Standing access, meaning permissions that a person holds all day every day, is risky for the most powerful roles. Google’s overview describes Privileged Access Manager, often shortened to PAM, as letting principals request temporary, auditable access instead of holding standing permissions. Requests can require a written justification or approval from someone else.

sequenceDiagram
  participant E as Engineer
  participant P as Privileged Access Manager
  participant M as Approver
  participant R as Sensitive resource
  E->>P: Request temporary elevated access with a reason
  P->>M: Ask for approval
  M-->>P: Approve
  P-->>E: Grant access for limited time
  E->>R: Do the urgent task
  P->>P: Access expires and is logged
        
FIG 7 — Just-in-time access: request, approve, use, and expire automatically
Simple Analogy

PAM is like a bank vault that is opened only when a manager signs a request slip. The employee goes in, does the job, and the door locks again. The slip is kept as a record of who went in and why.

i
Recommended by Google

Google’s overview suggests considering PAM instead of permanent role grants for sensitive resources, and its governance guidance encourages just-in-time privileged access where possible.

!
Common Mistake

Approving every request without reading it. An approval step is only valuable if the approver actually checks that the reason makes sense.

15Least Privilege and Rightsizing

Give each identity the smallest access that lets it do its job, and keep trimming.

The principle of least privilege says every person and program should have only the permissions needed for its task, no more. It is simple to say and hard to keep, because access tends to grow over time: people change jobs, projects end, and quick fixes become permanent. Google’s governance guidance points to a tool called IAM recommender, part of Policy Intelligence, which finds unused roles and suggests removing or narrowing them. The guidance also describes using Policy Analyzer for periodic access certification, such as finding which principals can reach a given resource.

1

Start narrow

Grant a focused predefined role and add more only when something genuinely fails.

2

Review regularly

Schedule access reviews so stale grants are found, not forgotten.

3

Use recommendations

Let IAM recommender show roles that were granted but not used.

4

Remove leavers promptly

Delete accounts and permissions of departed staff and abandoned service accounts.

5

Prefer expiring access

Use conditions or group membership expiry for temporary needs.

Simple Analogy

Least privilege is like tidying a key cabinet. Over the years, copies of keys accumulate in drawers. Every few months you check who still uses which key, collect the ones nobody needs, and keep the cabinet small enough that a lost key is a minor event.

!
Common Mistake

Granting a broad role “temporarily” to get past an error, then forgetting it. Temporary grants without an expiry date tend to become permanent.

16Groups, Cloud Identity, and People Management

Managing people through groups keeps IAM policies short and understandable.

Google’s governance guidance recommends using Cloud Identity to manage users and groups, including federating identities with outside providers. It advises granting access to groups instead of individuals, keeping more than one group administrator, limiting who can manage a group, restricting membership to people inside your organization, and setting membership expiry so access ends automatically.

Habit 1

Role-based groups

Create groups that match jobs, such as “data analysts” or “network administrators”, and grant roles to those groups.

Habit 2

Several group owners

Avoid one person being the only administrator, so a holiday or departure does not block changes.

Habit 3

Expiring membership

Add end dates for contractors and short projects.

Habit 4

Organization-only members

Restrict who may join privileged groups to people in your own organization.

Simple Analogy

Groups are like departments on an org chart. Instead of telling the guard the names of fifty people, you tell the guard “the Accounts department may enter.” When someone joins or leaves Accounts, only the department list changes.

Onboarding a new developer

The new developer is added to the “developers” group and instantly has the access every developer needs, with no edits to any cloud policy.

i
Strong Sign-In

Google’s guidance also recommends requiring two-step verification for all users with privileged access, since a stolen password alone should never unlock powerful roles.

17Auditing: Seeing Who Did What

Audit logs are the record that lets you investigate and prove what happened.

Google Cloud records activity in audit logs. The governance guidance points to Admin Activity audit logs, which record IAM policy changes, service account creation, and key downloads, and to Policy Denied audit logs, which show blocked attempts. For some services, you can also enable data access logs to track reads and writes of data. Logs can be exported to BigQuery or another destination if you need to keep them beyond the default retention period. The guidance also advises reviewing impersonation events to see which user acted through a service account.

Log type

Admin Activity

Changes to configuration and policies, such as granting roles or creating service accounts.

Log type

Data Access

Reads and writes of user data for supported services, usually switched on deliberately because of volume.

Log type

Policy Denied

Records of requests that were blocked by policy, useful for spotting probing and misconfiguration.

Simple Analogy

Audit logs are the security cameras and the visitor book of the building. You hope never to need them, but when something goes missing, they tell you who entered which room and when.

i
Plan Retention

Decide how long you must keep logs for your own rules and legal needs, and export them if the default period is too short.

!
Common Mistake

Collecting logs that nobody reads. Set alerts for high-risk events, such as a new owner being added or a key being created, so that someone is told when they happen.

18Troubleshooting Access Problems

Most access errors can be solved by asking the same few questions in order.

When a request fails with a permission error, resist the urge to grant a powerful role. Work through the cause instead. Google also notes that the IAM programming interface is eventually consistent, meaning reads right after writes may return older data and changes can take time to take effect. A newly created service account, for example, might not be found immediately. So a brief wait is sometimes the right first step.

1

Read the error

Note the missing permission, the resource, and the identity that was used.

2

Confirm the identity

Check which account or service account actually made the request. It is often not the one you expect.

3

Find a role containing the permission

Choose the narrowest predefined role that includes it.

4

Grant at the right level

Apply it on the specific resource or the smallest container that works.

5

Check for blocks and conditions

If access still fails, look for deny policies, boundaries, or conditions that may apply.

6

Wait briefly, then retry

Allow time for the change to propagate before concluding it failed.

Simple Analogy

Troubleshooting access is like working out why a door will not open. First check whose card you are holding, then whether that card type is meant for this door, then whether the door has an extra lock, and only then ask for a master key as a last resort.

!
Common Mistake

Solving every error by granting Owner. It makes the error vanish, and it also removes the safety that IAM exists to provide.

19Design Patterns and Anti-Patterns

Teams with healthy IAM repeat a few simple habits and avoid a few common traps.

Patterns that work

Groups for people, service accounts for programs

Never mix the two. People get roles through groups; applications get roles through dedicated service accounts.

Separate projects per environment

Keep development, testing, and production in different projects, so access can differ sharply between them.

Central guardrails, local freedom

Platform or security teams apply broad controls at the organization or folder level, while project teams manage their own day-to-day grants within those limits.

Break-glass procedure

Keep a documented, monitored emergency path for powerful access, ideally just-in-time, rather than leaving powerful roles permanently assigned.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

Whole teams hold the Owner or Editor basic role on production projects.

Why It’s Harmful

These roles cover many services. One mistake or one stolen account can modify or delete almost anything.

Correct Approach

Replace them with narrow predefined roles per job, and use temporary elevation for rare administrative tasks.

ANTI-PATTERN-02 Avoid
Problem

Service account key files are downloaded, emailed, or committed to repositories.

Why It’s Harmful

Keys do not expire by themselves and can be used from anywhere by whoever holds them.

Correct Approach

Attach service accounts to workloads, or use workload identity federation for programs outside Google Cloud.

ANTI-PATTERN-03 Avoid
Problem

Roles are granted to individual users, and never reviewed.

Why It’s Harmful

Access accumulates, leavers keep permissions, and nobody can explain why anyone has anything.

Correct Approach

Grant to groups, review regularly, and use recommendations to remove unused roles.

ANTI-PATTERN-04 Avoid
Problem

Powerful roles are granted at the organization level for convenience.

Why It’s Harmful

Because of inheritance, the role reaches every folder, project, and resource, vastly widening the blast radius.

Correct Approach

Grant at the lowest level that satisfies the need, and reserve organization-level grants for a small trusted group.

20Advantages, Trade-offs, and Neighbors

IAM is powerful, and it works alongside other security controls rather than replacing them.

Advantages

  • Fine-grained control over who can do what, on which resource
  • Consistent model across Google Cloud services
  • Inheritance lets one grant cover many resources
  • Rich controls: conditions, deny policies, boundaries, and temporary access
  • Built-in recommendations and audit logs support continuous improvement

Disadvantages / Trade-offs

  • Many concepts to learn, and inheritance can make effective access hard to see
  • Choosing the right predefined role takes research
  • Custom roles need ongoing maintenance and have limits
  • Changes may take a short time to take effect
  • Misconfiguration is easy without reviews and clear ownership

Related controls

ControlWhat it adds
IAMDecides who may do what on which resource
Organization policiesSet rules on what is allowed to be configured at all, such as restricting where resources may be created
VPC Service ControlsDraw network-level perimeters around services to reduce data exfiltration risk; Google lists it among ways to secure IAM
Audit loggingRecords what happened for investigation and compliance
Secret Manager and key managementProtect credentials and encryption keys that IAM roles may access
flowchart LR
  ID["Identity: who are you?"] --> IAM["IAM: what may you do?"]
  IAM --> NET["Network and perimeter controls"]
  NET --> DATA["Data and encryption controls"]
  IAM --> LOG["Audit logs record everything"]
        
FIG 8 — IAM is one important layer in a layered defense
Simple Analogy

IAM is the guard at the door, but a secure building also has fences, locked cabinets inside rooms, and cameras. A good guard is necessary, and it is not enough on its own.

“Access is easy to grant and hard to take back; grant it as if you will have to defend every decision.”

21If You Know Another Cloud

The big ideas are shared across clouds, though the names and structures differ.

IdeaGoogle CloudAmazon Web ServicesMicrosoft Azure
Access control serviceIAMAWS IAMAzure role-based access control with Microsoft Entra ID
Identity for programsService accountsIAM roles for services and workloadsManaged identities and service principals
Bundle of permissionsRolePolicy attached to a user, group, or roleRole definition
Hierarchy for inheritanceOrganization, folders, projectsOrganizations and accountsManagement groups, subscriptions, resource groups
Outside identity trustWorkforce and workload identity federationIdentity federation and web identity providersFederation through Entra ID
!
Do Not Copy Blindly

The comparisons are only approximate. One notable difference is that Google Cloud attaches policies to resources in a hierarchy and grants roles to principals there, whereas other clouds often attach policies to the identity. Learn each model on its own terms.

22Real-World Scenarios

Here is how IAM ideas appear in everyday projects.

A small startup

Three developers share one project. The founder resists using the Owner role for everyone, creates a developers group with narrow deployment and logging roles, and keeps Owner for one trusted person with strong sign-in.

A data team and a finance team

Analysts need to query reports but must not see payroll data. Separate projects, groups, and dataset-level grants keep each team within its own boundary.

A web application

The application runs as its own service account with permission only to read from one bucket and publish to one queue. If the web server is compromised, the damage is limited to those two resources.

An outside contractor

A contractor receives a read-only role with a condition that ends on the contract date, plus group membership that expires, so no manual cleanup is needed.

An on-call engineer needing emergency access

At night, an engineer requests temporary elevated access with a stated reason. An approver agrees, the access lasts a short time, and everything is recorded for the next day’s review.

A regulated company’s audit

An auditor asks who could access customer data last quarter. The security team uses policy analysis tools and audit logs to answer with evidence instead of guesses.

23Best Practices Checklist

If you remember nothing else, remember these habits.

1

Grant to groups, not individuals

Manage people through group membership and keep policies short.

2

Choose the narrowest suitable role

Prefer predefined roles for the job; avoid basic roles in production.

3

Grant at the lowest level

Remember that access flows down the hierarchy.

4

One service account per workload

Avoid downloaded keys; prefer attached accounts and federation.

5

Make temporary access expire

Use conditions, membership expiry, or just-in-time access.

6

Require strong sign-in for privileged users

Use two-step verification for anyone with powerful roles.

7

Review and trim regularly

Use recommendations and access analysis to remove unused access.

8

Log, alert, and investigate

Keep audit logs long enough and watch for risky changes.

24Frequently Asked Questions

Quick answers to questions beginners ask most.

Q1What does IAM stand for and what does it do?

Identity and Access Management. It decides who can do what on which Google Cloud resource by checking permissions before any action runs.

Q2What is the difference between a permission and a role?

A permission is one allowed operation. A role is a bundle of permissions. You cannot grant permissions directly; you grant roles.

Q3What is a principal?

An authenticated identity that can be given access, such as a Google Account, a group, a service account, or a federated identity. Older material may call it a member.

Q4What are the three role types?

Basic roles, which are broad and meant mainly for testing; predefined roles, managed by Google Cloud services for common jobs; and custom roles, which you create with chosen permissions.

Q5What is an allow policy?

A document attached to a resource that contains role bindings linking roles to principals. It was previously called an IAM policy.

Q6How does inheritance work?

Policies on organizations, folders, and projects pass down to the resources beneath them. The effective policy of a resource combines its own policy with all of its ancestors’ policies.

Q7What is a service account?

An identity for an application or virtual machine rather than a person, used so programs can call Google Cloud services with only the roles they need.

Q8Should I use service account keys?

Avoid them where possible. Prefer attaching a service account to the workload or using workload identity federation, which reduces long-lived secrets.

Q9How is a deny policy different from an allow policy?

An allow policy grants access through roles. A deny policy blocks specific permissions even if a principal holds a role that includes them.

Q10What is the best way to give temporary access?

Use conditional role bindings that expire, group membership with an end date, or Privileged Access Manager for just-in-time access with approval and logging.

Q11Why did my change not work immediately?

Google notes the IAM interface is eventually consistent, so recent changes can take a short time to take effect. Wait briefly and retry before assuming the change failed.

Q12How much does IAM cost?

I did not find a price for core IAM in the documentation I reviewed. Some related advanced products may be priced separately, so check Google’s pricing pages for the specific features you use.

25Summary and Key Takeaways

IAM is Google Cloud’s authorization system. It answers one question for every request: may this principal perform this action on this resource? Access is built from principals, roles that bundle permissions, and resources, connected by allow policies that inherit down the hierarchy of organization, folders, projects, and resources. Service accounts and federation give programs and outside users identities of their own. Deny policies, principal access boundaries, conditions, and Privileged Access Manager add guardrails and temporary access. Good practice means groups instead of individuals, narrow predefined roles, grants at the lowest level, no unnecessary keys, regular reviews, and careful logging. Master these ideas and you will understand most of what protects every other Google Cloud service.

Key Takeaways

  • Three building blocks — Principal, role, and resource, joined by a role binding inside an allow policy.
  • Roles, not permissions — Permissions are granted only through roles; prefer narrow predefined roles and avoid basic roles in production.
  • Mind the hierarchy — Policies flow down from organization to folders to projects to resources, so grant at the lowest level that works and check the effective policy.
  • Separate people from programs — Use groups for people and dedicated service accounts for workloads, and avoid downloaded keys.
  • Add guardrails — Deny policies, principal access boundaries, and conditions limit what grants can do.
  • Make power temporary — Use expiring conditions, group expiry, and Privileged Access Manager instead of permanent privileged access.
  • Review and record — Trim unused access with recommendations and analysis tools, and keep audit logs you actually watch.