Prepare and test your skills
Prepare and test your skills
Non-cryptographic de-identification in Sensitive Data Protection (SDP) (opens in a new tab) removes or generalizes sensitive values without encryption keys. SDP can inspect data with more than 100 built-in classifiers, then apply masking, redaction, bucketing, date shifting, and tokenization to reduce handling risk. Because masking, redaction, bucketing, and date shifting are generally one-way, the sanitized replica cannot be reversed to recover original values. Choose these methods when sanitized data must flow to storage, export, or analytics and no authorized workflow needs the originals.
Non-cryptographic transformations in SDP protect sensitive records by replacing, removing, or generalizing detected values while leaving non-sensitive content usable. Masking obscures characters in a detected value, redaction removes matched text or an image region and replaces it with a placeholder or opaque rectangle, and bucketing and date shifting generalize values to reduce identifiability. These methods keep raw identifiers from traveling to downstream storage or analytics, which lowers risk for large volumes of personally identifiable information (PII). Choose a non-cryptographic transformation when the pipeline must sanitize data before storage, export, or analytics and reversal is not required. If high-risk data is not needed at all, removal is preferred over transformation, and deleted BigQuery columns will no longer produce column data profiles on reprofiling.
SDP divides de-identification work into two transformation scopes that control how inspection findings flow into protection. recordTransformations apply a transformation configuration per field and are designed for structured or tabular data, while infoTypeTransformations inspect for sensitive data and transform each finding and are designed for unstructured or free-text data.
| Transformation scope | Input shape | How protection is applied |
|---|---|---|
| recordTransformations | Structured or tabular data | Transformation configuration flows from the field definition to the value in that field, such as transforming values in a US_SOCIAL_SECURITY_NUMBER column |
| infoTypeTransformations | Unstructured or free-text data | Inspection flows from the text to each detected finding, so an SSN inside a sentence is masked or encrypted while surrounding text remains intact |
A per-field rule protects an entire column uniformly, while an infoType-based rule preserves surrounding narrative and changes only the detected span. Both scopes can support custom infoTypes in addition to built-in detectors.
Exam tip: Use recordTransformations when the rule applies per field in tabular data, and use infoTypeTransformations when the sensitive value is embedded inside free text and only the finding should change.
Text classification in SDP identifies sensitive entities in free-form input without changing the original text. Classification of free-form input returns findings organized by InfoType, Likelihood, and Offset, where offset marks where the potential match was found in the string. Common pipeline uses include sanitizing user input before database persistence, stripping PII from chat histories and support tickets before review or training ingestion, and redacting proprietary data from generative AI prompts before content flows to external models. Automatic text redaction takes the same detection result and produces sanitized output, for example replacing an email address, National Provider Identifier, and driver's license with *** while labels and sentence structure remain. The application flow is fixed: data flows from the input handler to SDP for inspection and redaction, then only the redacted text flows to the database, log, or model.
Image redaction in SDP detects sensitive text and objects within an image and returns a redacted copy where each detection is obscured by an opaque rectangle. Text detection uses object character recognition (OCR) and can redact text matching all default infoTypes, only the infoTypes listed in the image redaction configuration, or all detected text. Object detection redacts regions that typically contain sensitive information, such as OBJECT_TYPE/BARCODE, OBJECT_TYPE/LICENSE_PLATE, and OBJECT_TYPE/WHITEBOARD. By default SDP uses black rectangles, but the configuration can assign a different color to each infoType. Image redaction has strict input boundaries: SDP can redact many image types, including JPEG, BMP, and PNG, while content redaction is not supported for SVG, PDF, XLSX, PPTX, or DOCX files. An image redaction request cannot include limits in its inspection configuration because limits can cause only some data to be redacted; if limits is set, SDP generates an error.
Automated de-identification pipelines use SDP templates and managed keys to sanitize data at scale while limiting who can see the protection logic. A reference architecture separates three ownership zones: a Dataflow streaming de-identification pipeline that transforms sensitive text, configuration management for SDP templates and keys accessible only to a small group such as security admins, and a validation and re-identification pipeline that checks de-identified copies and re-identifies data at scale when authorized. Data flows from source storage through the de-identification pipeline to a de-identified replica, so downstream analytics depends on the sanitized copy rather than the raw dataset. Restricting template and key access preserves the trust boundary between pipeline operators and security admins. Cloud Data Fusion (opens in a new tab) integrates the same controls through an SDP plugin with three transforms:
The PII Filter transform can filter on records or fields, and filtering by field avoids pipeline failure when a record exceeds 0.5 MB under SDP content limits. Its error handling defines the consequence of a sensitive-data error: stop the pipeline as soon as an error is encountered, skip the record without reporting an error and continue, or send errors to the error port and continue. The Redact transform cannot combine predefined filters and a custom template; the pipeline must use either matching rules grouped by category or a custom template ID.
Statistical de-identification in SDP measures whether quasi-identifiers in a dataset could be used to re-identify individuals after masking or generalization. K-anonymity is a property where the quasi-identifiers for each person are identical to at least k minus 1 other people in the same dataset, meaning each released record blends into a group of at least k records. Computing k-anonymity lets a data owner test whether bucketing, masking, or other generalizations have created large enough equivalence groups before export or analysis. Choose stronger generalization or suppression when the computed k value is too low for the intended sharing boundary.
Sensitive Data Protection (SDP) (opens in a new tab) is the service for discovering, classifying, and protecting sensitive data such as PII. Cloud Data Loss Prevention (Cloud DLP) is now a part of Sensitive Data Protection, while the API name remains the Cloud Data Loss Prevention API (DLP API). SDP scans data where it is stored, so data does not leave its region of origin during inspection or profiling. Discovery profiles show where risk exists across stored data, while detailed inspection proves exactly what and where the sensitive values are.
Inspection templates in SDP are reusable configurations that persist what to look for and how to look for it. A template stores the selected infoTypes, optional rulesets, and a confidence threshold, and it can then be referenced by inspection jobs and discovery scan configurations. A template is valid only when at least one infoType is selected, and the same template can be reused across Cloud Storage, BigQuery, and Firestore in Datastore mode (Datastore). Templates are regional resources with strict data residency behavior: a template used for profiling must be in the same region as the data to be profiled, and SDP never applies a template outside the region where that template is stored. A new template can be created in the global region for broad coverage, or dedicated templates can be supplied per region by full resource name in the form projects/PROJECT_ID/locations/REGION/inspectTemplates/TEMPLATE_ID.
InfoTypes in SDP are the classifiers that define what counts as sensitive data in an inspection template. Built-in infoTypes cover more than 100 common sensitive categories, such as PERSON_NAME, PHONE_NUMBER, US_SOCIAL_SECURITY_NUMBER, and DATE_OF_BIRTH, and are managed through Manage infoTypes in the console. Built-in detectors combine pattern matching with context signals, which is why tuning is often needed to control false positives. Custom infoTypes extend detection to organization-specific sensitive data, including regular expressions, dictionaries and word lists, and stored infoTypes. Custom infoTypes are created and managed alongside built-in infoTypes in the same inspection template workflow. Use custom infoTypes when built-in detectors do not cover proprietary identifiers, internal codes, or domain-specific terms that still create data risk.
Detection tuning in SDP controls the tradeoff between missing sensitive data and generating false positives. The confidence threshold sets the minimum likelihood a match must reach before SDP reports it as a finding, so raising the threshold reduces noise but can miss weaker matches. Rulesets modify detector behavior for specific infoTypes, including hotword rules that raise likelihood when a nearby word provides context. For example, a hotword rule can increase the likelihood of a PERSON_NAME match when the word patient appears nearby, which focuses the detector on patient names in a medical database rather than all person names. A separate exclusion behavior can omit overlapping matches, such as omitting a DOMAIN_NAME match that is part of an email address, so only the more specific finding is kept. Evaluate tuning by exporting sample findings and checking the quote, matched infoType, and location against what was intended to be flagged.
Exam tip: An inspection template must be in the same region as the profiled data; add a global template as fallback, or data in regions without a dedicated template cannot be profiled.
Inspection jobs in SDP perform detailed, on-demand scans of specific Cloud Storage buckets, BigQuery tables, or Datastore kinds and return individual findings. Job triggers automate inspection jobs on a schedule so repositories are rescanned as data changes. The trigger defines the input data, references an inspection template for detection parameters, adds post-scan actions, and then runs on its schedule. Use an inspection job when investigation needs exact locations and quotes, such as after discovery reports a high free-text score or multiple infoTypes in a BigQuery column or Cloud Storage bucket. For data that has not yet reached backend storage, the synchronous content methods of the DLP API inspect data in near real time to proactively prevent sensitive data from entering storage.
| Method | Trigger and scope | Main output | Choose when |
|---|---|---|---|
| Discovery profiling | Continuous scan at organization, folder, or project level | Data profiles with sensitivity and data risk levels | You need to know what kind of data the organization stores and monitor new data automatically |
| Inspection job with job trigger | Scheduled or on-demand scan of a selected bucket, table, or Datastore kind | Detailed findings with quote and exact location | You need to investigate a specific resource and confirm the extent of exposure |
| Synchronous content methods | Inline API call before data is stored | Near real-time inspect result | You need to block or transform sensitive data before it enters backend storage |
Discovery profiles in SDP are continuously generated summaries that describe sensitivity and data risk across an organization, folder, or project. The discovery service automatically finds new projects, tables, and buckets as the organization grows and reports metrics for audit and security workflows. Discovery acts as the source of truth for where sensitive data lives, and a premade report can break results down by risk, infoType, and location. To use an existing inspection template in a discovery scan configuration, the full resource name must be supplied so the Region field populates correctly:
projects/PROJECT_ID/locations/REGION/inspectTemplates/TEMPLATE_ID.global template to cover regions without a dedicated template.Discovery scan configurations also define a catch-all schedule for resources that do not match any custom schedule. To stop profiling unmatched resources, turn off Profile the resources that don't match any custom schedule.
Scan findings in SDP connect a detected quote to its infoType, location, and the calculated sensitivity and data risk of the containing resource. Sample discovery findings represent a subset of all matches, normally around 10 per bucket, and each finding includes the actual detected string and its exact location. Sample findings do not necessarily represent every infoType discovered, so they are best used to validate whether the inspection configuration matches the intended sensitive data. Discovery scan configurations can automatically send profile insights to other Google Cloud services after a table or bucket is profiled:
sensitive_data_protection_discovery and table discovery_profiles when no table is supplied.High data risk means sensitive data was found without additional protections, while a high free-text score means an unstructured column such as a notes field likely contains multiple PII values. For BigQuery (opens in a new tab) columns with sensitive data, apply policy tags or column-level controls, de-identify raw values with masking or tokenization, or remove unneeded high-risk data. For free-text fields in BigQuery and Cloud Storage, run an on-demand inspection to locate exact PII before applying de-identification.
Cryptographic pseudonymization in Sensitive Data Protection (SDP) (opens in a new tab) replaces raw PII with tokens that preserve analytical utility while reducing exposure risk. Tokenization, also called pseudonymization or surrogate replacement, obfuscates sensitive identifiers so de-identified replicas can still be joined, aggregated, or analyzed without handling original values. SDP performs these transformations at scale through de-identification templates executed in automated pipelines, with re-identification strictly controlled by keys and configuration.
Cryptographic pseudonymization options in SDP use a cryptographic key to produce reversible or one-way tokens that stand in for the original PII. Format-Preserving Encryption (FPE) encrypts a value while keeping its original format and length, so a tokenized phone number or identifier still passes format checks in downstream systems. Deterministic encryption always produces the same token for the same input value when the same key and configuration are used, which preserves referential integrity across rows, tables, and datasets for joins and counts. Cryptographic hashing applies a one-way function with a key to produce a token that cannot be decrypted back to the original, which removes re-identification risk but also removes recovery. Choose FPE when downstream systems require the original format, deterministic encryption when joins and counts must remain consistent, and hashing when no authorized reversal should exist.
Cloud KMS-wrapped keys in SDP protect the data-encryption key that actually tokenizes the values. The transformation configuration contains a kmsWrapped block with a wrappedKey, which is the encrypted data key, and a cryptoKeyName in the form projects/PROJECT_ID/locations/global/keyRings/dlp-keyring/cryptoKeys/dlp-key that points to the Cloud Key Management Service (Cloud KMS) key that unwraps it. At transformation time SDP calls Cloud KMS to unwrap the key, performs encryption or decryption in memory, and writes only the token to the output, so the pipeline depends on both SDP and Cloud KMS being available and authorized. Google recommends wrapped keys for actual sensitive workloads, while unwrapped keys are suitable only for demonstration because anyone with the configuration can reverse the tokens. The surrogate infoType labels the token so SDP can find it later for re-identification. For example, a deterministic configuration for EMAIL_ADDRESS specifies a surrogateInfoType such as EMAIL_ADDRESS_TOKEN, and the output text keeps its surrounding structure while the email itself is replaced by its token. Access to the de-identification template and the Cloud KMS key must be limited to a small group such as security administrators, because possession of the method plus the key equals ability to re-identify. This creates a trust boundary where analysts and downstream environments on one side see only tokens, while key custodians on the other side retain the means to restore originals.
Reversible pseudonymization in SDP preserves the ability to restore originals under control, while irreversible tokenization permanently removes that path to minimize handling risk. Reversible methods require long-term key management, strict access separation, and a defined re-identification workflow; irreversible methods require no key custody for recovery but cannot support authorized reversal, debugging, or disclosure workflows.
| Approach | Reversibility | Key and operational requirement |
|---|---|---|
| Reversible pseudonymization with FPE or deterministic encryption | Reversible through projects.content.reidentify with the same wrapped key, surrogate infoType, and template | Must retain the Cloud KMS key version and template; destroying the key version permanently prevents decryption |
| Irreversible tokenization with cryptographic hashing, masking, redaction, or bucketing | Not reversible; tokens cannot be decrypted back to originals | No recovery key to manage, but loses per-value restoration and requires reprocessing from source if originals are ever needed |
Exam tip: Only data encrypted with a reversible algorithm such as Format-Preserving Encryption or deterministic encryption can be decrypted; hashed, masked, or redacted values cannot be re-identified even with the original template.
SDP applies cryptographic transformations through two transformation scopes that match the shape of the data. The recordTransformations scope applies a transformation per field in structured or tabular data, such as tokenizing every value in a US_SOCIAL_SECURITY_NUMBER column while leaving other columns unchanged. The infoTypeTransformations scope inspects content for findings and transforms only the finding, so in unstructured free text SDP can locate an SSN inside a sentence and encrypt just that value while leaving the rest of the sentence intact. The transformations execute inside managed pipelines that separate duties and preserve scale. Source data flows from storage into a Dataflow streaming de-identification pipeline that applies the SDP template and writes a de-identified replica, and a separate validation and re-identification pipeline later reads tokenized copies and calls re-identify to restore values at scale when authorized. In Cloud Data Fusion (opens in a new tab), the same model appears as three plugin transforms: PII Filter separates sensitive records from non-sensitive records without changing values, Redact identifies sensitive records and applies the configured masking or encryption transformation, and Decrypt restores records previously encrypted with a reversible algorithm using the identical Redact configuration and wrapped key. Traffic flows from the input stream through the Redact transform to tokenized output, and only the holder of the matching Decrypt configuration and Cloud KMS permissions can reverse the flow back to originals.
Use recordTransformations for structured or tabular data where protection applies per field, such as transforming values in a US_SOCIAL_SECURITY_NUMBER column. Use infoTypeTransformations for unstructured or free-text data where inspection finds sensitive values and transforms only each detected finding, so an SSN inside a sentence is protected while surrounding text remains intact.
Use Format-Preserving Encryption when downstream systems require the original format and length to be preserved, and use deterministic encryption when the same input must always produce the same token with the same key and configuration to preserve referential integrity for joins and counts. Use cryptographic hashing when no authorized reversal should exist, because hashing applies a one-way function that cannot be decrypted back to the original.
An inspection template used for profiling must be in the same region as the data to be profiled, and Sensitive Data Protection never applies a template outside the region where that template is stored. A new template can be created in the global region for broad coverage, or dedicated templates can be supplied per region, with an optional global template to cover regions without a dedicated template.
An enterprise is building an automated Dataflow pipeline to sanitize structured customer support CSV files before exporting them to BigQuery for analytics. The files contain fixed fields: Customer_ID, SSN, Age, Signup_Date, and a free-text Agent_Notes field.
The security team has established the following requirements:
SSN by masking all but the last 4 characters.Age into 10-year intervals (e.g., 20-30, 30-40) without incurring content inspection overhead.Signup_Date by a randomized offset to preserve relative time intervals while protecting exact dates.Agent_Notes column with their respective infoType labels.Which Sensitive Data Protection (SDP) configuration should the security team implement?
Last updated