professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Establishing cryptographic control and auditable compliance involves designing data architectures on Google Cloud that meet strict legal and regulatory standards. This is achieved by implementing robust data-at-rest protection and comprehensive, immutable audit trails. The primary tools for this are Customer-Managed Encryption Keys (CMEK) and Customer-Supplied Encryption Keys (CSEK), both integrated with Cloud Key Management Service (KMS).
Data-at-rest protection using CMEK gives you direct control over the encryption, location, and lifecycle of your keys. You create a key ring and a symmetric encryption key in Cloud KMS, located in a specific geographic region. You then grant the cloudkms.cryptoKeyEncrypterDecrypter IAM role to the service accounts of Google Cloud services like BigQuery or Cloud Storage. This permission allows these services to use your key for encryption and decryption without granting end-users direct key access. Cloud KMS enforces key residency, guaranteeing that key material does not leave its configured geographic boundaries.
A five-step process flow showing how CMEK protects data at rest: create a regional key in Cloud KMS, grant the Encrypter/Decrypter IAM role to service accounts, services call encrypt and decrypt, data is encrypted at rest via envelope encryption, and key residency is enforced. A warning notes that disabling or destroying the key makes the data permanently inaccessible.
For auditable compliance, you must implement automated monitoring and immutable logging. Cloud Audit Logs capture all administrative activities and data access events related to your Cloud KMS keys and encrypted resources. IAM policies enforce the principle of least privilege, ensuring only authorized identities can use encryption keys. Cloud Storage Bucket Lock creates immutable, non-erasable retention policies for audit logs, which is critical for legal holds and regulatory audits.
Advanced compliance is managed through organization policies and detective controls. You can enforce that new resources must use CMEK by applying the constraints/gcp.restrictNonCmekServices organization policy. Other policies can restrict key locations, require specific protection levels (like HSM), and enforce minimum key destruction durations. Cloud KMS Key Usage Tracking allows you to monitor all Google Cloud resources protected by your CMEKs and identify data that has become inaccessible due to a disabled or destroyed key.
Exam tip: If a CMEK is revoked, disabled, or destroyed, the associated data becomes permanently inaccessible, which can render entire environments like Cloud Composer unusable.
Data residency refers to the physical location of data and the local regulations that govern its storage, encryption, and access. In a traditional on-premises environment, various components integrate to handle data residency, such as using a Cloud Access Security Broker (CASB) to secure data before it's transmitted overseas.
There are several key data residency challenges:
Google Cloud provides tools to meet these challenges. You can set the specific storage location for your data when creating resources like Cloud SQL instances. The cross-region read replica feature for Cloud SQL can help meet data residency standards for a designated region. You can also control the network locations from which users and administrators can access data.
You can use organization policy constraints to enforce data residency requirements at the organization, project, or folder level. The resource locations constraint lets you define the specific Google Cloud regions (e.g., us-east1) where users are allowed to create new resources for supported services. Existing violations of these location policies can be discovered using Security Health Analytics and then remediated.
A Google Cloud resource hierarchy (Organization, Folder, Project) applies the constraints/gcp.resourceLocations organization policy, which allows resources only in region us-east1, where BigQuery, Cloud Storage, and Cloud SQL run compliantly. Requests to create resources in disallowed region europe-west1 are denied, and Security Health Analytics flags any existing location violations back to the project for remediation.
For services like BigQuery and Cloud Storage, you can configure localized storage and processing pipelines to prevent unauthorized cross-border data transfer. While BigQuery offers multi-region locations for larger quotas, you should use regional storage for locality-restricted data to ensure it stays within specific geographic boundaries. The BigQuery Data Transfer Service can be used to copy datasets between regions while maintaining compliance.
Implementing data privacy on Google Cloud requires a shared responsibility model to meet global regulations like GDPR, CCPA, and HIPAA. The goal is to safeguard Personally Identifiable Information (PII) and Protected Health Information (PHI) by discovering, classifying, and obfuscating sensitive data.
Cloud Sensitive Data Protection (Cloud DLP) is the primary service for de-identifying, masking, and tokenizing sensitive information. It supports over 150 built-in classifiers to inspect large-scale datasets across both streaming and batch processing pipelines. Complying with privacy rules also requires configuring GCP projects securely to prevent sensitive metadata from leaking into audit logs or resource labels.
GCP supports multiple advanced de-identification techniques to preserve data utility for analytics while minimizing privacy risks. Organizations can select from several standard methods:
Exam tip: Selecting the correct de-identification method, such as format-preserving encryption (FPE), depends on whether you need compatibility with legacy systems.
Securely managing cryptographic keys is essential for both de-identification and the potential re-identification of sensitive datasets. Organizations should avoid using plaintext keys. Instead, use Customer-Managed Encryption Keys (CMEK) wrapped by Cloud HSM or managed via Cloud KMS. For client-side operations, the open-source Tink encryption library can encrypt sensitive columns before ingestion, which remains compatible with BigQuery's decryption functions. Secure token vaulting ensures that raw data can only be redeemed via heavily restricted lookup processes.
Once data is ingested into BigQuery, strict access controls must be enforced to maintain regulatory compliance. Column-level security and policy tags restrict access to sensitive fields, requiring analysts to possess the Fine-Grained Reader role to view unmasked data. Implementing VPC Service Controls establishes secure perimeters to prevent unauthorized data exfiltration. Administrators must also regionalize data processing and monitor access logs while keeping PHI out of resource metadata.
resource locations constraint, allow you to enforce data residency by restricting the Google Cloud regions where new resources can be created.Customer-Managed Encryption Keys protect data at rest by granting the cloudkms.cryptoKeyEncrypterDecrypter IAM role to the service accounts of services like BigQuery or Cloud Storage. This allows those services to perform encryption and decryption without giving end-users direct access to key material, while Cloud Key Management Service (KMS) enforces key residency within configured geographic boundaries.
Administrators can enforce data residency requirements by applying organization policy constraints, specifically the resource locations constraint, to define the exact regions where new resources can be created. Additionally, teams can set up localized regional storage and processing in services like BigQuery and Cloud Storage to prevent unauthorized cross-border data transfers.
BigQuery restricts access to sensitive fields using column-level security and policy tags, which require analysts to have the Fine-Grained Reader role to view unmasked data. Furthermore, administrators can implement VPC Service Controls to establish secure perimeters that prevent unauthorized data exfiltration.
Cloud Sensitive Data Protection supports tokenization to replace raw identifiers with reversible cryptographic tokens, cryptographic hashing for irreversible data integrity checks, and bucketed generalization to group precise values into broad ranges. The service uses over 150 built-in classifiers across batch and streaming pipelines to discover and mask Personally Identifiable Information (PII) and Protected Health Information (PHI).
An organization is designing an automated Dataflow ingestion pipeline to de-identify sensitive structured records containing Personally Identifiable Information (PII) before storing them in BigQuery for analytics. The privacy compliance team establishes the following technical constraints:
patient_account_id column must retain referential integrity for analytical joins, remain reversible for authorized re-identification pipelines, and preserve its original 10-digit numeric character set to maintain backward compatibility with legacy schema validators.patient_age column must be abstracted into discrete 10-year cohorts to mitigate re-identification risk while preserving population distribution metrics.Which transformation configuration in Cloud Sensitive Data Protection (Cloud DLP) meets all of these requirements?
Configure RecordTransformations with a cryptoReplaceFfxFpeConfig specifying a kmsWrapped key and a numeric common alphabet for patient_account_id, and a fixedSizeBucketingConfig specifying a bucket size of 10 for patient_age
Configure RecordTransformations with a cryptoHashConfig specifying a kmsWrapped key for patient_account_id, and a fixedSizeBucketingConfig specifying a bucket size of 10 for patient_age
Configure RecordTransformations with a cryptoDeterministicConfig specifying a kmsWrapped key for patient_account_id, and a characterMaskConfig specifying numberToMask for patient_age
Configure RecordTransformations with a cryptoReplaceFfxFpeConfig specifying a transient crypto key and numeric alphabet for patient_account_id, and a timePartConfig extracting date ranges for patient_age