Create file policies with DLP content inspection, configure automatic sensitivity labeling across connected SaaS apps, set up alert workflows for policy violations, build compliance dashboards, and generate auditor-ready compliance reports.
Data Loss Prevention (DLP) in Defender for Cloud Apps extends your organisation’s data protection capabilities to SaaS applications beyond Microsoft 365. By creating file policies with content inspection, you can detect sensitive data stored in connected cloud apps, automatically apply sensitivity labels, quarantine files, and generate compliance reports. This lab covers building a comprehensive cloud DLP strategy that protects data across Microsoft 365, Box, Salesforce, and other connected SaaS platforms.
A healthcare organisation must comply with HIPAA regulations across all cloud platforms. They discover 2,300 files containing Protected Health Information (PHI) stored in SharePoint, Box, and Salesforce. many shared externally. They need automated DLP scanning across all connected SaaS apps, auto-labeling for files containing PHI, quarantine capability for critically exposed files, and monthly compliance reports demonstrating DLP coverage and remediation progress.
File policies in MDA scan files stored in connected SaaS apps using content inspection engines. They can detect sensitive information types (SITs), apply governance actions, and generate alerts.
Detect Credit Card Numbers in Cloud FilesCreate custom patterns to detect industry-specific data like patient IDs, internal project codes, or proprietary data formats.
PAT-\d{6}-[A-Z]{2})# ---------------------------------------------------------------
# PURPOSE: Create a custom sensitive information type (SIT) in
# Microsoft Purview using an XML rule package.
# WHY: Built-in SITs cover common data (SSN, credit cards), but
# organisations often have industry-specific data formats
# (patient IDs, internal project codes, account numbers) that
# need custom regex patterns for accurate DLP detection.
# HOW IT WORKS:
# 1. Connect to the Purview compliance PowerShell session
# 2. Define an XML rule package containing:
# - A regex pattern (PAT-\d{6}-[A-Z]{2}) matching your data format
# - A confidence level (85%) = high confidence match
# - patternsProximity (300 chars) = how close supporting evidence must be
# 3. Upload the rule package to Purview
# OUTPUT: The custom SIT becomes available in DLP policies, file
# policies, and auto-labeling rules within ~1 hour.
# EXAMPLE MATCHES: PAT-123456-AB, PAT-000001-ZZ, PAT-999999-XY
# ---------------------------------------------------------------
Connect-IPPSSession # Connect to Purview compliance PowerShell
# Define the XML rule package. Each GUID must be unique per rule package.
$ruleXml = @"
<RulePackage xmlns="http://schemas.microsoft.com/office/2011/mce">
<RulePack id="$(New-Guid)">
<Version major="1" minor="0" build="0" revision="0"/>
<Publisher id="$(New-Guid)"/>
</RulePack>
<Rules>
<Entity id="$(New-Guid)" patternsProximity="300" recommendedConfidence="85">
<Pattern confidenceLevel="85">
<IdMatch idRef="PatientId"/>
</Pattern>
</Entity>
<Regex id="PatientId">PAT-\d{6}-[A-Z]{2}</Regex>
<LocalizedStrings>
<Resource idRef="PatientId">
<Name default="true" langcode="en-us">Patient ID</Name>
</Resource>
</LocalizedStrings>
</Rules>
</RulePackage>
"@
# Upload the XML rule package to Purview. The -FileData parameter
# expects a byte array, so we convert the XML string to UTF-8 bytes.
New-DlpSensitiveInformationTypeRulePackage -FileData ([System.Text.Encoding]::UTF8.GetBytes($ruleXml))Block External Sharing of Sensitive FilesCreate targeted policies for specific SaaS apps with app-specific governance actions.
Unify your DLP policies by leveraging Microsoft Purview’s Data Classification Service within MDA file policies.
Define the progression from initial DLP deployment to a mature, enterprise-wide data protection program.
| Resource | Description |
|---|---|
| File policies in Defender for Cloud Apps | Create and manage file policies for data protection |
| Content inspection | Configure DLP content inspection methods and sensitive info types |
| Admin quarantine | Set up admin quarantine for DLP-matched files |
| Sensitivity label integration | Apply sensitivity labels via MDA governance actions |