Skip to content

Associate Cloud Engineer · Domain 4: Configuring access and security · 20% of the exam

Task 4.1: Managing IAM.

Reading and changing allow policies, how roles granted on the organization, folders and projects are inherited, and when to use basic, predefined or custom roles.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

A database team must create, configure and back up Cloud SQL instances in a shared project. Today its members have the Editor role on the project, which also lets them change VMs, buckets and networks owned by other teams. What should you grant instead?

  1. AThe Owner role on the project, so the team can manage its own access
  2. BThe Cloud SQL Admin role on the project, in place of Editor
  3. CThe Viewer role on the project, plus Editor granted for one hour when a change is needed
  4. DThe Cloud SQL Client role on the project, in place of Editor
Show the answer and why
  • AThe Owner role on the project, so the team can manage its own access

    Incorrect

    Owner is broader than Editor and adds IAM management on top, the opposite of least privilege.

  • BThe Cloud SQL Admin role on the project, in place of Editor

    Correct

    This predefined role covers managing Cloud SQL instances and nothing outside Cloud SQL, which follows least privilege.

  • CThe Viewer role on the project, plus Editor granted for one hour when a change is needed

    Incorrect

    Temporary Editor still opens every other team's resources during the window, and Viewer alone cannot manage instances.

  • DThe Cloud SQL Client role on the project, in place of Editor

    Incorrect

    Cloud SQL Client lets principals connect to instances; it does not allow creating or configuring them.

Basic roles span almost every service in a project. Predefined roles are scoped to one service and job, so start there and fall back to a custom role only when no predefined role fits.

Question 2 · choose 1

A user was granted Storage Admin on the Analytics folder. You remove every role binding for the user from the allow policy of the reports project, which sits in that folder, but the user can still delete buckets in the reports project. Why, and what should you do?

  1. AThe user's session token still carries the old role; force the user to sign out and sign in again
  2. BIAM changes take up to 24 hours; wait a day and test again before changing anything else
  3. CThe folder's binding is inherited; remove the user's binding from the folder's allow policy
  4. DThe project's policy must explicitly list the user with no roles to override the folder
Show the answer and why
  • AThe user's session token still carries the old role; force the user to sign out and sign in again

    Incorrect

    Access is evaluated against the effective policy on each request; a new sign-in would still find the folder's binding.

  • BIAM changes take up to 24 hours; wait a day and test again before changing anything else

    Incorrect

    Waiting does not help: the access comes from a binding elsewhere, not from a delay.

  • CThe folder's binding is inherited; remove the user's binding from the folder's allow policy

    Correct

    A resource's effective policy is the union of its own policy and its ancestors' policies, so the grant must be removed where it was made.

  • DThe project's policy must explicitly list the user with no roles to override the folder

    Incorrect

    Allow policies only grant access; a project's allow policy cannot subtract access granted by a parent.

Allow policies are additive down the hierarchy. A binding on a folder applies to every project in it, and no allow policy lower down can take it away; remove it at the level where it was granted.

Question 3 · choose 2

A support group must be able to view, start and stop VMs in all projects under the Production folder, but not create, delete or reconfigure them. No predefined role is this narrow. Which TWO steps should you take? (Choose TWO.)

  1. ACreate the custom role in one of the production projects and grant it on the folder
  2. BGrant the custom role to each member of the group individually in every production project
  3. CCreate a custom role at the organization level with the permissions to get, list, start and stop instances
  4. DGrant the Compute Instance Admin (v1) role to the group on the folder
  5. EGrant the custom role to the support group on the Production folder
Show the answer and why
  • ACreate the custom role in one of the production projects and grant it on the folder

    Incorrect

    A project-level custom role can only be granted within the project where it was created, not on a folder.

  • BGrant the custom role to each member of the group individually in every production project

    Incorrect

    Per-user, per-project grants are hard to maintain and miss new projects and new members.

  • CCreate a custom role at the organization level with the permissions to get, list, start and stop instances

    Correct

    A custom role holds exactly the permissions needed, and only an organization-level custom role can be granted on a folder.

  • DGrant the Compute Instance Admin (v1) role to the group on the folder

    Incorrect

    This predefined role can also create, delete and reconfigure instances, which the group must not do.

  • EGrant the custom role to the support group on the Production folder

    Correct

    A grant on the folder is inherited by every project in it, now and later.

Custom roles fill the gap when predefined roles are too broad. Define them at the organization when they must be used on folders or across projects, and grant them to groups.

Question 4 · choose 1

An external auditor needs BigQuery Data Viewer on a project until the end of the month. You want the access to end automatically then, even if nobody remembers to remove it. How should you grant the role?

  1. AWith a calendar reminder for the project owner to remove the binding at the end of the month
  2. BWith a deny policy that blocks the auditor's access starting next month
  3. CWith a custom role that lists only the BigQuery read permissions the auditor needs
  4. DWith an IAM condition on the binding that ends access at a timestamp at month's end
Show the answer and why
  • AWith a calendar reminder for the project owner to remove the binding at the end of the month

    Incorrect

    A reminder relies on someone acting on time, which is what the requirement rules out.

  • BWith a deny policy that blocks the auditor's access starting next month

    Incorrect

    This leaves the grant in place plus a second policy to maintain, instead of one binding that ends on its own.

  • CWith a custom role that lists only the BigQuery read permissions the auditor needs

    Incorrect

    A narrower role changes what the auditor can do, not for how long the access lasts.

  • DWith an IAM condition on the binding that ends access at a timestamp at month's end

    Correct

    Conditional role bindings can compare request.time with a timestamp, so the grant stops working at that moment without anyone removing it.

IAM Conditions let one binding carry its own expiry. Temporary access granted this way does not depend on a cleanup step.

Question 5 · choose 1

An engineer wanted to give one user the Viewer role on a project. They wrote a policy file containing only that binding and ran gcloud projects set-iam-policy with it. Everyone else then lost access to the project. Which command should they have used?

  1. Agcloud projects set-iam-policy PROJECT_ID policy.json with the --merge flag
  2. Bgcloud iam roles create viewer-ana --project=PROJECT_ID --permissions=resourcemanager.projects.get
  3. Cgcloud projects add-iam-policy-binding PROJECT_ID --member=user:ana@example.com --role=roles/viewer
  4. Dgcloud projects get-iam-policy PROJECT_ID --flatten=bindings --filter=bindings.members:ana@example.com
Show the answer and why
  • Agcloud projects set-iam-policy PROJECT_ID policy.json with the --merge flag

    Incorrect

    set-iam-policy writes the whole policy from the file; there is no merge flag, so the same mistake would repeat.

  • Bgcloud iam roles create viewer-ana --project=PROJECT_ID --permissions=resourcemanager.projects.get

    Incorrect

    This defines a new custom role but grants it to nobody, and it was not needed for a predefined role.

  • Cgcloud projects add-iam-policy-binding PROJECT_ID --member=user:ana@example.com --role=roles/viewer

    Correct

    This adds one binding to the existing policy and leaves every other binding in place.

  • Dgcloud projects get-iam-policy PROJECT_ID --flatten=bindings --filter=bindings.members:ana@example.com

    Incorrect

    get-iam-policy only reads the current policy; it does not grant anything.

set-iam-policy replaces the resource's allow policy with the file's contents. For one change, add or remove a single binding instead of writing the whole policy.

Question 6 · choose 1

A developer says she gets a permission-denied error when reading objects in a bucket, although she believes her group has access. You need to find out which permission is missing and which bindings apply to her for that bucket. What should you use?

  1. AGrant her Storage Admin on the bucket and check whether the error goes away
  2. BPolicy Troubleshooter for her email, the bucket and storage.objects.get
  3. CThe IAM role recommendations for the project, filtered to her account
  4. DThe Admin Activity audit logs for the bucket over the past week
Show the answer and why
  • AGrant her Storage Admin on the bucket and check whether the error goes away

    Incorrect

    Granting a broad role to test access hides the cause and leaves her with more access than she needs.

  • BPolicy Troubleshooter for her email, the bucket and storage.objects.get

    Correct

    Policy Troubleshooter evaluates the allow and deny policies that apply to a principal, resource and permission, and explains the result.

  • CThe IAM role recommendations for the project, filtered to her account

    Incorrect

    These do not evaluate why one specific request was denied.

  • DThe Admin Activity audit logs for the bucket over the past week

    Incorrect

    These logs show configuration changes; they do not evaluate whether her identity holds a permission.

When access does not behave as expected, troubleshoot before changing grants. Policy Troubleshooter shows the bindings and policies that decide the outcome for one principal and permission.

Question 7 · choose 1

A project manager needs to see which folders and projects exist and how they are organized, but must not see VMs, buckets or any other resources inside the projects. Which role should you grant on the folder?

  1. AViewer
  2. BOrganization Administrator
  3. CBrowser
  4. DFolder Admin
Show the answer and why
  • AViewer

    Incorrect

    The basic Viewer role can read most resources in the projects.

  • BOrganization Administrator

    Incorrect

    This role manages IAM across the organization.

  • CBrowser

    Correct

    Browser gives read access to browse the hierarchy without permission to view resources in the projects.

  • DFolder Admin

    Incorrect

    Folder Admin can change folders, which goes well beyond viewing them.

Choose the narrowest role for the need: Browser covers navigation of the hierarchy, not the contents of projects.

Question 8 · choose 1

After an acquisition, your company has two Google Cloud organizations, ORG_A and ORG_B. The custom role auditor in ORG_A holds about 60 carefully reviewed permissions, and you need an identical role named auditor in ORG_B without retyping them. Which single command should you run?

  1. Agcloud iam roles copy --source=auditor --source-organization=ORG_A --destination=auditor --dest-organization=ORG_B
  2. Bgcloud iam roles create auditor --organization=ORG_B --title=Auditor --stage=GA
  3. Cgcloud iam roles undelete auditor --organization=ORG_B --format=yaml
  4. Dgcloud iam roles describe auditor --organization=ORG_A --format=yaml > auditor.yaml
Show the answer and why
  • Agcloud iam roles copy --source=auditor --source-organization=ORG_A --destination=auditor --dest-organization=ORG_B

    Correct

    roles copy creates a role from an existing one; the source and destination flags name the role and organization on each side.

  • Bgcloud iam roles create auditor --organization=ORG_B --title=Auditor --stage=GA

    Incorrect

    This creates a role in ORG_B that holds only the permissions you pass to it, and none are passed here.

  • Cgcloud iam roles undelete auditor --organization=ORG_B --format=yaml

    Incorrect

    undelete restores a custom role that was deleted from ORG_B; auditor was never created there.

  • Dgcloud iam roles describe auditor --organization=ORG_A --format=yaml > auditor.yaml

    Incorrect

    describe shows the role's metadata, written here to a file; nothing is created in ORG_B by this command.

gcloud iam roles copy creates a new custom role from an existing role, predefined or custom, so a reviewed set of permissions is reused exactly instead of being retyped.

Question 9 · choose 1

A custom role for production includes a permission whose support level for custom roles is TESTING. What is the risk, and what should you do?

  1. AThe role cannot be saved until the permission is removed
  2. BIt may behave unexpectedly; avoid relying on it in production
  3. CNo risk; TESTING means the permission is fully supported
  4. DThe permission is applied only on weekends while it is being tested
Show the answer and why
  • AThe role cannot be saved until the permission is removed

    Incorrect

    Including a TESTING permission does not stop the role from being saved.

  • BIt may behave unexpectedly; avoid relying on it in production

    Correct

    TESTING permissions can be included, but Google is still checking their compatibility, so they are not recommended for production.

  • CNo risk; TESTING means the permission is fully supported

    Incorrect

    Fully supported permissions have the SUPPORTED level.

  • DThe permission is applied only on weekends while it is being tested

    Incorrect

    Support levels do not schedule when permissions apply.

Check each permission's custom role support level before building production roles.

Question 10 · choose 1

Before granting roles/pubsub.editor, you want to see exactly which permissions it contains from the command line. Which command should you run?

  1. Agcloud projects get-iam-policy PROJECT_ID
  2. Bgcloud pubsub topics list
  3. Cgcloud iam service-accounts list
  4. Dgcloud iam roles describe roles/pubsub.editor
Show the answer and why
  • Agcloud projects get-iam-policy PROJECT_ID

    Incorrect

    This shows who has which roles, not what a role contains.

  • Bgcloud pubsub topics list

    Incorrect

    This lists topics, not role permissions.

  • Cgcloud iam service-accounts list

    Incorrect

    This lists service accounts, not role permissions.

  • Dgcloud iam roles describe roles/pubsub.editor

    Correct

    describe shows a role's metadata and its included permissions.

Know what a role grants before granting it; describe it first.

Question 11 · choose 1

An auditor asks for the current list of principals and roles bound directly on the project billing-prod, as a file. Which command produces it?

  1. Agcloud iam roles list --project=billing-prod
  2. Bgcloud projects get-iam-policy billing-prod --format=json
  3. Cgcloud organizations get-iam-policy ORGANIZATION_ID --format=json
  4. Dgcloud projects describe billing-prod
Show the answer and why
  • Agcloud iam roles list --project=billing-prod

    Incorrect

    This lists custom roles defined in the project, not who holds roles.

  • Bgcloud projects get-iam-policy billing-prod --format=json

    Correct

    get-iam-policy returns the project's allow policy with its bindings, and the format flag writes JSON.

  • Cgcloud organizations get-iam-policy ORGANIZATION_ID --format=json

    Incorrect

    This shows the organization's own bindings, not the ones set directly on the project.

  • Dgcloud projects describe billing-prod

    Incorrect

    describe shows project metadata such as ID, number and parent, not role bindings.

Each resource has its own allow policy, and get-iam-policy on that resource returns the bindings set directly on it.

Practise domain 4 →Practise all domains →