Skip to content

Chapter 6 of 11

Identity and Access Management

Use policies, roles, service accounts, federation, conditions, and organization guardrails.

44 minutes 10 quick checksBy Subha Prasad
Lesson 6 of 11Course navigation

Lesson content

Read, practise, then check your understanding

Identity and Access Management

Google Cloud IAM authorizes principals by binding roles to resources. Policies inherit through the resource hierarchy. Roles group permissions, and service accounts represent workloads. Organization Policy constrains resource configuration but does not grant access.

Core ideas

  • Basic roles are broad and should be avoided for routine production access.
  • Predefined roles are service-focused; custom roles need lifecycle ownership as permissions evolve.
  • Service-account impersonation and federation provide temporary credentials without downloadable keys.
  • IAM Conditions can restrict grants by time, resource attributes, or request context.

Design and operating model

Federate workforce users, assign groups at appropriate folder or project scope, and use Privileged Access Manager or controlled elevation for rare administration. Give each workload a dedicated service account, allow only necessary impersonation, and use workload identity federation for external CI and platforms.

Example

gcloud projects add-iam-policy-binding "$GOOGLE_CLOUD_PROJECT" \
  --member='serviceAccount:reporter@PROJECT_ID.iam.gserviceaccount.com' \
  --role='roles/storage.objectViewer' \
  --condition='expression=resource.name.startsWith("projects/_/buckets/training-public"),title=TrainingBucketOnly'

gcloud projects get-iam-policy "$GOOGLE_CLOUD_PROJECT"

Run examples in a disposable training project. Replace project IDs, Regions, identities, resource names, sizes, and policies with reviewed values, and verify current Google Cloud CLI and service requirements before production use.

Production guidance

  • Disable service-account key creation where possible and detect existing unmanaged keys.
  • Review inheritance, group membership, impersonation rights, public principals, and privilege escalation.
  • Separate organization, security, network, deployment, and runtime responsibilities.

The chapter quiz follows the lesson and checks both service vocabulary and architecture decisions.

Knowledge check

Answer every question correctly to complete this chapter.

Which statement correctly describes allow policy?
Which term matches this explanation: A Google Cloud IAM policy binding principals to roles on a resource.
Which statement correctly describes role?
Which term matches this explanation: A named collection of permissions.
Which statement correctly describes service account?
Which term matches this explanation: A principal intended for workloads rather than a human user.
Which statement correctly describes least privilege?
Which term matches this explanation: Granting the smallest role and scope needed for a task.
Which statement correctly describes organization policy?
Which term matches this explanation: A centralized constraint limiting how cloud resources can be configured.

0 of 10 checks passed

Your progress is saved on this device.