Masking Sensitive Data for Analytics While Retaining Source

PDE By islever Editorial Last updated

Monitoring and troubleshooting processes. Designing for security and compliance.

Short answer

C Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery.

Question

You are preparing an organization-wide dataset. You need to preprocess customer data stored in a restricted bucket in Cloud Storage. The data will be used to create consumer analyses. You need to follow data privacy requirements, including protecting certain sensitive data elements, while also retaining all of the data for potential future use cases. What should you do?
  1. Use the Cloud Data Loss Prevention API and Dataflow to detect and remove sensitive fields from the data in Cloud Storage. Write the filtered data in BigQuery.
  2. Use customer-managed encryption keys (CMEK) to directly encrypt the data in Cloud Storage. Use federated queries from BigQuery. Share the encryption key by following the principle of least privilege.
  3. Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery. Correct Answer
  4. Use Dataflow and Cloud KMS to encrypt sensitive fields and write the encrypted data in BigQuery. Share the encryption key by following the principle of least privilege.

Key Takeaways

The key trap is confusing 'removal' with 'masking'; retention requirements prohibit deleting sensitive fields, making masking the only viable option for preserving data utility in analytics.

Learn how to preprocess customer data by masking sensitive elements using Cloud DLP and Dataflow before loading into BigQuery, ensuring privacy compliance while retaining all original data.

Common mistake: Candidates often choose Option A because they focus solely on removing PII to satisfy privacy rules, ignoring the critical instruction to 'retain all of the data,' which makes removal non-compliant with the business requirement.

Expert Analysis

Retain All Data vs. Removal The question explicitly states the requirement to "retain all of the data for potential future use cases." This constraint immediately eliminates options that involve deleting or permanently removing sensitive fields from the source data. Option A uses the Cloud Data Loss Prevention (DLP) API to "detect and remove sensitive fields," which violates the retention requirement because the original sensitive values are lost.

Masking vs. Encryption in BigQuery For consumer analyses, analysts typically need to work with realistic data distributions without seeing raw Personally Identifiable Information (PII). Masking is the standard technique here. It transforms sensitive values (e.g., replacing a name with a pseudonym or hashing an ID) while preserving the data structure and utility for statistical analysis. Option C correctly employs Dataflow to orchestrate this masking using the DLP API and writes the processed dataset to BigQuery. This allows analysts to query the masked data while keeping the original raw data intact in Cloud Storage for future needs.

Why Encryption is Incorrect for Analysis Options B and D suggest encrypting the data. While encryption protects data at rest, it renders the data unreadable to applications and users who do not possess the decryption keys. If analysts need to run queries on encrypted columns, they must decrypt them first, which defeats the purpose of privacy protection during the analysis phase unless specific cryptographic techniques like homomorphic encryption are used (which are not mentioned). Furthermore, sharing encryption keys via "least privilege" as suggested in B and D is operationally complex and often insecure if many analysts need access. Masking provides a safer, more practical solution for analytics environments.

Operational Consequence Choosing removal (A) breaks compliance with the "retain all" rule. Choosing encryption (B/D) blocks analytical access or requires key management overhead. Masking (C) balances privacy, usability, and retention.

Exam Strategy

When a question mentions both 'privacy/compliance' and 'retention/future use', avoid any option that deletes or removes data. Look for 'masking', 'tokenization', or 'pseudonymization' instead. If the goal is analysis, ensure the method keeps the data readable/usable for queries, ruling out raw encryption options that block access.

Frequently Asked Questions

Can I use encryption for analytics instead of masking?

Encryption protects data at rest but generally prevents querying without decryption. Masking transforms data to hide PII while keeping it usable for statistical analysis and reporting.

Does masking change the data distribution?

Good masking techniques (like deterministic hashing or substitution ciphers) preserve the structure and distribution of the data, allowing valid statistical analysis even though the original values are hidden.

More PDE FAQ →

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 6 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 6

  1. HectorLeon2099 👍 6 Answered C
    It's C. "A" removes data and retaining all is a requirement.
  2. EIM_Exam_Topics 👍 1
    While I agree with C, removing data does not lead to the inability to do consumer analyses. Analyses such as segmentation and clustering don't require PII data.
  3. 22c1725 👍 1 Answered C
    Removing data will lead to unability to do study & consumer analyses. since it's likely all of consumer data is under PII.
  4. AwesomeGCP 👍 1 Answered C
    C. Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery.
  5. 22c1725 👍 1 Answered C
    Not A since "while also retaining all of the data" is required.
Show 1 more comment
  1. Nagamanikanta 👍 1 Answered C
    option C we can simply mask the data and process in biguery

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to PDE Study Guide