Compliance, DLP & Sensitivity Labels
📦 Module: 6 of 7
🎯 Exam: MS-102
⏱ Read time: ~24 min
MS-102 Exam Alignment
MS-102
- Know that sensitivity labels applied to SharePoint sites control external sharing capability, access from unmanaged devices, and private channel access for Microsoft Teams — separate from labels applied to files
- Know that retention policies on SharePoint preserve content for a minimum period and/or delete content after a maximum period — applied at the site or library level from the Microsoft Purview compliance portal
- Know that SharePoint DLP policies detect and protect sensitive information in documents stored in SharePoint and OneDrive
- Know that SharePoint audit logs are accessed from the Microsoft Purview compliance portal (not the SharePoint admin center)
🏷️ Sensitivity Labels on SharePoint Sites
Sensitivity labels applied to SharePoint sites (and the backing M365 Groups) are called container labels — they control the site’s security settings, not individual file content.
| Site Label Setting | What It Controls |
|---|---|
| Privacy | Public (anyone in org can find and join) or Private (only invited members can access). Overrides the Teams/Group privacy setting |
| External user access | Controls whether guests can be added to the M365 Group and site — Allow or Block external users |
| External sharing | Controls the site’s maximum external sharing level — Anyone, New and existing guests, Existing guests, or Only org. Overrides per-site sharing settings |
| Unmanaged device access | Allow full access from unmanaged devices, allow limited web-only access, or block access from devices not enrolled in Intune or not hybrid joined |
| Teams settings | Control private channel creation, shared channel creation, and channel meeting recording for the backing Teams team |
💡 Applying Sensitivity Labels to Sites
Sensitivity labels must be enabled for M365 Groups and SharePoint sites by running Set-SPOTenant -EnableAIPIntegration $true. Once enabled, site owners can apply labels from Site Settings → Site information → Sensitivity, or admins can apply via PowerShell. The label’s configured policies are enforced immediately on the site.
📋 Retention Policies on SharePoint
Retention policies ensure that SharePoint content is preserved for a minimum period and/or deleted after a maximum period. Configured in the Microsoft Purview compliance portal → Data lifecycle management → Retention policies.
| Concept | Description |
|---|---|
| Retain only | Keep content for a specified period. Content cannot be permanently deleted during the retention period — it’s preserved in the Preservation Hold library |
| Delete only | Automatically delete content after a specified period. No retention hold — just automated deletion for data minimisation |
| Retain then delete | Retain for a period (e.g., 5 years) then automatically delete at the end of the retention period |
| Preservation Hold library | A hidden library in each SharePoint site that stores copies of deleted or modified items during a retention period. Users cannot see or access it; compliance admins can via eDiscovery |
| Scope | Applied to: all SharePoint sites, specific site URLs, or OneDrive accounts. Can also target specific document libraries within a site using retention labels (not policies) |
🔒 SharePoint DLP Policies
Data Loss Prevention (DLP) policies detect documents containing sensitive information types stored in SharePoint and OneDrive, then take protective actions.
| DLP Action | Description |
|---|---|
| Show policy tip to user | Displays a notification to the user when they open or share a file containing sensitive info — educates without blocking |
| Send incident report to admin | Sends an email alert to the compliance team when a policy match is detected |
| Restrict access or encrypt content | Blocks sharing of the document externally or applies encryption. The most restrictive DLP action for SharePoint |
| Auditing only | Logs the detection without taking any action — used to assess scope before enforcing a policy |
📊 SharePoint Audit Logs
SharePoint audit events are captured in the Microsoft 365 unified audit log, accessible from Microsoft Purview compliance portal → Audit. The SharePoint admin center does not have its own audit log viewer.
| Logged Event Category | Examples |
|---|---|
| File activities | FileAccessed, FileDownloaded, FileModified, FileDeleted, FileMoved, FileUploaded |
| Sharing activities | SharingInvitationCreated, SharingLinkCreated, AnonymousLinkCreated, SharingRevoked |
| Permission activities | PermissionLevelAdded, SiteCollectionAdminAdded, SharingPermissionChanged |
| Site administration | SiteCreated, SiteDeleted, SiteLockedChange, StorageQuotaUpdated |
# Search unified audit log for SharePoint file downloads Connect-ExchangeOnline Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -RecordType SharePointFileOperation -Operations FileDownloaded | Select-Object CreationDate,UserIds,Operations,AuditData # Search for external sharing events in last 30 days Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) -RecordType SharePoint -Operations SharingInvitationCreated,AnonymousLinkCreated | Select-Object CreationDate,UserIds,AuditData # Check sensitivity label applied to a specific site Connect-SPOService -Url https://your-tenant-admin.sharepoint.com Get-SPOSite -Identity https://your-tenant.sharepoint.com/sites/HRSite | Select-Object Url,SensitivityLabel
💡 Best Practices
- Apply sensitivity labels to all SharePoint sites and M365 Groups — even if the label only sets privacy to “Private” and blocks unmanaged devices, it establishes a consistent governance baseline
- Target retention policies at specific site URLs for high-value content (HR, Finance, Legal) rather than all SharePoint — blanket retention on all sites creates storage costs
- Run DLP policies in simulation (audit) mode first for at least two weeks — this reveals how many documents match the policy and identifies false positives before enforcement blocks legitimate sharing
- Configure audit log retention for at least 1 year to support compliance investigations that surface months after an incident
🎓 Interview Q&A
A sensitivity label applied to a SharePoint site is configured to block external sharing. A site owner tries to change the site’s sharing setting to “Anyone.” What happens?
A user deletes a document from a SharePoint library that has a retention policy set to “Retain for 7 years.” Where does the document go?
Where are SharePoint Online audit logs accessed?
A DLP policy detects a SharePoint document containing credit card numbers that a user is trying to share externally. What is the recommended first action when deploying a new DLP policy?
What is the difference between a sensitivity label applied to a SharePoint site vs one applied to a file within that site?