Identity & Access Management (IAM)

IAM is the foundation of GCP security. Every exam question involving "who can access what" comes back to IAM.

Core Principles

BigQuery-Specific IAM

VPC Service Controls

VPC-SC creates a security perimeter around GCP resources to prevent data exfiltration — even by users with valid IAM permissions. This is the key differentiator from IAM alone.

How It Works

Exam tip: If a question mentions "prevent data exfiltration," "contractors copying data to personal projects," or "data cannot leave the organization" — the answer is almost always VPC Service Controls, not just IAM roles.

VPC-SC vs. IAM

IAM controls who can do what to a resource. VPC-SC controls where data can flow. Even if a user has bigquery.dataViewer, VPC-SC can prevent them from copying query results to a project outside the perimeter. They work together — IAM for authorization, VPC-SC for perimeter defense.

Encryption

Encryption at Rest

Encryption in Transit

All data moving between GCP services is encrypted in transit by default (TLS 1.2+). For data moving between your on-prem network and GCP, use Cloud VPN or Cloud Interconnect with encryption.

DefaultGoogle-managed keys
Control + AuditCMEK (Cloud KMS)
Max ControlCSEK (you hold keys)
HSM-backedCloud HSM
External KMSCloud EKM

Cloud DLP (Data Loss Prevention)

Cloud DLP discovers, classifies, and protects sensitive data across GCP and beyond.

Key Operations

De-identification Techniques

Data Governance & Catalog

Dataplex

Unified data governance service that organizes data across GCS, BigQuery, and other sources into logical "lakes" and "zones." Provides automated data quality checks, metadata management, and data lineage.

Data Catalog

Metadata management and discovery service. Automatically catalogs BigQuery and Pub/Sub assets. Supports custom entries, tags, and tag templates for business metadata. Integrates with policy tags for column-level security in BigQuery.

📝 Practice Questions — Security & Compliance

Question 1 — VPC Service Controls & Data Exfiltration Prevention
Your organization stores sensitive healthcare data in BigQuery and Cloud Storage within a GCP project. A recent security audit requires that no data can be exfiltrated outside the organization's GCP perimeter, even by users with valid IAM permissions. Contractors with BigQuery Data Viewer roles need to run analytical queries but must not be able to copy results to their personal GCP projects. You also need to allow a specific partner organization's project to receive aggregated (non-PII) data via a scheduled export. What is the most appropriate configuration?
A Create a VPC Service Controls perimeter around the project, add BigQuery and Cloud Storage as restricted services, configure an egress rule allowing the partner project to receive data from the scheduled export service account only, and deny all other egress
B Remove the BigQuery Data Viewer role from contractors and replace it with a custom role that excludes bigquery.tables.export permission, then use Cloud DLP to redact PII before sending data to the partner
C Enable BigQuery data masking policies on all PII columns, set up Authorized Views for contractors, and use a Cloud Function to copy aggregated data to the partner project on a schedule
D Use Organization Policy constraints to disable BigQuery Data Transfer Service and Cloud Storage object downloads, then create a Pub/Sub pipeline to push aggregated results to the partner project
Answer: A. VPC Service Controls is the only mechanism that prevents data exfiltration even when users have valid IAM permissions. It creates a perimeter that blocks API calls moving data outside the boundary. Egress rules provide granular exceptions — allowing only the specific partner project to receive data, and only from the designated service account. Option B (custom role) can be bypassed in many ways (query results can still be copied via the UI or API). Option C doesn't prevent data from leaving the perimeter. Option D misunderstands how Organization Policies work and doesn't create a true security perimeter.
Question 2 — Encryption Key Management
Your financial services company is migrating a data warehouse to BigQuery. Regulatory requirements mandate that: (1) the company must control encryption keys, (2) keys must be rotated every 90 days, (3) if the company decides to leave GCP, all data must become unreadable by destroying the keys, and (4) key usage must be auditable. The security team wants to maintain the keys within GCP for operational simplicity. What encryption approach should you use?
A Use the default Google-managed encryption and configure Organization Policy to enforce encryption compliance
B Use Customer-Supplied Encryption Keys (CSEK) stored in the company's on-premises HSM, provided with each BigQuery API call
C Use Customer-Managed Encryption Keys (CMEK) in Cloud KMS with automatic 90-day key rotation, and configure Cloud Audit Logs to track all key operations
D Use Cloud External Key Manager (EKM) with keys stored in an external third-party KMS
Answer: C. CMEK in Cloud KMS meets all four requirements: (1) the company controls key creation, rotation, and destruction; (2) Cloud KMS supports automatic key rotation at any configured interval including 90 days; (3) destroying the key renders all data encrypted with it permanently unreadable; (4) Cloud Audit Logs automatically records all key access and administrative operations. The security team wants to keep keys within GCP, ruling out CSEK (Option B) and EKM (Option D). Option A (Google-managed) doesn't give the company control over keys.
Question 3 — Sensitive Data Handling
Your healthcare analytics platform stores patient records in BigQuery. Data scientists need to run aggregate analyses on the data (average treatment duration by condition, regional health trends) but must never see individual patient identifiers (name, SSN, medical record number). However, a small compliance team needs the ability to re-identify specific records for regulatory audit purposes. The solution must preserve referential integrity across tables (e.g., joins on patient ID must still work after de-identification). What should you implement?
A Use Cloud DLP with crypto-based tokenization (deterministic encryption) on patient identifiers, store the crypto key in Cloud KMS accessible only to the compliance team, and grant data scientists access to the tokenized dataset only
B Apply Cloud DLP masking to replace all patient identifiers with asterisks, and maintain a separate lookup table mapping masked values to originals that only the compliance team can access
C Use BigQuery column-level security with policy tags on identifier columns, granting Fine-Grained Reader only to the compliance team
D Create Authorized Views that exclude patient identifier columns, and give data scientists access only to these views
Answer: A. Crypto-based tokenization (deterministic) satisfies all requirements: (1) patient identifiers are replaced with tokens that data scientists can't reverse, (2) deterministic tokenization preserves referential integrity — the same input always produces the same token, so joins across tables still work, (3) the compliance team can re-identify records using the crypto key in Cloud KMS. Option B (masking) is irreversible and destroys referential integrity. Option C (column-level security) hides columns entirely from data scientists — they can't even join on patient ID. Option D (Authorized Views) also hides the columns, breaking cross-table joins.