professional-cloud-data-engineer
Least-privilege access is the principle of granting users and service accounts only the minimum permissions required for their tasks. In Google Cloud, this is managed centrally through Cloud Identity and Access Management (IAM), which controls access to resources across all services. IAM focuses on resource-level access control, assigning permissions to users, groups, and service accounts for specific Google Cloud resources, thereby reducing the overall attack surface.
Google Cloud provides three main types of roles to implement least privilege. Basic roles (Owner, Editor, Viewer) are broad and generally not recommended for strong security. Predefined roles offer granular permissions tailored to specific services like BigQuery and Cloud Storage and are designed for common use cases. For unique requirements, custom roles can be created by bundling specific permissions together. For BigQuery, additional fine-grained controls include table-level, column-level (using policy tags), and row-level security.
Service account impersonation is a secure practice that eliminates the need for long-lived credential sharing in automated pipelines. Instead of using service account keys, authorized users can temporarily impersonate a service account. This requires the user to have either the Service Account User role (to act as the service account) or the Service Account Token Creator role (to generate short-lived access tokens). Impersonation creates temporary tokens, improving security. Where possible, Workload Identity Federation is a more secure alternative, allowing external workloads to impersonate service accounts without any keys.
For sensitive data workloads, additional layers of security are applied on top of IAM. Column-level access control in BigQuery restricts access to sensitive columns using policy tags, requiring the Fine-Grained Reader role. Dynamic data masking automatically obscures column data at query runtime based on the user's roles. To protect data movement, VPC Service Controls create security perimeters around Google-managed services to prevent data exfiltration. For encryption control, customer-managed encryption keys (CMEK) managed through Cloud KMS ensure data remains protected by encryption keys you control.
This focus area involves using advanced tools to create multiple security layers that consider the context of an access request, thereby protecting sensitive data from unauthorized exposure or exfiltration.
VPC Service Controls mitigate data exfiltration risks by creating security perimeters, called service perimeters, around Google-managed services like BigQuery and Cloud Storage. These perimeters control data movement across the boundary. To allow authorized communication between separate projects within different perimeters, administrators can configure perimeter bridges.
BigQuery provides native tools for granular data security. Column-level access control uses policy tags to restrict access to specific columns, requiring users to have the Fine-Grained Reader role. Row-level security filters dataset rows based on the user's identity or other conditions. Dynamic data masking selectively obscures column values when a query runs, based on the user's roles. For cell-level encryption, AEAD encryption functions require the user to have permissions for both the table and the cryptographic key to decrypt data.
Enforcing least privilege extends to service accounts. Best practices include using custom service accounts with tightly scoped permissions instead of broad default service accounts. Authentication should rely on service account impersonation to generate short-lived tokens, avoiding downloadable keys. Organization policies can be used to disable automatic, overly permissive grants to default service accounts.
Protecting data begins with discovery and classification. Sensitive Data Protection automates the discovery of personal information and can de-identify data before ingestion. For encryption, Customer-Managed Encryption Keys (CMEK) provide control over encryption keys. For the highest level of physical security, CMEK can be backed by Cloud HSM hardware security modules.
Organization Policies are centralized, declarative rules that enforce security, compliance, and governance guardrails across your Google Cloud resource hierarchy (Organization, Folders, Projects). They act as preventive controls to establish a consistent security baseline.
A core feature is policy inheritance. A policy set at a higher level (e.g., the Organization node) automatically applies to all child Folders and Projects. However, you can override an inherited policy by setting a different, more specific policy directly on a child resource. This allows for broad compliance enforcement while permitting justified exceptions, such as allowing a specific project to use additional geographic regions.
Several critical organization policy constraints are used to establish foundational security:
gcp.resourceLocations: Restricts the geographic regions where resources (like Compute Engine instances or Cloud Storage buckets) can be created, helping meet data residency requirements.iam.disableServiceAccountKeyCreation: A boolean constraint that prevents the creation of external, long-lived service account keys, forcing the use of more secure methods like impersonation or Workload Identity Federation.iam.automaticIamGrantsForDefaultServiceAccounts: Disables the automatic granting of broad roles (like Editor) to default service accounts, enforcing the principle of least privilege from creation.For granular, attribute-based control, you can use tags. Tags are metadata labels attached to resources. You can then create organization policies or IAM policies that apply conditionally based on these tags. For example, you could allow Public IP addresses only for resources tagged as "public-facing," or enforce stricter constraints on resources that lack a specific "exempt" tag.
Organization policies are a key preventive control in a layered security strategy. They work alongside Cloud IAM (which controls who can do what) and VPC Service Controls (which control data movement). For a Data Engineer, layering these controls—using organization policies to mandate settings like encryption (CMEK) and resource location, while IAM governs data access—is essential for designing secure systems.
Prepare and test your skills
Prepare and test your skills
Predefined roles offer granular permissions tailored to specific services like BigQuery and Cloud Storage for common use cases, while custom roles are created by bundling specific permissions together to meet unique requirements.
Service account impersonation generates short-lived temporary tokens, eliminating the need for long-lived credential sharing and the risk associated with downloadable service account keys.
BigQuery provides column-level access control using policy tags, row-level security filters based on user identity, dynamic data masking at query runtime, and cell-level encryption using AEAD encryption functions.
The 'iam.disableServiceAccountKeyCreation' organization policy constraint is a boolean rule that prevents the creation of external, long-lived service account keys, forcing the use of more secure methods like impersonation or Workload Identity Federation.
An enterprise is centralizing sensitive customer transaction data from multiple business units into a shared BigQuery data warehouse. The data engineering and security teams must implement a robust security architecture that satisfies the following requirements:
Which combination of Google Cloud security mechanisms should the team implement?