Data Protection Issues

How to Block Password-Protected Files with Microsoft 365 DLP

Tauseeq MagsiTauseeq Magsi Nov 3, 2026 869 views

Question details

The user needs to configure a Data Loss Prevention (DLP) rule in Microsoft 365 to detect and restrict access to encrypted or password-protected attachments.

How to Block Password-Protected Files with Microsoft 365 DLP
Product
Microsoft 365
Device & OS
not provided
Scenario
Setting up organizational security policies to prevent data leaks via files that bypass standard DLP content inspection due to encryption.
Observed behavior
Microsoft 365 DLP can inspect ordinary files but fails to read password-protected ones, requiring a specialized rule to detect the encryption state and restrict access.
Before you start

Ensure you have the necessary administrative privileges in the Microsoft 365 Compliance Center to create, modify, and manage Data Loss Prevention (DLP) policies.

Solution 1Recommended

Configure a DLP Rule for Password-Protected Attachments

Create a specific condition in your DLP policy that triggers an action whenever an attachment is encrypted or password-protected.

Because Microsoft 365 DLP cannot scan the internal contents of encrypted files, setting a rule to restrict access to these specific files ensures that sensitive information cannot intentionally or accidentally bypass your organization's security filters.

1
Access advanced DLP settings

Log in to the Microsoft 365 Compliance Center, navigate to your Data loss prevention (DLP) policies, and select 'Use advanced settings' for the policy you wish to edit.

2
Create a new rule

Choose 'New rule' to start defining the specific conditions for encrypted files.

3
Set the password protection condition

In the conditions section, add the criteria 'Attachment is password protected'.

4
Define the restriction action

Scroll down to the 'Actions' section and select 'Restrict access or encrypt the content' to enforce a block on these files.

5
Test the DLP policy

Save the rule and test the policy by sending both an unprotected Excel file and a password-protected file to confirm that the restrictions behave exactly as expected.

Configure a DLP Rule for Password-Protected Attachments
Use Test Mode: It is highly recommended to deploy your new DLP policy in 'Test mode' first. This allows you to monitor its impact and generate incident reports without actively disrupting normal business communications.
Free Microsoft Office alternative

Secure Your Documents Locally with WPS Office

While Microsoft 365 handles enterprise-level data loss prevention, you can easily secure your individual files using WPS Office. It provides robust document encryption and serves as a highly compatible, free alternative to Microsoft Office.

  1. 1. Download WPS Office: Install WPS Office for free from the official website and open your document.
  2. 2. Access Document Encryption: Go to the 'Menu' button in the top left corner, navigate to 'Document Encryption', and select 'Encryption'.
  3. 3. Set a Password: Enter your desired password to secure the file locally before sharing it with others.
Easily add password protection to your local documents, spreadsheets, and presentations.Fully compatible with Microsoft Office file formats (.docx, .xlsx, .pptx).Lightweight software that runs smoothly on Windows, Mac, Linux, and mobile devices.Free to download and features a familiar, easy-to-use tabbed interface.
QA img-9

Frequently Asked Questions

Why does Microsoft 365 DLP fail to inspect password-protected files?

Password-protected and encrypted files scramble the content, preventing the DLP scanning engine from reading the text to check for sensitive information matches. Therefore, a specialized rule must be used to detect the encryption state itself.

Can I apply this DLP rule to specific users or groups only?

Yes, when configuring your DLP policy in the Microsoft 365 Compliance Center, you can specify exact conditions and exceptions to apply the restriction rule only to certain departments, domains, or individual users.

How do I test my DLP rule without affecting users?

You can set the DLP policy to 'Test it out first' mode. This allows the system to evaluate rules and generate incident reports behind the scenes without actually blocking emails or restricting user access.