GCP Study Hub

Security

Cloud IAM

Identity and Access Management โ€” who can do what on which resource

AWS equivalent

IAM

SecurityAccess ControlCore Service

Architecture Diagram

GCP Resource Hierarchy & IAM Inheritance

๐Ÿข Organizationyourcompany.com๐Ÿ“ Production FolderIAM: Network Admins๐Ÿ“ Dev/Test FolderIAM: Developers (broader)๐Ÿ”ง proj-apiResources inside๐Ÿ—„๏ธ proj-dataResources inside๐Ÿงช proj-stagingResources inside๐Ÿ’ป proj-devResources insideIAM inherits โ†“Billing attached at Project level ยท Each project = isolated resource boundary

๐Ÿ’ก Key concept: IAM policies set at the Organization or Folder level are automatically inherited by all child projects โ€” you set a policy once and it applies everywhere below. Unlike AWS where each account is a fully separate IAM boundary.

๐Ÿ”„

AWS โ†’ GCP: Key Differences

  • โ–ธ

    Same core model: principals, permissions, policies. But GCP has a clearer resource hierarchy (Org โ†’ Folder โ†’ Project โ†’ Resource).

  • โ–ธ

    Policies are attached to RESOURCES (not principals like AWS).

  • โ–ธ

    Roles in GCP: Basic (Owner/Editor/Viewer โ€” avoid), Predefined (service-specific), Custom.

  • โ–ธ

    Service accounts โ‰ˆ IAM roles for EC2 instances. But in GCP, service accounts are also principals.

๐Ÿ“Œ

Key Concepts to Know

  • 1

    Principal types: Google accounts, service accounts, Google groups, domains.

  • 2

    Service accounts: machine identities for GCP resources. One per workload with minimal permissions.

  • 3

    Workload Identity (GKE): map a Kubernetes service account to a GCP service account. Eliminates key files.

  • 4

    Conditional IAM: grant access only under specific conditions (time, IP range, resource attributes).

  • 5

    IAM Recommender: ML-powered tool that suggests removing excess permissions.

๐Ÿ’ก

DCE Interview Tips

  • โ˜…

    Security answer: 'Each Cloud Run service gets its own service account with only the permissions it needs.'

  • โ˜…

    For customer security concerns: 'Workload Identity means no service account keys in code โ€” eliminates the #1 cause of GCP credential breaches.'

โš ๏ธ

Common Gotchas

  • !

    Owner/Editor basic roles grant massive permissions โ€” almost never appropriate in production.

  • !

    Service account keys don't expire and can be exfiltrated. Use Workload Identity instead.