Sensitive Data Protection (formerly Cloud DLP) is GCP's service for detecting and masking PII (Personally Identifiable Information). With 200+ built-in infoTypes and the Discovery feature, it automatically surfaces sensitive data in large-scale datasets. Rebranded in 2024, it has evolved into a unified platform combining Discovery and De-identification.
| Category | InfoType |
|---|---|
| Personal | PERSON_NAME, EMAIL_ADDRESS, PHONE_NUMBER |
| Financial | CREDIT_CARD_NUMBER, IBAN_CODE, SWIFT_CODE |
| Government ID | JAPAN_INDIVIDUAL_NUMBER (My Number), US_SOCIAL_SECURITY_NUMBER |
| Medical | JAPAN_HEALTH_INSURANCE_NUMBER, US_DRUG_ENFORCEMENT_AGENCY_NUMBER |
| IT | IP_ADDRESS, MAC_ADDRESS, URL |
| Location | STREET_ADDRESS, LOCATION |
| Biometric | FACE_DETECTION (images) |
# Discovery Scan Config 作成
gcloud dlp discovery-configs create \
--location=global \
--project=my-project \
--discovery-config-from-file=config.yaml
# config.yaml
displayName: "BQ PII Discovery"
status: RUNNING
targets:
- bigQueryTarget:
filter:
otherTables: {}
cadence:
updateFrequency: UPDATE_FREQUENCY_DAILY
inspectTemplates:
- "projects/my-project/inspectTemplates/pii-template"from google.cloud import dlp_v2
client = dlp_v2.DlpServiceClient()
parent = f"projects/my-project/locations/global"
inspect_config = {
"info_types": [
{"name": "EMAIL_ADDRESS"},
{"name": "PHONE_NUMBER"},
{"name": "JAPAN_INDIVIDUAL_NUMBER"},
],
"min_likelihood": dlp_v2.Likelihood.POSSIBLE,
"include_quote": True,
}
item = {"value": "山田太郎、メール: [email protected]、電話: 03-1234-5678、マイナンバー: 123456789012"}
response = client.inspect_content(
request={"parent": parent, "inspect_config": inspect_config, "item": item}
)
for finding in response.result.findings:
print(f"{finding.info_type.name}: {finding.quote} ({finding.likelihood.name})")
# 出力:
# EMAIL_ADDRESS: [email protected] (LIKELY)
# PHONE_NUMBER: 03-1234-5678 (LIKELY)
# JAPAN_INDIVIDUAL_NUMBER: 123456789012 (VERY_LIKELY)| Method | Example | Reversible | Use Case |
|---|---|---|---|
| Masking | ***-****-1234 | No | Display |
| Tokenization | USR-A1B2C3 | Yes (lookup table) | Analytics |
| Format-preserving Encryption | 4111-2222-3333 → 7281-9302-5841 | Yes (key) | Format preservation |
| Bucketing | Age 32 → 30-39 | No | Statistical analytics |
| Date Shift | 2026-05-24 → 2026-05-15 | Yes (offset stored) | Preserves time series |
| Cryptographic Hashing | SHA-256 | No | ID generation |
# Cloud Function でメッセージ受信時にマスキング
def deidentify_message(event, context):
from google.cloud import dlp_v2
import base64, json
message = base64.b64decode(event['data']).decode('utf-8')
data = json.loads(message)
client = dlp_v2.DlpServiceClient()
response = client.deidentify_content(
request={
"parent": "projects/my-project/locations/global",
"deidentify_config": {
"info_type_transformations": {
"transformations": [{
"primitive_transformation": {
"character_mask_config": {
"masking_character": "*",
"number_to_mask": 0,
}
}
}]
}
},
"inspect_config": {
"info_types": [{"name": "EMAIL_ADDRESS"}, {"name": "PHONE_NUMBER"}],
},
"item": {"value": data.get('text', '')},
}
)
# マスク済みデータを別 Topic に転送
publish_to_clean_topic(response.item.value)| Item | Price |
|---|---|
| Storage Inspection (BQ/GCS) | $1.50/GB |
| Discovery (continuous scan) | $1.00/GB |
| Streaming (Pub/Sub) | $0.05/GB |
| API Inspection | $0.01/1000 unit |
| De-identification | Same as Inspection |
What is the relationship between Sensitive Data Protection and Cloud DLP?
They are the same service, rebranded in 2024. Cloud DLP was renamed to Sensitive Data Protection. Features and APIs are unchanged.
Which PII types are supported?
200+ built-in infoTypes: credit cards, SSN, Japan Individual Number (My Number), phone numbers, emails, IP addresses, medical codes, and more. Japanese types (My Number, Health Insurance Number, etc.) are supported.
What is Discovery?
Automatic PII discovery across BigQuery, Cloud SQL, and GCS. It catalogs sensitive data automatically across terabyte-scale datasets and integrates with Dataplex.
What de-identification methods are available?
Masking (****), Tokenization (pseudo IDs), Format-preserving Encryption (preserves the original format), Bucketing (e.g. age → age range), and Date Shift (offset dates).
Can data be re-identified?
Format-preserving Encryption and Tokenization can be reversed with a key. Masking and Bucketing are irreversible. Choose the method that fits your use case.
What is the pricing model?
Inspection: $1.00/GB (Discovery), $1.50/GB (Storage Inspection), $0.05/GB (Streaming). De-identification is priced the same as Inspection.
How does it compare with AWS Macie and Azure Purview?
All three detect PII. GCP offers the most infoTypes, Japanese language support, and Discovery at scale. Macie focuses on S3; Purview is tightly integrated with Microsoft 365 and Azure.
Is real-time monitoring possible?
Yes. You can detect and mask PII in real time via the DLP API as messages flow through Pub/Sub, and also before Streaming Inserts into BigQuery.
Related: Security & Privacy
Database Migration Service (DMS) 完全ガイド|Oracle/MySQL/PG → Cloud SQL/AlloyDB (GCP)
Google Cloud Database Migration Service の全機能解説。Oracle / MySQL / PostgreSQL / SQL Server / MongoDB → Cloud SQL / AlloyDB / BigQuery / Firestore 移行。Heterogeneous 移行、Continuous Migration、料金、AWS DMS 比較を 2026 年最新版で網羅。
GCP Associate Data Practitioner (ADP) 完全ガイド|2024 新試験・BigQuery・SQL 中心
Google Cloud Associate Data Practitioner (ADP、2024 新設) の試験範囲、BigQuery / Cloud Composer / Dataform / Looker Studio、SQL スキル要件、AWS DEA / Databricks DE / Azure DP-700 比較を詳解。
GCP Professional Cloud Developer (PCD) 完全ガイド|Cloud Run・GKE・CI/CD・APM
Google Cloud Professional Cloud Developer の試験範囲、Cloud Run / GKE / Cloud Build / Cloud Trace、AWS DVA / Azure AZ-204 比較、学習ロードマップを徹底解説。
GCP Professional Cloud Database Engineer (PCDBE) 完全ガイド|Spanner・AlloyDB・Cloud SQL
Google Cloud Professional Cloud Database Engineer の試験範囲、Spanner / AlloyDB / Cloud SQL / Bigtable / Firestore、AWS DBS・Azure DP-300 比較を詳解。
* Google Cloud is a trademark of Google LLC. For the latest information, see the official Sensitive Data Protection documentation.
Practice with certification-focused question sets
Go to the GCP exam prep pageNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Google Cloud Certification Roadmap (2026)
Choose your GCP certification path — Foundational, Associate...
CDL Cloud Digital Leader: Complete Exam Guide (2026)
Pass the Cloud Digital Leader exam — cloud business value, G...
GAIL Generative AI Leader: Complete Exam Guide (2026)
Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pip...
Associate Cloud Engineer (ACE): Complete Guide (2026)
Pass the Associate Cloud Engineer exam — Console, gcloud, pr...