Bitzu

Associate Cloud Engineer ยท IAM policies and roles

Policy inheritance in the resource hierarchy

Attaching roles at organization, folder, project and resource, union of allow policies, effective permissions, deny policies as the exception.

Key points

  • Allow policies attach to the organization, folders, projects and individual resources.
  • A resource's effective access is the union of its own policy and those of all its ancestors, so a grant high up reaches everything below and cannot be removed lower down.
  • Deny policies are checked first and are the exception.

Source: https://docs.cloud.google.com/iam/docs/policies

Practice questions

Single choice

How is the effective allow policy of a project determined?

  1. Only the project's own policy is used
  2. The union of the project's policy and its ancestors' policies
  3. The most restrictive policy among the ancestors
  4. The policy of the organization overrides everything below it
Show answer

Answer: B. The union of the project's policy and its ancestors' policies

IAM combines the project's own policy with those of its ancestors as a union. A child policy does not replace the parent's, and there is no 'most restrictive wins' among allow policies.

Select all that apply

Which statements about the hierarchy and policies are correct?

  1. A role granted on a folder applies to the projects inside it
  2. Allow policies from different levels add up
  3. Deny policies can be attached to an organization, folder or project
  4. A project's allow policy can cancel a grant made on its parent folder
  5. Deny policies are evaluated after allow policies
Show answer

Answer: A. A role granted on a folder applies to the projects inside it, B. Allow policies from different levels add up, C. Deny policies can be attached to an organization, folder or project

Grants flow down, allow policies add up, and deny policies attach at organization, folder or project level. A child allow policy cannot override a parent grant, and deny is checked before allow, not after.

True or false

Removing a user's role binding from a project revokes the access even if the same role is also granted on the parent folder.

Show answer

Answer: False

False. The inherited folder-level grant remains in the effective policy, so the user keeps access until it is removed at the folder.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module