[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E4BNBFVEZJS3KH85NE2HY5":3,"skill-same:01M7E4BNBFVEZJS3KH85NE2HY5":94},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M7E4BNBFVEZJS3KH85NE2HY5","implementing-cloud-dlp-for-data-protection",null,"Implement cloud DLP using Amazon Macie, Google Cloud DLP API, Microsoft Purview, Azure Information Protection, and Nightfall AI to discover, classify, label, de-identify, and protect sensitive data (PII, PHI, financial data) across cloud storage, databases, and pipelines. Use for GDPR\u002FHIPAA\u002FPCI DSS data-discovery, cloud data governance, or CI\u002FCD DLP scanning; not for endpoint, email, or network-level DLP.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-cloud-dlp-for-data-protection\ndescription: 'Implement cloud DLP using Amazon Macie, Google Cloud DLP API, Microsoft\n  Purview, Azure Information Protection, and Nightfall AI to discover, classify, label,\n  de-identify, and protect sensitive data (PII, PHI, financial data) across cloud\n  storage, databases, and pipelines. Use for GDPR\u002FHIPAA\u002FPCI DSS data-discovery, cloud\n  data governance, or CI\u002FCD DLP scanning; not for endpoint, email, or network-level\n  DLP.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- cloud-security\n- dlp\n- data-protection\n- macie\n- data-classification\n- privacy\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_ai_rmf:\n- MEASURE-2.7\n- MAP-5.1\n- MANAGE-2.4\n- MEASURE-2.8\n- MEASURE-2.9\natlas_techniques:\n- AML.T0070\n- AML.T0066\n- AML.T0082\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1078.004\n- T1530\n- T1537\n- T1580\n---\n\n# Implementing Cloud DLP for Data Protection\n\n## When to Use\n\n- When compliance frameworks (GDPR, HIPAA, PCI DSS) require automated sensitive data discovery and protection\n- When building data governance programs that classify and label data across cloud storage\n- When implementing data loss prevention controls for cloud-based data pipelines\n- When auditing cloud environments for unprotected sensitive data (PII, PHI, financial data)\n- When integrating DLP scanning into CI\u002FCD pipelines to prevent sensitive data from reaching production\n\n**Do not use** for endpoint DLP (use Microsoft Purview or Symantec DLP agents), for email DLP (use Microsoft 365 DLP or Google Workspace DLP), or for network-level data exfiltration prevention (use VPC endpoint policies and network firewalls).\n\n## Prerequisites\n\n- Amazon Macie enabled with appropriate S3 bucket permissions\n- Google Cloud DLP API enabled (`gcloud services enable dlp.googleapis.com`)\n- Azure Information Protection or Microsoft Purview configured\n- IAM permissions for DLP service administration and data access\n- Knowledge of data sensitivity categories relevant to the organization (PII, PHI, PCI, proprietary)\n\n## Workflow\n\n### Step 1: Deploy Amazon Macie for S3 Data Discovery\n\nEnable Macie and configure automated sensitive data discovery jobs for S3 buckets.\n\n```bash\n# Enable Amazon Macie\naws macie2 enable-macie\n\n# List all S3 buckets Macie can scan\naws macie2 describe-buckets \\\n  --query 'buckets[*].[bucketName,classifiableSizeInBytes,unclassifiableObjectCount.total]' \\\n  --output table\n\n# Create a classification job for specific buckets\naws macie2 create-classification-job \\\n  --job-type SCHEDULED \\\n  --name \"weekly-pii-scan\" \\\n  --schedule-frequency-details '{\"weekly\":{\"dayOfWeek\":\"MONDAY\"}}' \\\n  --s3-job-definition '{\n    \"bucketDefinitions\": [{\n      \"accountId\": \"ACCOUNT_ID\",\n      \"buckets\": [\"customer-data-bucket\", \"analytics-data-lake\", \"backup-bucket\"]\n    }],\n    \"scoping\": {\n      \"includes\": {\n        \"and\": [{\n          \"simpleScopeTerm\": {\n            \"key\": \"OBJECT_EXTENSION\",\n            \"values\": [\"csv\", \"json\", \"parquet\", \"txt\", \"xlsx\"],\n            \"comparator\": \"EQ\"\n          }\n        }]\n      }\n    }\n  }' \\\n  --managed-data-identifier-ids '[\"SSN\",\"CREDIT_CARD_NUMBER\",\"EMAIL_ADDRESS\",\"AWS_CREDENTIALS\",\"PHONE_NUMBER\"]'\n\n# Create custom data identifier for internal employee IDs\naws macie2 create-custom-data-identifier \\\n  --name \"EmployeeID\" \\\n  --regex \"EMP-[0-9]{6}\" \\\n  --description \"Internal employee ID format\"\n\n# Check job status and results\naws macie2 list-classification-jobs \\\n  --query 'items[*].[name,jobStatus,statistics.approximateNumberOfObjectsToProcess]' \\\n  --output table\n```\n\n### Step 2: Configure Google Cloud DLP API for Data Inspection\n\nUse Google Cloud DLP to inspect and de-identify sensitive data across GCP resources.\n\n```bash\n# Inspect a Cloud Storage bucket for sensitive data\ngcloud dlp inspect-content \\\n  --content-type=TEXT_PLAIN \\\n  --min-likelihood=LIKELY \\\n  --info-types=PHONE_NUMBER,EMAIL_ADDRESS,CREDIT_CARD_NUMBER,US_SOCIAL_SECURITY_NUMBER \\\n  --storage-type=CLOUD_STORAGE \\\n  --gcs-uri=\"gs:\u002F\u002Fsensitive-data-bucket\u002Fdata\u002F*.csv\"\n\n# Create an inspection job for BigQuery\ncat > dlp-job.json \u003C\u003C 'EOF'\n{\n  \"inspectJob\": {\n    \"storageConfig\": {\n      \"bigQueryOptions\": {\n        \"tableReference\": {\n          \"projectId\": \"PROJECT_ID\",\n          \"datasetId\": \"customer_data\",\n          \"tableId\": \"transactions\"\n        },\n        \"sampleMethod\": \"RANDOM_START\",\n        \"rowsLimit\": 10000\n      }\n    },\n    \"inspectConfig\": {\n      \"infoTypes\": [\n        {\"name\": \"CREDIT_CARD_NUMBER\"},\n        {\"name\": \"US_SOCIAL_SECURITY_NUMBER\"},\n        {\"name\": \"EMAIL_ADDRESS\"},\n        {\"name\": \"PHONE_NUMBER\"},\n        {\"name\": \"PERSON_NAME\"}\n      ],\n      \"minLikelihood\": \"LIKELY\",\n      \"limits\": {\"maxFindingsPerRequest\": 1000}\n    },\n    \"actions\": [{\n      \"saveFindings\": {\n        \"outputConfig\": {\n          \"table\": {\n            \"projectId\": \"PROJECT_ID\",\n            \"datasetId\": \"dlp_results\",\n            \"tableId\": \"findings\"\n          }\n        }\n      }\n    }]\n  }\n}\nEOF\n\ngcloud dlp jobs create --project=PROJECT_ID --body-from-file=dlp-job.json\n```\n\n### Step 3: Implement Data De-identification with Cloud DLP\n\nConfigure de-identification transforms to mask, tokenize, or redact sensitive data.\n\n```python\n# deidentify_pipeline.py - De-identify sensitive data using Google Cloud DLP\nfrom google.cloud import dlp_v2\n\ndef deidentify_data(project_id, text):\n    \"\"\"De-identify PII in text using Cloud DLP.\"\"\"\n    client = dlp_v2.DlpServiceClient()\n\n    inspect_config = {\n        \"info_types\": [\n            {\"name\": \"EMAIL_ADDRESS\"},\n            {\"name\": \"PHONE_NUMBER\"},\n            {\"name\": \"CREDIT_CARD_NUMBER\"},\n            {\"name\": \"US_SOCIAL_SECURITY_NUMBER\"},\n        ],\n        \"min_likelihood\": dlp_v2.Likelihood.LIKELY,\n    }\n\n    deidentify_config = {\n        \"info_type_transformations\": {\n            \"transformations\": [\n                {\n                    \"info_types\": [{\"name\": \"EMAIL_ADDRESS\"}],\n                    \"primitive_transformation\": {\n                        \"character_mask_config\": {\n                            \"masking_character\": \"*\",\n                            \"number_to_mask\": 0,\n                            \"characters_to_ignore\": [\n                                {\"common_characters_to_ignore\": \"PUNCTUATION\"}\n                            ],\n                        }\n                    },\n                },\n                {\n                    \"info_types\": [{\"name\": \"CREDIT_CARD_NUMBER\"}],\n                    \"primitive_transformation\": {\n                        \"crypto_replace_ffx_fpe_config\": {\n                            \"crypto_key\": {\n                                \"kms_wrapped\": {\n                                    \"wrapped_key\": \"WRAPPED_KEY_BASE64\",\n                                    \"crypto_key_name\": \"projects\u002FPROJECT\u002Flocations\u002Fglobal\u002FkeyRings\u002Fdlp\u002FcryptoKeys\u002Ftokenization\",\n                                }\n                            },\n                            \"common_alphabet\": \"NUMERIC\",\n                        }\n                    },\n                },\n                {\n                    \"info_types\": [{\"name\": \"US_SOCIAL_SECURITY_NUMBER\"}],\n                    \"primitive_transformation\": {\n                        \"redact_config\": {}\n                    },\n                },\n            ]\n        }\n    }\n\n    item = {\"value\": text}\n    parent = f\"projects\u002F{project_id}\u002Flocations\u002Fglobal\"\n\n    response = client.deidentify_content(\n        request={\n            \"parent\": parent,\n            \"deidentify_config\": deidentify_config,\n            \"inspect_config\": inspect_config,\n            \"item\": item,\n        }\n    )\n    return response.item.value\n```\n\n### Step 4: Configure Azure Information Protection\n\nSet up sensitivity labels and DLP policies in Microsoft Purview for Azure resources.\n\n```powershell\n# Connect to Microsoft Purview compliance\nConnect-IPPSSession\n\n# Create sensitivity labels\nNew-Label -DisplayName \"Confidential - PII\" \\\n  -Name \"Confidential-PII\" \\\n  -Tooltip \"Contains personally identifiable information\" \\\n  -ContentType \"File, Email\"\n\nNew-Label -DisplayName \"Highly Confidential - Financial\" \\\n  -Name \"HighlyConfidential-Financial\" \\\n  -Tooltip \"Contains financial data subject to PCI DSS\" \\\n  -ContentType \"File, Email\"\n\n# Create auto-labeling policy for Azure Storage\nNew-AutoSensitivityLabelPolicy -Name \"Auto-Label-PII\" \\\n  -ExchangeLocation All \\\n  -SharePointLocation All \\\n  -OneDriveLocation All \\\n  -Mode Enable\n\nNew-AutoSensitivityLabelRule -Policy \"Auto-Label-PII\" \\\n  -Name \"Detect-SSN\" \\\n  -ContentContainsSensitiveInformation @{\n    Name = \"U.S. Social Security Number (SSN)\";\n    MinCount = 1;\n    MinConfidence = 85\n  } \\\n  -ApplySensitivityLabel \"Confidential-PII\"\n```\n\n```bash\n# Azure: Configure DLP policy for Storage accounts\naz security assessment create \\\n  --name \"storage-sensitive-data\" \\\n  --assessed-resource-type \"Microsoft.Storage\u002FstorageAccounts\"\n\n# Enable Microsoft Defender for Storage with sensitive data threat detection\naz security pricing create --name StorageAccounts --tier standard \\\n  --subplan DefenderForStorageV2 \\\n  --extensions '[{\"name\":\"SensitiveDataDiscovery\",\"isEnabled\":\"True\"}]'\n```\n\n### Step 5: Integrate DLP into Data Pipelines\n\nAdd DLP scanning to ETL and data pipeline workflows to prevent sensitive data leakage.\n\n```python\n# pipeline_dlp_gate.py - DLP gate for data pipelines\nimport boto3\nimport json\n\nmacie_client = boto3.client('macie2')\ns3_client = boto3.client('s3')\n\ndef scan_pipeline_output(bucket, prefix):\n    \"\"\"Scan pipeline output data for sensitive content before promotion.\"\"\"\n    job_response = macie_client.create_classification_job(\n        jobType='ONE_TIME',\n        name=f'pipeline-scan-{prefix}',\n        s3JobDefinition={\n            'bucketDefinitions': [{\n                'accountId': boto3.client('sts').get_caller_identity()['Account'],\n                'buckets': [bucket]\n            }],\n            'scoping': {\n                'includes': {\n                    'and': [{\n                        'simpleScopeTerm': {\n                            'key': 'OBJECT_KEY',\n                            'comparator': 'STARTS_WITH',\n                            'values': [prefix]\n                        }\n                    }]\n                }\n            }\n        },\n        managedDataIdentifierSelector='ALL'\n    )\n\n    return job_response['jobId']\n\ndef check_scan_results(job_id):\n    \"\"\"Check if DLP scan found sensitive data.\"\"\"\n    response = macie_client.list_findings(\n        findingCriteria={\n            'criterion': {\n                'classificationDetails.jobId': {'eq': [job_id]},\n                'severity.description': {'eq': ['High', 'Critical']}\n            }\n        }\n    )\n    return len(response.get('findingIds', [])) > 0\n\ndef gate_decision(bucket, prefix):\n    \"\"\"DLP gate: block pipeline if sensitive data found.\"\"\"\n    job_id = scan_pipeline_output(bucket, prefix)\n    has_sensitive_data = check_scan_results(job_id)\n\n    if has_sensitive_data:\n        return {\n            'decision': 'BLOCK',\n            'reason': 'Sensitive data detected in pipeline output',\n            'action': 'Apply de-identification before promoting to production'\n        }\n    return {'decision': 'ALLOW', 'reason': 'No sensitive data detected'}\n```\n\n### Step 6: Monitor DLP Findings and Generate Reports\n\nAggregate DLP findings across cloud providers and generate compliance reports.\n\n```bash\n# Macie: Get finding statistics\naws macie2 get-finding-statistics \\\n  --group-by \"severity.description\" \\\n  --finding-criteria '{\"criterion\":{\"category\":{\"eq\":[\"CLASSIFICATION\"]}}}'\n\n# Macie: List findings by sensitivity type\naws macie2 list-findings \\\n  --finding-criteria '{\n    \"criterion\": {\n      \"classificationDetails.result.sensitiveData.category\": {\"eq\": [\"PERSONAL_INFORMATION\"]},\n      \"severity.description\": {\"eq\": [\"High\"]}\n    }\n  }' \\\n  --sort-criteria '{\"attributeName\": \"updatedAt\", \"orderBy\": \"DESC\"}'\n\n# GCP DLP: List job results\ngcloud dlp jobs list --project=PROJECT_ID --filter=\"state=DONE\" \\\n  --format=\"table(name, createTime, inspectDetails.result.processedBytes, inspectDetails.result.totalEstimatedTransformations)\"\n\n# Export Macie findings to S3 for compliance reporting\naws macie2 create-findings-report \\\n  --finding-criteria '{\"criterion\":{\"category\":{\"eq\":[\"CLASSIFICATION\"]}}}' \\\n  --sort-criteria '{\"attributeName\":\"severity.score\",\"orderBy\":\"DESC\"}'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Data Loss Prevention | Security controls and technologies that detect and prevent unauthorized disclosure of sensitive data from cloud environments |\n| Amazon Macie | AWS service using machine learning to discover, classify, and protect sensitive data stored in S3 buckets |\n| Google Cloud DLP | GCP API for inspecting, classifying, and de-identifying sensitive data across Cloud Storage, BigQuery, and Datastore |\n| Data De-identification | Transforming sensitive data using masking, tokenization, encryption, or redaction to remove identifying characteristics while preserving utility |\n| Sensitivity Label | Classification tag applied to data (Confidential, Highly Confidential) that triggers DLP policy enforcement and access controls |\n| Custom Data Identifier | Organization-specific pattern (regex or keyword) added to DLP services to detect proprietary sensitive data formats |\n\n## Tools & Systems\n\n- **Amazon Macie**: ML-powered sensitive data discovery and classification for S3 with automated finding generation\n- **Google Cloud DLP API**: Programmable API for inspecting, classifying, de-identifying, and redacting sensitive data\n- **Microsoft Purview**: Data governance platform with sensitivity labeling, auto-classification, and DLP policy enforcement\n- **Azure Information Protection**: Data classification and labeling service integrated with Microsoft 365 and Azure storage\n- **Nightfall AI**: Third-party cloud DLP tool supporting scanning across SaaS applications and cloud infrastructure\n\n## Common Scenarios\n\n### Scenario: Discovering PII in an Unprotected S3 Data Lake\n\n**Context**: A compliance audit reveals that the analytics team's S3 data lake contains customer PII (names, emails, SSNs) in CSV files without encryption or access controls. The organization must classify all data and implement DLP controls.\n\n**Approach**:\n1. Enable Macie and create a one-time classification job against the data lake bucket\n2. Review Macie findings to identify which objects contain PII and what types\n3. Create custom data identifiers for organization-specific formats (employee IDs, account numbers)\n4. Implement a weekly scheduled Macie job for ongoing discovery\n5. Build a data pipeline gate that scans new data before promotion to the data lake\n6. Apply de-identification transforms (masking SSNs, tokenizing emails) for analytics use cases\n7. Configure S3 bucket policies to restrict access to classified data to authorized roles only\n\n**Pitfalls**: Macie charges per GB scanned. Large data lakes can generate significant costs. Use scoping rules to focus on high-risk object types (CSV, JSON, Parquet) and exclude known-safe formats (compressed archives, binary files). De-identification must preserve data utility for analytics while removing re-identification risk.\n\n## Output Format\n\n```\nCloud DLP Compliance Report\n==============================\nOrganization: Acme Corp\nScan Period: 2026-02-01 to 2026-02-23\nEnvironments: AWS (12 buckets), GCP (3 datasets), Azure (5 storage accounts)\n\nDATA DISCOVERY SUMMARY:\n  Total objects\u002Frecords scanned:    2,847,000\n  Objects with sensitive data:        45,200 (1.6%)\n  Unique sensitivity categories:      8\n\nSENSITIVE DATA FINDINGS:\n  PII (names, emails, phone):       23,400 objects\n  Financial (credit cards, bank):     8,700 objects\n  Health (PHI, medical records):      3,200 objects\n  Credentials (API keys, tokens):     1,400 objects\n  Government ID (SSN, passport):      5,800 objects\n  Custom (employee ID, account):      2,700 objects\n\nFINDINGS BY SEVERITY:\n  Critical:    1,400 (exposed credentials)\n  High:       14,200 (unprotected PII\u002FPHI)\n  Medium:     18,600 (standard PII)\n  Low:        11,000 (non-sensitive patterns)\n\nPROTECTION STATUS:\n  Data with encryption at rest:       78%\n  Data with access controls:          65%\n  Data with sensitivity labels:       12%\n  Pipeline data with DLP gates:       30%\n\nREMEDIATION ACTIONS:\n  Objects quarantined:                1,400\n  De-identification applied:          8,200\n  Access controls tightened:         14,200\n  Sensitivity labels applied:        45,200\n```\n","# Implementing Cloud DLP for Data Protection\n\n## When to Use\n\n- When compliance frameworks (GDPR, HIPAA, PCI DSS) require automated sensitive data discovery and protection\n- When building data governance programs that classify and label data across cloud storage\n- When implementing data loss prevention controls for cloud-based data pipelines\n- When auditing cloud environments for unprotected sensitive data (PII, PHI, financial data)\n- When integrating DLP scanning into CI\u002FCD pipelines to prevent sensitive data from reaching production\n\n**Do not use** for endpoint DLP (use Microsoft Purview or Symantec DLP agents), for email DLP (use Microsoft 365 DLP or Google Workspace DLP), or for network-level data exfiltration prevention (use VPC endpoint policies and network firewalls).\n\n## Prerequisites\n\n- Amazon Macie enabled with appropriate S3 bucket permissions\n- Google Cloud DLP API enabled (`gcloud services enable dlp.googleapis.com`)\n- Azure Information Protection or Microsoft Purview configured\n- IAM permissions for DLP service administration and data access\n- Knowledge of data sensitivity categories relevant to the organization (PII, PHI, PCI, proprietary)\n\n## Workflow\n\n### Step 1: Deploy Amazon Macie for S3 Data Discovery\n\nEnable Macie and configure automated sensitive data discovery jobs for S3 buckets.\n\n```bash\n# Enable Amazon Macie\naws macie2 enable-macie\n\n# List all S3 buckets Macie can scan\naws macie2 describe-buckets \\\n  --query 'buckets[*].[bucketName,classifiableSizeInBytes,unclassifiableObjectCount.total]' \\\n  --output table\n\n# Create a classification job for specific buckets\naws macie2 create-classification-job \\\n  --job-type SCHEDULED \\\n  --name \"weekly-pii-scan\" \\\n  --schedule-frequency-details '{\"weekly\":{\"dayOfWeek\":\"MONDAY\"}}' \\\n  --s3-job-definition '{\n    \"bucketDefinitions\": [{\n      \"accountId\": \"ACCOUNT_ID\",\n      \"buckets\": [\"customer-data-bucket\", \"analytics-data-lake\", \"backup-bucket\"]\n    }],\n    \"scoping\": {\n      \"includes\": {\n        \"and\": [{\n          \"simpleScopeTerm\": {\n            \"key\": \"OBJECT_EXTENSION\",\n            \"values\": [\"csv\", \"json\", \"parquet\", \"txt\", \"xlsx\"],\n            \"comparator\": \"EQ\"\n          }\n        }]\n      }\n    }\n  }' \\\n  --managed-data-identifier-ids '[\"SSN\",\"CREDIT_CARD_NUMBER\",\"EMAIL_ADDRESS\",\"AWS_CREDENTIALS\",\"PHONE_NUMBER\"]'\n\n# Create custom data identifier for internal employee IDs\naws macie2 create-custom-data-identifier \\\n  --name \"EmployeeID\" \\\n  --regex \"EMP-[0-9]{6}\" \\\n  --description \"Internal employee ID format\"\n\n# Check job status and results\naws macie2 list-classification-jobs \\\n  --query 'items[*].[name,jobStatus,statistics.approximateNumberOfObjectsToProcess]' \\\n  --output table\n```\n\n### Step 2: Configure Google Cloud DLP API for Data Inspection\n\nUse Google Cloud DLP to inspect and de-identify sensitive data across GCP resources.\n\n```bash\n# Inspect a Cloud Storage bucket for sensitive data\ngcloud dlp inspect-content \\\n  --content-type=TEXT_PLAIN \\\n  --min-likelihood=LIKELY \\\n  --info-types=PHONE_NUMBER,EMAIL_ADDRESS,CREDIT_CARD_NUMBER,US_SOCIAL_SECURITY_NUMBER \\\n  --storage-type=CLOUD_STORAGE \\\n  --gcs-uri=\"gs:\u002F\u002Fsensitive-data-bucket\u002Fdata\u002F*.csv\"\n\n# Create an inspection job for BigQuery\ncat > dlp-job.json \u003C\u003C 'EOF'\n{\n  \"inspectJob\": {\n    \"storageConfig\": {\n      \"bigQueryOptions\": {\n        \"tableReference\": {\n          \"projectId\": \"PROJECT_ID\",\n          \"datasetId\": \"customer_data\",\n          \"tableId\": \"transactions\"\n        },\n        \"sampleMethod\": \"RANDOM_START\",\n        \"rowsLimit\": 10000\n      }\n    },\n    \"inspectConfig\": {\n      \"infoTypes\": [\n        {\"name\": \"CREDIT_CARD_NUMBER\"},\n        {\"name\": \"US_SOCIAL_SECURITY_NUMBER\"},\n        {\"name\": \"EMAIL_ADDRESS\"},\n        {\"name\": \"PHONE_NUMBER\"},\n        {\"name\": \"PERSON_NAME\"}\n      ],\n      \"minLikelihood\": \"LIKELY\",\n      \"limits\": {\"maxFindingsPerRequest\": 1000}\n    },\n    \"actions\": [{\n      \"saveFindings\": {\n        \"outputConfig\": {\n          \"table\": {\n            \"projectId\": \"PROJECT_ID\",\n            \"datasetId\": \"dlp_results\",\n            \"tableId\": \"findings\"\n          }\n        }\n      }\n    }]\n  }\n}\nEOF\n\ngcloud dlp jobs create --project=PROJECT_ID --body-from-file=dlp-job.json\n```\n\n### Step 3: Implement Data De-identification with Cloud DLP\n\nConfigure de-identification transforms to mask, tokenize, or redact sensitive data.\n\n```python\n# deidentify_pipeline.py - De-identify sensitive data using Google Cloud DLP\nfrom google.cloud import dlp_v2\n\ndef deidentify_data(project_id, text):\n    \"\"\"De-identify PII in text using Cloud DLP.\"\"\"\n    client = dlp_v2.DlpServiceClient()\n\n    inspect_config = {\n        \"info_types\": [\n            {\"name\": \"EMAIL_ADDRESS\"},\n            {\"name\": \"PHONE_NUMBER\"},\n            {\"name\": \"CREDIT_CARD_NUMBER\"},\n            {\"name\": \"US_SOCIAL_SECURITY_NUMBER\"},\n        ],\n        \"min_likelihood\": dlp_v2.Likelihood.LIKELY,\n    }\n\n    deidentify_config = {\n        \"info_type_transformations\": {\n            \"transformations\": [\n                {\n                    \"info_types\": [{\"name\": \"EMAIL_ADDRESS\"}],\n                    \"primitive_transformation\": {\n                        \"character_mask_config\": {\n                            \"masking_character\": \"*\",\n                            \"number_to_mask\": 0,\n                            \"characters_to_ignore\": [\n                                {\"common_characters_to_ignore\": \"PUNCTUATION\"}\n                            ],\n                        }\n                    },\n                },\n                {\n                    \"info_types\": [{\"name\": \"CREDIT_CARD_NUMBER\"}],\n                    \"primitive_transformation\": {\n                        \"crypto_replace_ffx_fpe_config\": {\n                            \"crypto_key\": {\n                                \"kms_wrapped\": {\n                                    \"wrapped_key\": \"WRAPPED_KEY_BASE64\",\n                                    \"crypto_key_name\": \"projects\u002FPROJECT\u002Flocations\u002Fglobal\u002FkeyRings\u002Fdlp\u002FcryptoKeys\u002Ftokenization\",\n                                }\n                            },\n                            \"common_alphabet\": \"NUMERIC\",\n                        }\n                    },\n                },\n                {\n                    \"info_types\": [{\"name\": \"US_SOCIAL_SECURITY_NUMBER\"}],\n                    \"primitive_transformation\": {\n                        \"redact_config\": {}\n                    },\n                },\n            ]\n        }\n    }\n\n    item = {\"value\": text}\n    parent = f\"projects\u002F{project_id}\u002Flocations\u002Fglobal\"\n\n    response = client.deidentify_content(\n        request={\n            \"parent\": parent,\n            \"deidentify_config\": deidentify_config,\n            \"inspect_config\": inspect_config,\n            \"item\": item,\n        }\n    )\n    return response.item.value\n```\n\n### Step 4: Configure Azure Information Protection\n\nSet up sensitivity labels and DLP policies in Microsoft Purview for Azure resources.\n\n```powershell\n# Connect to Microsoft Purview compliance\nConnect-IPPSSession\n\n# Create sensitivity labels\nNew-Label -DisplayName \"Confidential - PII\" \\\n  -Name \"Confidential-PII\" \\\n  -Tooltip \"Contains personally identifiable information\" \\\n  -ContentType \"File, Email\"\n\nNew-Label -DisplayName \"Highly Confidential - Financial\" \\\n  -Name \"HighlyConfidential-Financial\" \\\n  -Tooltip \"Contains financial data subject to PCI DSS\" \\\n  -ContentType \"File, Email\"\n\n# Create auto-labeling policy for Azure Storage\nNew-AutoSensitivityLabelPolicy -Name \"Auto-Label-PII\" \\\n  -ExchangeLocation All \\\n  -SharePointLocation All \\\n  -OneDriveLocation All \\\n  -Mode Enable\n\nNew-AutoSensitivityLabelRule -Policy \"Auto-Label-PII\" \\\n  -Name \"Detect-SSN\" \\\n  -ContentContainsSensitiveInformation @{\n    Name = \"U.S. Social Security Number (SSN)\";\n    MinCount = 1;\n    MinConfidence = 85\n  } \\\n  -ApplySensitivityLabel \"Confidential-PII\"\n```\n\n```bash\n# Azure: Configure DLP policy for Storage accounts\naz security assessment create \\\n  --name \"storage-sensitive-data\" \\\n  --assessed-resource-type \"Microsoft.Storage\u002FstorageAccounts\"\n\n# Enable Microsoft Defender for Storage with sensitive data threat detection\naz security pricing create --name StorageAccounts --tier standard \\\n  --subplan DefenderForStorageV2 \\\n  --extensions '[{\"name\":\"SensitiveDataDiscovery\",\"isEnabled\":\"True\"}]'\n```\n\n### Step 5: Integrate DLP into Data Pipelines\n\nAdd DLP scanning to ETL and data pipeline workflows to prevent sensitive data leakage.\n\n```python\n# pipeline_dlp_gate.py - DLP gate for data pipelines\nimport boto3\nimport json\n\nmacie_client = boto3.client('macie2')\ns3_client = boto3.client('s3')\n\ndef scan_pipeline_output(bucket, prefix):\n    \"\"\"Scan pipeline output data for sensitive content before promotion.\"\"\"\n    job_response = macie_client.create_classification_job(\n        jobType='ONE_TIME',\n        name=f'pipeline-scan-{prefix}',\n        s3JobDefinition={\n            'bucketDefinitions': [{\n                'accountId': boto3.client('sts').get_caller_identity()['Account'],\n                'buckets': [bucket]\n            }],\n            'scoping': {\n                'includes': {\n                    'and': [{\n                        'simpleScopeTerm': {\n                            'key': 'OBJECT_KEY',\n                            'comparator': 'STARTS_WITH',\n                            'values': [prefix]\n                        }\n                    }]\n                }\n            }\n        },\n        managedDataIdentifierSelector='ALL'\n    )\n\n    return job_response['jobId']\n\ndef check_scan_results(job_id):\n    \"\"\"Check if DLP scan found sensitive data.\"\"\"\n    response = macie_client.list_findings(\n        findingCriteria={\n            'criterion': {\n                'classificationDetails.jobId': {'eq': [job_id]},\n                'severity.description': {'eq': ['High', 'Critical']}\n            }\n        }\n    )\n    return len(response.get('findingIds', [])) > 0\n\ndef gate_decision(bucket, prefix):\n    \"\"\"DLP gate: block pipeline if sensitive data found.\"\"\"\n    job_id = scan_pipeline_output(bucket, prefix)\n    has_sensitive_data = check_scan_results(job_id)\n\n    if has_sensitive_data:\n        return {\n            'decision': 'BLOCK',\n            'reason': 'Sensitive data detected in pipeline output',\n            'action': 'Apply de-identification before promoting to production'\n        }\n    return {'decision': 'ALLOW', 'reason': 'No sensitive data detected'}\n```\n\n### Step 6: Monitor DLP Findings and Generate Reports\n\nAggregate DLP findings across cloud providers and generate compliance reports.\n\n```bash\n# Macie: Get finding statistics\naws macie2 get-finding-statistics \\\n  --group-by \"severity.description\" \\\n  --finding-criteria '{\"criterion\":{\"category\":{\"eq\":[\"CLASSIFICATION\"]}}}'\n\n# Macie: List findings by sensitivity type\naws macie2 list-findings \\\n  --finding-criteria '{\n    \"criterion\": {\n      \"classificationDetails.result.sensitiveData.category\": {\"eq\": [\"PERSONAL_INFORMATION\"]},\n      \"severity.description\": {\"eq\": [\"High\"]}\n    }\n  }' \\\n  --sort-criteria '{\"attributeName\": \"updatedAt\", \"orderBy\": \"DESC\"}'\n\n# GCP DLP: List job results\ngcloud dlp jobs list --project=PROJECT_ID --filter=\"state=DONE\" \\\n  --format=\"table(name, createTime, inspectDetails.result.processedBytes, inspectDetails.result.totalEstimatedTransformations)\"\n\n# Export Macie findings to S3 for compliance reporting\naws macie2 create-findings-report \\\n  --finding-criteria '{\"criterion\":{\"category\":{\"eq\":[\"CLASSIFICATION\"]}}}' \\\n  --sort-criteria '{\"attributeName\":\"severity.score\",\"orderBy\":\"DESC\"}'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Data Loss Prevention | Security controls and technologies that detect and prevent unauthorized disclosure of sensitive data from cloud environments |\n| Amazon Macie | AWS service using machine learning to discover, classify, and protect sensitive data stored in S3 buckets |\n| Google Cloud DLP | GCP API for inspecting, classifying, and de-identifying sensitive data across Cloud Storage, BigQuery, and Datastore |\n| Data De-identification | Transforming sensitive data using masking, tokenization, encryption, or redaction to remove identifying characteristics while preserving utility |\n| Sensitivity Label | Classification tag applied to data (Confidential, Highly Confidential) that triggers DLP policy enforcement and access controls |\n| Custom Data Identifier | Organization-specific pattern (regex or keyword) added to DLP services to detect proprietary sensitive data formats |\n\n## Tools & Systems\n\n- **Amazon Macie**: ML-powered sensitive data discovery and classification for S3 with automated finding generation\n- **Google Cloud DLP API**: Programmable API for inspecting, classifying, de-identifying, and redacting sensitive data\n- **Microsoft Purview**: Data governance platform with sensitivity labeling, auto-classification, and DLP policy enforcement\n- **Azure Information Protection**: Data classification and labeling service integrated with Microsoft 365 and Azure storage\n- **Nightfall AI**: Third-party cloud DLP tool supporting scanning across SaaS applications and cloud infrastructure\n\n## Common Scenarios\n\n### Scenario: Discovering PII in an Unprotected S3 Data Lake\n\n**Context**: A compliance audit reveals that the analytics team's S3 data lake contains customer PII (names, emails, SSNs) in CSV files without encryption or access controls. The organization must classify all data and implement DLP controls.\n\n**Approach**:\n1. Enable Macie and create a one-time classification job against the data lake bucket\n2. Review Macie findings to identify which objects contain PII and what types\n3. Create custom data identifiers for organization-specific formats (employee IDs, account numbers)\n4. Implement a weekly scheduled Macie job for ongoing discovery\n5. Build a data pipeline gate that scans new data before promotion to the data lake\n6. Apply de-identification transforms (masking SSNs, tokenizing emails) for analytics use cases\n7. Configure S3 bucket policies to restrict access to classified data to authorized roles only\n\n**Pitfalls**: Macie charges per GB scanned. Large data lakes can generate significant costs. Use scoping rules to focus on high-risk object types (CSV, JSON, Parquet) and exclude known-safe formats (compressed archives, binary files). De-identification must preserve data utility for analytics while removing re-identification risk.\n\n## Output Format\n\n```\nCloud DLP Compliance Report\n==============================\nOrganization: Acme Corp\nScan Period: 2026-02-01 to 2026-02-23\nEnvironments: AWS (12 buckets), GCP (3 datasets), Azure (5 storage accounts)\n\nDATA DISCOVERY SUMMARY:\n  Total objects\u002Frecords scanned:    2,847,000\n  Objects with sensitive data:        45,200 (1.6%)\n  Unique sensitivity categories:      8\n\nSENSITIVE DATA FINDINGS:\n  PII (names, emails, phone):       23,400 objects\n  Financial (credit cards, bank):     8,700 objects\n  Health (PHI, medical records):      3,200 objects\n  Credentials (API keys, tokens):     1,400 objects\n  Government ID (SSN, passport):      5,800 objects\n  Custom (employee ID, account):      2,700 objects\n\nFINDINGS BY SEVERITY:\n  Critical:    1,400 (exposed credentials)\n  High:       14,200 (unprotected PII\u002FPHI)\n  Medium:     18,600 (standard PII)\n  Low:        11,000 (non-sensitive patterns)\n\nPROTECTION STATUS:\n  Data with encryption at rest:       78%\n  Data with access controls:          65%\n  Data with sensitivity labels:       12%\n  Pipeline data with DLP gates:       30%\n\nREMEDIATION ACTIONS:\n  Objects quarantined:                1,400\n  De-identification applied:          8,200\n  Access controls tightened:         14,200\n  Sensitivity labels applied:        45,200\n```\n",{"name":5,"tags":25,"author":32,"domain":33,"license":15,"version":34,"nist_csf":35,"subdomain":26,"description":40,"nist_ai_rmf":41,"mitre_attack":47,"atlas_techniques":52},[26,27,28,29,30,31],"cloud-security","dlp","data-protection","macie","data-classification","privacy","mahipal","cybersecurity","1.0",[36,37,38,39],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","Implement cloud DLP using Amazon Macie, Google Cloud DLP API, Microsoft Purview, Azure Information Protection, and Nightfall AI to discover, classify, label, de-identify, and protect sensitive data (PII, PHI, financial data) across cloud storage, databases, and pipelines. Use for GDPR\u002FHIPAA\u002FPCI DSS data-discovery, cloud data governance, or CI\u002FCD DLP scanning; not for endpoint, email, or network-level DLP.\n",[42,43,44,45,46],"MEASURE-2.7","MAP-5.1","MANAGE-2.4","MEASURE-2.8","MEASURE-2.9",[48,49,50,51],"T1078.004","T1530","T1537","T1580",[53,54,55],"AML.T0070","AML.T0066","AML.T0082","main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","collections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-dlp-for-data-protection",{"tool":70,"command":71},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-dlp-for-data-protection",{"tool":73,"command":74},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill implementing-cloud-dlp-for-data-protection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection\u002FSKILL.md",true,[78,82,88],{"path":79,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fapi-reference.md","REFERENCE","参考文档",2179,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection\u002Freferences\u002Fapi-reference.md",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"scripts\u002Fagent.py","SCRIPT","脚本",7377,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fimplementing-cloud-dlp-for-data-protection\u002Fscripts\u002Fagent.py",[95,103,111,119,127,134],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":20},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":123,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":20},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":20},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":138,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":20},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]