Question 77 of 500
Ensuring data protectionmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct approach is to use the Cloud DLP API to inspect and redact the log message before writing to Cloud Logging. This is the most secure method because it applies data loss prevention at the point of log generation, ensuring that personally identifiable information (PII) is stripped from the payload before it ever reaches the log sink. By integrating the Cloud DLP API directly into the Cloud Function’s execution flow, you proactively redact PII from Cloud Functions logs, preventing any sensitive data from being stored or transmitted. On the Google Professional Cloud Security Engineer exam, this scenario tests your understanding of the principle of least privilege and defense in depth—specifically, that redacting at the source is superior to post-hoc filtering or relying on log exclusions. A common trap is choosing a solution that redacts logs after they are written, which still exposes data in transit or during processing. Remember the memory tip: “Redact before you react”—apply DLP at the function level, not after the fact.

PCSE Ensuring data protection Practice Question

This PCSE practice question tests your understanding of ensuring data protection. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company uses Cloud Functions to process employee data and wants to ensure that personally identifiable information (PII) is redacted from log output. Which approach should they take?

Question 1mediummultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use Cloud DLP API to inspect and redact the log message before writing to Cloud Logging.

Option B is correct because the Cloud DLP API can be integrated directly into a Cloud Function to inspect and redact PII from log messages before they are written to Cloud Logging. This ensures that sensitive data never appears in the logs, which is the most secure approach. Using Cloud DLP at the point of log generation prevents any exposure, rather than relying on post-hoc analysis or filtering.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use Cloud Audit Logs to capture all access and redact at analysis.

    Why it's wrong here

    Audit Logs are for administrative activities, not application logs.

  • Use Cloud DLP API to inspect and redact the log message before writing to Cloud Logging.

    Why this is correct

    DLP can de-identify text in application logic.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create a Logging sink with an exclusion filter to drop logs containing PII.

    Why it's wrong here

    Exclusion drops the entire log entry, not redacts.

  • Enable VPC Service Controls to prevent PII from leaving the VPC.

    Why it's wrong here

    VPC Service Controls do not redact PII from logs.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the distinction between reactive filtering (exclusion sinks) and proactive redaction (DLP API), and the trap here is that candidates mistakenly believe a Logging sink can redact data when it can only drop entire log entries, not modify their content.

Detailed technical explanation

How to think about this question

Under the hood, the Cloud DLP API uses content inspection with infoType detectors (e.g., EMAIL_ADDRESS, CREDIT_CARD_NUMBER) to identify PII, and can apply a redaction transformation that replaces matched values with a placeholder like '[REDACTED]'. In a Cloud Function, this is typically implemented by calling the DLP API's `inspectContent` or `deidentifyContent` method on the log string before passing it to the Cloud Logging client library. A real-world scenario is a serverless application that processes HR records; without DLP redaction, a single log line containing an employee's Social Security number could be exposed in Logs Explorer, leading to compliance violations.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCSE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PCSE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCSE question test?

Ensuring data protection — This question tests Ensuring data protection — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use Cloud DLP API to inspect and redact the log message before writing to Cloud Logging. — Option B is correct because the Cloud DLP API can be integrated directly into a Cloud Function to inspect and redact PII from log messages before they are written to Cloud Logging. This ensures that sensitive data never appears in the logs, which is the most secure approach. Using Cloud DLP at the point of log generation prevents any exposure, rather than relying on post-hoc analysis or filtering.

What should I do if I get this PCSE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More PCSE practice questions

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCSE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCSE exam.