Configuring DLP for SharePoint and OneDrive

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 9 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Implementing Data Loss Prevention (DLP) for SharePoint and OneDrive

Introduction: The Critical Need for Data Governance

In the modern digital workplace, information is the most valuable asset an organization possesses. Employees store, share, and collaborate on thousands of documents daily within Microsoft 365, particularly in SharePoint Online and OneDrive for Business. While this openness drives productivity, it also introduces significant risks regarding data exposure. If sensitive information—such as customer credit card numbers, health records, or proprietary intellectual property—is accidentally shared with unauthorized internal users or leaked to external parties, the consequences can be devastating. These consequences range from regulatory fines and legal liabilities to irreversible damage to an organization’s reputation.

Data Loss Prevention (DLP) is the practice of identifying, monitoring, and protecting sensitive data to ensure it is not used, shared, or accessed by unauthorized individuals. Within the Microsoft Purview ecosystem, DLP for SharePoint and OneDrive provides a centralized way to enforce security policies across your cloud storage environment. Instead of relying on individual users to manually categorize every document, Purview uses automated classification engines to scan content in real-time. By implementing these controls, you move from a reactive security posture—where you scramble to fix a leak after it happens—to a proactive stance where the system prevents the policy violation before the data leaves your control.

Understanding how to configure these policies effectively is not just a technical requirement; it is a fundamental pillar of modern organizational security. This lesson will walk you through the architecture of DLP, the configuration steps required to protect your SharePoint and OneDrive environments, and the best practices for maintaining a healthy security posture over time.


Not read yet

The Architecture of Microsoft Purview DLP

Before diving into the configuration steps, it is essential to understand how Microsoft Purview DLP actually "sees" your data. The system operates on a policy-driven model that sits between your users and their data. When you create a policy, you are essentially telling the Microsoft 365 service to monitor specific locations (like a particular SharePoint site or a user’s OneDrive) for specific patterns (sensitive information types).

The core components of the DLP engine include:

  • Sensitive Information Types (SITs): These are the building blocks of DLP. They are pattern-matching definitions, such as regex, keyword lists, or checksums, that identify things like social security numbers, bank account numbers, or internal project codes.
  • Trainable Classifiers: Unlike static pattern matching, these use machine learning to identify data based on intent or context, such as identifying a document as a "contract" or a "resume" even if the specific text patterns vary.
  • Locations: These define the scope of the policy. For this lesson, we focus on SharePoint sites and OneDrive accounts, but the engine also monitors Exchange, Teams, and even on-premises file shares if configured.
  • Rules: These are the "if-then" statements. For example: "If an item contains a credit card number AND it is shared with someone outside the organization, THEN block access and notify the compliance administrator."

Callout: DLP vs. Information Protection It is common to confuse DLP with Microsoft Purview Information Protection (MIP). While they work together, they serve different purposes. MIP is about labeling and protecting the file itself, usually through encryption and rights management. DLP is about monitoring and enforcing boundaries based on where the file lives and who is trying to access it. Think of MIP as the lock on the box, and DLP as the security guard watching the door.


Not read yet

Step-by-Step: Configuring Your First DLP Policy

Configuring a DLP policy is a multi-stage process that requires careful planning. You should never deploy a policy to your entire organization without testing it first. Follow these steps to configure a baseline policy for your SharePoint and OneDrive environments.

Step 1: Define the Scope and Policy Template

  1. Navigate to the Microsoft Purview compliance portal.
  2. In the left navigation menu, select Data loss prevention and then click Policies.
  3. Click Create policy.
  4. You can start from a template (like "Financial," "Medical," or "Privacy") or choose Custom. For this walkthrough, we will choose Custom to ensure we understand every setting.
  5. Provide a name and description for your policy. Be descriptive, such as "Restrict Credit Card Data in SharePoint/OneDrive."

Step 2: Choose Locations

This is the most critical step for this lesson. By default, the policy might try to include everything.

  1. Toggle SharePoint sites and OneDrive accounts to "On."
  2. You can choose to include all sites or specific sites. For production environments, it is highly recommended to start with a "pilot" site or a small group of users before applying the policy to the entire tenant.

Step 3: Define Policy Settings

  1. Select Create or customize advanced DLP rules.
  2. Click Create rule.
  3. Under Conditions, click Add condition and choose Content contains.
  4. Select Sensitive info types and pick the relevant ones (e.g., "Credit Card Number").
  5. Define the Instance count (how many occurrences trigger the rule) and Confidence level.

Step 4: Configure Actions and Notifications

  1. Under Actions, choose Restrict access or encrypt the content.
  2. Select Block everyone or Block only people outside the organization.
  3. Under User notifications, enable the option to notify the user. This is crucial for user training; when a user receives a notification that their action was blocked, they learn that the file they were sharing contained sensitive information.
  4. Under Incident reports, configure the email alerts for administrators.

Step 5: Testing and Activation

  1. Before clicking "Finish," select Test it out first.
  2. This allows you to see the impact of the policy in the DLP Activity Explorer without actually blocking users.
  3. Review the reports for 7–14 days before switching to "Turn on the policy."

Not read yet

Practical Examples of DLP Scenarios

To truly understand the power of DLP, we must look at how it handles real-world business scenarios.

Scenario 1: Preventing External Sharing of Financial Records

An accounting firm uses SharePoint to store client tax returns. They want to ensure that no tax return is ever shared via a "Guest Link" with an external party.

  • Policy Rule: "If document contains 'Tax ID' or 'Social Security Number' AND 'Shared with' = 'External users' THEN Block Access."
  • Result: If a user tries to generate a "Anyone with the link" URL, the system automatically revokes that link and replaces it with a warning message explaining that the content is restricted.

Scenario 2: Detecting Intellectual Property Leaks

A software company stores its source code and design documents in OneDrive. They want to be alerted if any file containing the term "Proprietary-Project-X" is moved to a personal folder or shared outside of the project team.

  • Policy Rule: "If document contains 'Keyword: Project-X' AND 'Shared with' = 'Everyone' THEN Send Alert to Admin."
  • Result: The administrator receives an email notification. The user is allowed to proceed, but a record is created in the audit log for follow-up. This is an "Audit-only" policy, which is useful for gathering data before tightening security.

Note: You can use "Policy Tips" to provide immediate feedback to users. These appear in the SharePoint/OneDrive interface as a small icon or a banner, letting the user know that their document contains sensitive information and that their sharing settings may be restricted.


Not read yet

Best Practices for DLP Implementation

Implementing DLP is not a "set it and forget it" task. It requires an iterative approach to ensure security without breaking business workflows.

1. Always Use "Test Mode" First

Never skip the testing phase. If you push a restrictive policy to a high-traffic SharePoint site, you risk blocking legitimate business operations, which leads to frustration and "shadow IT" (users finding workarounds like using personal USB drives or unapproved messaging apps).

2. Tailor Confidence Levels

Sensitive info types have confidence levels (e.g., 65%, 75%, 85%). A low confidence level might trigger many false positives. Start with high confidence levels and gradually lower them if you find that the system is missing legitimate sensitive documents.

3. Communicate with End Users

DLP can feel like a "black box" to the average employee. Before turning on blocking policies, send a company-wide communication explaining why these policies exist. When users understand that the goal is to protect client data, they are more likely to cooperate and less likely to view the system as a hindrance.

4. Regularly Review the Activity Explorer

The Activity Explorer in the Purview portal is your best friend. It shows you exactly what files are being flagged and why. Use this to identify "noisy" rules that are triggering too frequently and adjust them to be more precise.

5. Keep Policies Granular

Avoid creating one "mega-policy" that tries to cover everything. It is better to have separate policies for different departments or data types (e.g., an HR policy, a Finance policy, and an IT policy). This makes troubleshooting much easier when a rule misfires.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced administrators can fall into common traps when configuring DLP. Below are the most frequent mistakes and strategies to avoid them.

Over-Blocking and Business Disruption

Many administrators create a broad policy that blocks all external sharing for any sensitive data. While this is secure, it often breaks legitimate workflows where employees must share certain documents with partners.

  • Solution: Use "Exceptions." You can exclude specific SharePoint sites or specific groups of users from a policy rule. If your legal team needs to share sensitive files with outside counsel, create an exception for their specific SharePoint site.

Ignoring "False Positives"

If your policy triggers an alert every time a user types a standard serial number that happens to match a credit card pattern, you will suffer from "alert fatigue." Eventually, you will stop paying attention to the alerts, and you might miss a real incident.

  • Solution: Tune your Sensitive Information Types. If you have custom data (like specific project ID formats), create custom SITs using regular expressions (regex) that are highly specific, rather than relying on generic, built-in types.

Failing to Account for Permissions

DLP policies do not change existing permissions; they only restrict the sharing of content. If a user already has "Full Control" over a file, the DLP policy will prevent them from sharing it further, but it does not remove their existing access to the file.

  • Solution: Ensure that your SharePoint and OneDrive permissions (the underlying access control) are also managed strictly. DLP is the second line of defense; the first line of defense is ensuring users only have access to what they need.

Warning: Be cautious with "Auto-labeling" policies in combination with DLP. If you have a policy that automatically applies a sensitivity label (encryption) to a file, and another policy that blocks sharing, you can create a situation where a user cannot even open their own file because the encryption prevents the DLP engine from scanning it, or vice versa. Always test these interactions in a lab environment.


Not read yet

Advanced Configuration: PowerShell for DLP

While the user interface (UI) is sufficient for most configurations, PowerShell is invaluable for bulk operations or complex reporting. You can use the ExchangeOnlineManagement module to manage your DLP policies.

To list all current DLP policies, you can use:

Get-DlpCompliancePolicy | Select-Object Name, Mode, Workload

To update a policy to "Test" mode after it has been enabled:

Set-DlpCompliancePolicy -Identity "YourPolicyName" -Mode Test

Understanding the PowerShell Logic

PowerShell allows you to see the "hidden" properties of a policy that the UI might obscure. For example, you can inspect the exact rule structure:

Get-DlpComplianceRule -Policy "YourPolicyName"

Using PowerShell is particularly useful when you need to audit your policies across multiple tenants or document your configurations for compliance audits. Always ensure you are connected to the Security & Compliance PowerShell endpoint before executing these commands.


Not read yet

Comparison Table: DLP Features and Options

Feature Description Best For
Audit Only Logs activity without blocking access. Initial deployment, gathering data.
Block Access Prevents external/internal sharing. High-risk data (PII, PHI).
Policy Tips Displays a warning to the user. User training and compliance awareness.
Override Allows users to bypass the block if they provide a reason. Balancing security with productivity.
Incident Reports Emails the admin when a rule is hit. Real-time monitoring and threat response.

Troubleshooting DLP Failures

When a policy does not seem to be working, follow this logical troubleshooting flow:

  1. Check the Latency: DLP policies are not instantaneous. It can take up to an hour for a new policy to propagate across the Microsoft 365 cloud. If you just created it, wait 60 minutes.
  2. Verify the Location: Did you actually target the specific SharePoint site or OneDrive account? Check the policy settings to ensure the "Include" scope is correct.
  3. Validate the Sensitivity Type: Does the document actually contain the data you think it does? Open the document and verify that the sensitive information (e.g., a credit card number) is formatted in a way that matches the Sensitive Information Type definition.
  4. Review the Rule Priority: Rules are processed in order. If you have a "Block" rule and an "Allow" rule, the one with the higher priority (lower number) wins. Check your rule order.
  5. Audit Logs: Search the Unified Audit Log for "DLP" events. This will tell you if the system even attempted to scan the file.

Not read yet

The Role of User Education

Technology alone cannot solve data loss. The most effective DLP strategy is one that combines automated technical controls with a culture of security awareness. When a user is blocked by a DLP policy, they should be presented with a clear, helpful message. Instead of a generic "Access Denied," configure your policy to show a message like:

"This document contains sensitive financial information. Per company policy, this file cannot be shared with external guests. Please contact your manager if you believe this is an error or if you need to share this securely via the approved portal."

By providing context, you turn a security block into a learning moment. This reduces the number of help-desk tickets and encourages employees to handle sensitive data more carefully in the future.


Key Takeaways

  1. Proactive Governance: DLP transforms your security from a reactive, manual process into an automated, policy-driven system that protects data in real-time within SharePoint and OneDrive.
  2. Start with Testing: Always deploy policies in "Test Mode" first. This allows you to observe how the policy impacts your existing workflows without disrupting users, providing the data needed to tune your rules for high accuracy.
  3. Precision Matters: Use high-confidence sensitive information types and granular scoping to avoid false positives. If a policy is too broad, it will create alert fatigue and frustration, leading to non-compliance.
  4. Communication is Key: Utilize policy tips and user notifications to educate employees. When users understand why a file is being blocked, they are more likely to comply and less likely to seek insecure workarounds.
  5. Iterative Management: DLP is not a static configuration. Regularly review the Activity Explorer, audit logs, and business requirements to refine your policies as your data and organizational needs evolve.
  6. Exception Handling: Build flexibility into your policies. Use exclusions for specific sites or users to ensure that essential business processes are not hindered by broad security rules.
  7. Defense in Depth: Remember that DLP is only one layer of your security stack. It should be used alongside Microsoft Purview Information Protection (MIP), robust identity management (MFA), and sound SharePoint permission structures for a truly secure environment.

By following these principles, you can effectively secure your organization's most critical information assets while maintaining the collaborative environment that makes SharePoint and OneDrive so powerful. The goal of DLP is not to stop work, but to ensure that work happens safely and responsibly.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.