All exams← All Google Associate Cloud Engineer notes

Configuring access & security (IAM): Google Associate Cloud Engineer revision notes

Revision notes

IAM: the basics

Google Cloud IAM controls who (identity) can do what (role) on which resource. Every permission check follows this identity + role + resource pattern. You almost never grant permissions directly - you grant roles, and roles bundle permissions together.

Identities can be Google accounts, service accounts, Google groups, Cloud Identity domains, or 'allUsers'/'allAuthenticatedUsers' for public access. Prefer groups over individual users for easier management at scale.

Role types

  • Basic roles: Owner, Editor, Viewer. Broad, legacy, apply project-wide - avoid in production, too permissive.
  • Predefined roles: curated by Google per service, e.g. roles/compute.instanceAdmin. Best practice for most cases.
  • Custom roles: you define the exact permission set. Useful for least privilege but need maintenance as APIs change.

The resource hierarchy

Policies flow downward: Organisation > Folder > Project > Resource. A role granted at the organisation level is inherited by every folder, project and resource beneath it. You cannot restrict a permission lower down that was granted higher up - only add more. Deny policies (a separate feature) can block access regardless of allow policies, and deny always wins over allow.

Service accounts

A service account is an identity for applications/VMs, not a person. Each has an email like PROJECT_NUMBER-compute@developer.gserviceaccount.com (default Compute Engine SA) or name@project.iam.gserviceaccount.com. Avoid using the default service account with the broad Editor role in production - assign a custom SA with minimal roles instead. Service account keys (JSON) are a security risk if leaked - prefer attaching SAs directly to resources or using Workload Identity Federation instead of downloading keys.

Common mistakes to know for the exam

  • Confusing Owner (full control incl. billing/IAM) with Editor (modify resources, no IAM/billing changes) with Viewer (read-only).
  • Forgetting that IAM policies are additive across the hierarchy - there is no explicit lower-level 'deny' in a normal allow policy.
  • Granting roles at project level when only one resource needs access - always scope to the smallest level that works.
  • Leaving default service accounts with Editor role attached to VMs.
  • Not knowing that Cloud IAM Recommender can suggest removing unused/excess permissions.

Useful tools

  • Policy Analyzer / Policy Troubleshooter: work out why a user has or lacks access.
  • IAM Conditions: add attribute-based conditional access (e.g. time-bound or resource-tag-bound grants) to a role binding.
  • Organisation Policy Service: restricts what CAN be configured (e.g. disable external IPs) - separate from IAM, which controls WHO can act.

Key facts

Flashcards

What three basic roles exist in Cloud IAM?
Owner, Editor, Viewer
tap to reveal
Which basic role includes billing and IAM management rights?
Owner
tap to reveal
What is the resource hierarchy order in Google Cloud, top to bottom?
Organisation > Folder > Project > Resource
tap to reveal
Do IAM policies granted higher in the hierarchy get inherited lower down?
Yes, they are inherited and cannot be restricted lower down, only added to
tap to reveal
What wins when an allow policy and a deny policy conflict?
The deny policy always wins
tap to reveal
What is a service account used for?
It is an identity for applications, VMs or workloads to authenticate and act, not for a human user
tap to reveal
What is the default Compute Engine service account email format?
PROJECT_NUMBER-compute@developer.gserviceaccount.com
tap to reveal
Why should you avoid downloading service account JSON keys?
Keys can leak and grant persistent access; prefer attaching the SA to the resource or using Workload Identity Federation
tap to reveal
What does the identity allUsers grant?
Public, anonymous access to anyone on the internet
tap to reveal
What does allAuthenticatedUsers grant?
Access to anyone with any Google account, not just your organisation
tap to reveal
When should you use a predefined role over a custom role?
By default - predefined roles are Google-curated and cover most needs; use custom roles only when you need tighter least-privilege control
tap to reveal
What tool suggests removing excess or unused IAM permissions?
IAM Recommender
tap to reveal
What feature lets you add time-bound or attribute-based restrictions to a role binding?
IAM Conditions
tap to reveal
What is the best-practice scope level to grant an IAM role?
The smallest scope in the hierarchy that satisfies the requirement (least privilege)
tap to reveal
What separate service restricts what configurations are allowed, rather than controlling who can act?
Organisation Policy Service
tap to reveal
Practice questions

Configuring access & security (IAM): 5 practice questions

Q1. A company wants to grant a developer the ability to deploy new versions of a Cloud Run service but not delete the service or change IAM policies on the project. Which approach best follows the principle of least privilege?
  • A.  Grant the Editor role at the project level
  • B.  Grant the Owner role at the project level
  • C.  Grant the predefined Cloud Run Developer role on the service
  • D.  Grant the Cloud Run Admin role at the organization level
Show answer & explanation
✓ Answer: C. Grant the predefined Cloud Run Developer role on the service
The predefined Cloud Run Developer role grants deploy and manage permissions on Cloud Run resources without including IAM policy management or broad project-wide edit rights. Editor and Owner grant far more permissions than needed, violating least privilege, and organization-level Admin roles are unnecessarily broad in scope.
Q2. In Google Cloud IAM, what does an IAM policy binding consist of?
  • A.  A resource and a quota limit
  • B.  A firewall rule and a target tag
  • C.  A role and a list of principals (members) granted that role
  • D.  A service account and its private key
Show answer & explanation
✓ Answer: C. A role and a list of principals (members) granted that role
An IAM binding pairs a role with one or more principals (users, groups, service accounts, or domains) who receive that role's permissions on the attached resource. Firewall rules, quotas, and service account keys are unrelated concepts in Google Cloud.
Q3. Which statement correctly describes how IAM permissions are inherited in the Google Cloud resource hierarchy?
  • A.  Only the Owner role can be inherited; all other roles must be set per resource
  • B.  Permissions must be granted separately at every level or they do not apply anywhere
  • C.  Permissions granted at a lower level always override permissions granted at a higher level
  • D.  Policies set at the organization or folder level flow down to projects and resources beneath them, and are additive
Show answer & explanation
✓ Answer: D. Policies set at the organization or folder level flow down to projects and resources beneath them, and are additive
IAM policies are inherited downward through the resource hierarchy (organization to folder to project to resource), and the effective policy at any level is the union of policies at that level and all ancestors. There is no way to revoke an inherited grant at a lower level using a normal IAM allow policy.
Q4. A team lead wants a group of 20 engineers to all receive the same set of IAM roles on a project, and wants role changes to be easy to manage as team membership changes. What is the recommended practice?
  • A.  Create one shared service account and give all 20 engineers its key file
  • B.  Grant the roles individually to each of the 20 user accounts
  • C.  Create a Google Group containing the engineers and grant IAM roles to the group
  • D.  Add all 20 engineers as project Owners so no further changes are needed
Show answer & explanation
✓ Answer: C. Create a Google Group containing the engineers and grant IAM roles to the group
Granting roles to a Google Group lets administrators manage access by adding or removing group membership rather than editing IAM policy for every individual, which scales far better. Sharing a service account key among people is a security anti-pattern, and granting Owner to everyone violates least privilege.
Q5. What is the key difference between a predefined IAM role and a custom IAM role in Google Cloud?
  • A.  Predefined roles can only be granted at the organization level, while custom roles can only be granted at the project level
  • B.  Custom roles automatically update as Google adds new permissions, while predefined roles never change
  • C.  Predefined roles can only be applied to service accounts, while custom roles apply only to users
  • D.  Predefined roles are curated and maintained by Google with fixed permission sets, while custom roles let an administrator assemble a specific set of permissions
Show answer & explanation
✓ Answer: D. Predefined roles are curated and maintained by Google with fixed permission sets, while custom roles let an administrator assemble a specific set of permissions
Predefined roles are created and maintained by Google to match common job functions and are automatically updated with new permissions as services evolve. Custom roles are user-defined, containing exactly the permissions an admin selects, but they do not automatically gain new permissions when Google adds them to related predefined roles.
Test yourself
See the Google Associate Cloud Engineer page

More Google Associate Cloud Engineer topics