Purview Data Loss Prevention (DLP): Credit Cards & PII
Design and implement Microsoft Purview Data Loss Prevention (DLP) policies to detect, restrict, and block sensitive financial, healthcare, and PII data.
Overview
Microsoft Purview Data Loss Prevention (DLP) identifies, monitors, and automatically protects sensitive information across Microsoft 365 services—including Exchange Online, SharePoint Online, OneDrive for Business, Microsoft Teams, and Windows/macOS Endpoints.
The engine operates using:
- Sensitive Information Types (SITs): Built-in and custom pattern matchers based on regular expressions, checksum algorithms, and keyword proximity (e.g., Credit Card Numbers, US/EU Social Security Numbers, Passports).
- Policy Tips: Real-time user educational banners in Outlook, Word, Excel, and Teams informing users that their content violates corporate policy before they click send.
- Automated Enforcement: Blocks external sharing, restricts access to files, applies encryption, and notifies compliance officers of critical policy violations.
---
When to Use: Core Policy Archetypes
| Target Data Type | Workload | Action / Enforcement |
|---|---|---|
| Credit Card Numbers / Financial Info | Exchange Online & Teams | Block external recipients; show policy tip with business justification override. |
| Personally Identifiable Information (PII) | OneDrive & SharePoint | Restrict external sharing; permit internal collaboration. |
| Source Code / Confidential IP | Windows Endpoints (Endpoint DLP) | Block copying to USB drives, unapproved cloud browsers, or network shares. |
---
Prerequisites
Licensing:
- Microsoft 365 E5 or Microsoft 365 E5 Compliance (for full multi-workload and Endpoint DLP).
- Microsoft 365 E3 (includes basic DLP for Exchange, SharePoint, and OneDrive).
Administrative Roles:
- Compliance Administrator or DLP Compliance Management role in the Microsoft Purview portal (
purview.microsoft.com).
---
Portal Path
Microsoft Purview Portal (https://purview.microsoft.com)
└── Data loss prevention
├── Policies (Create, edit, manage state: Test / Turn on)
├── Alerts (Investigate active high-volume leak alerts)
└── Classifiers
└── Sensitive info types (View built-in SIT definitions)---
Step-by-Step Implementation
Step 1: Create a Financial Data DLP Policy
- Sign in to Microsoft Purview portal (
purview.microsoft.com) > Data loss prevention > Policies. - Click Create policy.
- Choose category: Financial > Template: U.S. Financial Data (or Financial Data containing Credit Card Number, ABA Routing, and Account Numbers).
- Name:
DLP-FinancialData-Protect-External.
Step 2: Select Locations & Workloads
Under Locations, toggle on:
Exchange emailSharePoint sitesOneDrive accountsTeams chat and channel messagesDevices(Endpoint DLP)
Step 3: Define Policy Rules (Low vs High Volume)
- Configure High volume of content detected (10 or more instances):
- Condition: Content contains
Credit Card Number(Count: 10 to Any). - Recipient condition: Recipient is located
External to the organization. - Action: Block people from sharing and restrict access to shared content > Select
Block everyone. - User notifications: Check Notify users in Office 365 service with a policy tip.
- User overrides:
Do not allow overrides(High volume indicates bulk data exfiltration). - Incident reports: Send high-severity alert to compliance mailbox (
compliance-alerts@contoso.com).
- Configure Low volume rule (1 to 9 instances):
- Allow user override with Business justification required.
Step 4: Staging Mode (Test with Notifications)
- Under Policy mode, select Run the policy in simulation mode > Check Show policy tips while in simulation mode.
- Run in simulation for 14 days to observe legitimate business workflows before switching policy to Turn it on immediately.
---
PowerShell Automation
Connect to Security & Compliance PowerShell:
Connect-IPPSSession -UserPrincipalName admin@contoso.com
# Query all Purview DLP policies and their operational states
Get-DlpCompliancePolicy | Select-Object Name, Mode, Workload, Enabled
# Inspect individual DLP rules and sensitive information types
Get-DlpComplianceRule -Policy "DLP-FinancialData-Protect-External" |
Select-Object Name, Comment, BlockAccess, Severity---
Microsoft Graph Automation
Query DLP Incident Alerts via Microsoft Graph:
Connect-MgGraph -Scopes "SecurityAlert.Read.All"
# List active high-severity DLP alerts generated across all workloads
Get-MgSecurityAlert_v2 -Filter "category eq 'DataLossPrevention'" -Top 5 |
Select-Object id, title, severity, status, createdDateTime---
Verification Checklist
Diagnostic Logs & Channels
| Tool / Location | Path | Purpose |
|---|---|---|
| Purview Activity Explorer | Data loss prevention > Activity explorer | Granular audit trail capturing every DLP match, file copy, print event, and email send. |
| DLP Alerts Dashboard | Data loss prevention > Alerts | Incident triage portal displaying user, matched SIT, confidence level, and surrounding text metadata. |
---
Troubleshooting Matrix
| Error Code / Symptom | Root Cause | Exact Resolution |
|---|---|---|
| Policy tip not showing in Outlook | Outlook desktop cached old policy; policy propagation takes up to 24 hours. | Force policy sync by restarting Outlook or test via Outlook on the Web (OWA). |
| False positive on 16-digit order numbers | Number matched credit card regex but lacked checksum validation. | Increase Confidence level in the SIT to High (requires Luhn checksum validation). |
| Endpoint DLP blocks local copying | Device was targeted by device policy without excluding approved software paths. | Configure Endpoint DLP settings in Purview to exclude approved enterprise tools. |
---
Production Best Practices
Always Start in Simulation Mode:
Deploying a DLP policy directly in "Enforce / Block" mode on day one can halt critical business operations. Always run in Simulation Mode with Policy Tips for 2–3 weeks to educate users and identify legitimate business processes that require overrides.
---
MS-102 Exam Notes
High-Frequency Exam Objectives & Traps:
- DLP Workloads: Microsoft Purview DLP covers Exchange, SharePoint, OneDrive, Teams, Windows/macOS endpoints, PowerBI, and non-Microsoft cloud apps via Defender for Cloud Apps.
- Luhn Algorithm: Credit card sensitive info types validate using the Luhn checksum algorithm; random 16-digit numbers will fail validation if confidence is set to High.
- Policy Precedence: When multiple rules match in a single DLP policy, the rule with the most restrictive action or highest priority takes precedence.
---