IAM & Service Accounts

Google ACE ACE · Configuring access and security

By Abu Anns · Last updated 20 November 2026Exam version: ACE (exam guide live 30 June 2026)

IAM: who can do what

Identity and Access Management (IAM) is Google Cloud's access control system. It answers one question: which identity (a principal — a user, a group, a service account, or a domain) is allowed to do what (a role — a collection of permissions) on which resource? The binding of a principal to a role on a resource is stored in an IAM policy. Policies attach to any level of the resource hierarchy — organization, folder, project, or individual resource — and are inherited downward: a role granted on a folder applies to every project inside it. The exam tests IAM as the largest single security topic, and the core skill is choosing the narrowest role that still lets the principal do the job: least privilege.

Role types: basic, predefined, custom

Google Cloud has three kinds of roles. Basic roles are the legacy, coarse-grained roles: Owner (full control of a project, including billing and IAM), Editor (full control of resources but not IAM or billing), and Viewer (read-only access). They are too broad for most use and the exam treats them as the wrong answer whenever a narrower role exists — a question that offers Owner as an option is usually testing whether you pick something narrower. Predefined roles are Google-maintained roles for specific job functions, such as Compute Instance Admin, Storage Object Viewer, or BigQuery Data Editor. They follow least privilege by design and are the default correct answer for most access questions: find the predefined role that matches the task. Custom roles are roles you define yourself, picking exactly the permissions a job needs. They are the answer when no predefined role fits — for example, a support engineer who needs to view VM details and restart instances but not create or delete them. Custom roles are defined at the organization or project level and can include only the permissions you select.

Two more role concepts appear on the exam. Primitive roles is an older name for basic roles. And IAM policies support conditions: a binding can include a condition (such as "only during business hours" or "only for resources with a specific tag") that limits when the role applies. Conditions are the answer when a question asks for time-limited or resource-scoped access without creating a separate role.

IAM policies: viewing and managing

An IAM policy is a collection of bindings, and it can be viewed in the console (IAM page for a project, folder, or organization) or with gcloud projects get-iam-policy (and the equivalent commands for folders, organizations, and resources). Granting a role is gcloud projects add-iam-policy-binding or the console's Grant Access flow. The exam tests the mechanics lightly — mostly it tests which role to grant, at which level, and to which principal. Remember the inheritance rule: grant at the highest level that matches the scope (organization for company-wide admins, folder for a department, project for a team, resource for a single bucket or VM), and prefer groups over individual users.

Service accounts

A service account is an identity for a machine or an application, rather than a person. When an application running on a VM, in Cloud Run, or in GKE calls a Google Cloud API, it authenticates as a service account, and the roles granted to that service account decide what it can do. Every project has a default Compute Engine service account and a default App Engine service account, but best practice is to create dedicated service accounts per application with only the permissions that application needs. Service accounts are created in the console or with gcloud iam service-accounts create, and they are assigned to resources at creation (a VM's service account can be changed later, but only while the VM is stopped, in most cases).

Service accounts have their own IAM: you grant roles to a service account (what it can do), and you grant roles on a service account (who can use it). The key role for the second is Service Account User (iam.serviceAccountUser): a developer needs it on a service account before they can attach that account to a VM or run a job as it. The Service Account Token Creator role allows creating short-lived credentials for the account. Service account impersonation lets a principal temporarily act as a service account — obtaining short-lived credentials for it — without ever holding its key. Impersonation is the recommended pattern for a developer who needs to test something as the service account, or for a CI/CD pipeline that deploys as a service account: the human or pipeline authenticates as themselves, then impersonates the account for the duration of the task.

Keys and short-lived credentials

Service accounts can authenticate with keys (downloadable JSON files) or with short-lived credentials. Keys are long-lived: they work until deleted, they can be leaked, and managing them is a burden — the exam consistently treats keys as the weaker answer. Short-lived credentials (access tokens that expire, typically within an hour) are the recommended approach: they are obtained through impersonation, through the metadata server on a VM (applications on Google Cloud get tokens automatically from the metadata server), or through Workload Identity Federation, which lets workloads running outside Google Cloud (on AWS, on-premises, or in GitHub Actions) authenticate with short-lived tokens using their own identity provider — no service account key needed. If a question mentions an external workload accessing Google Cloud, Workload Identity Federation is the modern, keyless answer. The principle throughout is the same: avoid long-lived keys wherever a short-lived alternative exists.

Troubleshooting access: the Policy Troubleshooter

When access does not work as expected — a user gets "permission denied" on a resource they should be able to use — the IAM Policy Troubleshooter is the diagnostic tool. You enter the principal, the resource, and the permission, and the Troubleshooter traces the effective policy: which bindings grant the permission, whether any deny policy blocks it, and where in the hierarchy the relevant policy lives. It answers the two questions that matter in a troubleshooting scenario: does this principal have this permission, and if not, why not? The exam tests it as the first step in an access investigation, before changing any roles — because guessing at IAM changes can grant too much or break something else.

Two supporting tools complete the access-management picture. IAM Recommender analyzes actual usage and suggests least-privilege adjustments: roles that are granted but never used, or permissions that could be narrowed. Acting on its recommendations is the routine way to tighten access over time. Audit logs (Admin Activity logs, always enabled) record every IAM policy change — who granted which role to whom, and when — so any access change is traceable. Together, the Troubleshooter (why does this fail?), the Recommender (what can we tighten?), and the audit logs (who changed what?) cover the full lifecycle of access management, and the exam rewards knowing which tool answers which question.

Advertisement

Exam traps to watch for

Practice questions

Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.

Q1.A developer needs to view the details of Compute Engine VMs in a project, but must not be able to create, modify, or delete any resources. Which role should you grant?

Report an error

Q2.A support engineer needs a combination of permissions that no predefined role provides: view VM details and restart instances, but not create or delete them. What should you do?

Report an error

Q3.An application running on a Compute Engine VM needs to write objects to a specific Cloud Storage bucket and nothing else. What is the best approach?

Report an error

Q4.A developer wants to test a deployment script that runs as a service account, without downloading the service account's key. What should they do?

Report an error

Q5.A developer tries to create a VM using a specific service account, but receives a permission error even though they have the Compute Instance Admin role. What is the most likely missing permission?

Report an error

Q6.A CI/CD pipeline running in GitHub Actions needs to deploy to Google Cloud. The team wants to avoid storing a service account key in GitHub. What should they use?

Report an error

Q7.A contractor needs access to a project for two weeks only. After that, access must end automatically. What is the best approach?

Report an error

Q8.A company has 30 projects under a folder for the Finance department. The finance manager needs read-only access to all of them. What is the most efficient way to grant it?

Report an error