Microsoft Purview is a comprehensive solution that helps organizations manage and protect their data across various environments, including on-premises, multi-cloud, and software-as-a-service (SaaS) platforms. It provides a unified data catalog, data classification, and data security capabilities, enabling organizations to gain insights into their data landscape, secure their data accordingly, and ensure compliance with regulatory requirements.
The data security toolset includes Sensitivity Labels and Data Loss Preventions, which are the tools that this blog post focuses on:
While Microsoft Purview provides interesting features related to data security, the solution remains prone to some very old and always relevant vulnerabilities: the human factor and bad design decisions.
This blog post explores an exfiltration scenario that highlights the importance of robust DLP policies within Microsoft Purview. We will examine how Sensitivity Labels function, why inadequate DLP measures can lead to data leaks, and we’ll introduce best practices for strengthening an organization’s data protection measures. If you are not familiar with Microsoft Purview, Sensitivity Labels, Data Loss Prevention, or Insider Risk Management, I recommend having a look at this other blog post: Become Big Brother with Microsoft Purview – NVISO Labs
Alex is an internal employee in the company Purview Territory. Alex has access to an Entra ID joined Windows 10 workstation that is managed in Intune. Through the device, Alex can access and sync files from SharePoint Online and emails from Exchange Online. Alex will try to exfiltrate docx and pdf files containing sensitive information via email and to upload the files to an online storage platform.
In Microsoft Purview, the sensitivity label ‘Super Secret’ can be applied to files and emails, it is the most sensitive level of information. Other sensitivity labels exist, and the policy that makes all labels available to Alex also enforces the application of a label in order to save a file or send an email, making the suppression of sensitivity label impossible in theory. Emails inherit the sensitivity label from the attachment if it has a higher level of sensitivity. In addition, Insider Risk Management is used to investigate and raise alerts if users downgrade sensitivity labels.
Two Data Loss Prevention policies exist with a unique rule for each with the following settings:
Alex tries first to exfiltrate the two files via email. The files are added as attachments and then sent to an external email address:
When Alex clicks “Send”, the action is blocked directly in the client and the policy tip defined in the DLP appears. Note: If the client cannot process the DLP rule for some reasons, it will be processed in Exchange Online and the email will bounce back with a delivery failure message instead.
Alex tries a second time to exfiltrate the two files via an online storage platform. The files are simply dragged and dropped into the website:
When the file is dropped into the website, the Microsoft Purview Extension identifies the sensitivity label and prevents the action. This browser extension is enabled by default in Microsoft Edge and it can be added to Google Chrome and Firefox via Group Policy Object (GPO) or Intune Configuration Profile.
Overall, the exfiltration was prevented as the DLP policies were triggered according to the sensitivity labels. The diagram below presents the results of the failed attempts:
To successfully bypass the DLP policies, the sensitivity labels must be removed from the files. However, the label policy defined in Microsoft Purview makes it mandatory for users to select a sensitivity label when saving a file. Even with the Microsoft Purview Information Protection client, it is not possible to delete the label as the option is grayed out.
In order to get rid of the sensitivity labels by other means, we must understand how they actually work. As stated earlier, a sensitivity label is only made of metadata that is added to a file. If we open the SuperSafe.docx with a metadata reader, such as ExifTool, the following information is displayed:
In the first part, the content marking is described. It does not offer any protection. In the second part, the sensitivity label applied is seen. Now the question: What if we simply delete those metadata? Unfortunately, we cannot edit metadata of docx files with ExifTool, but we can edit metadata of pdf files. So first, we export the docx to pdf. This file will be called “SuperSafe – Exported.pdf” and here is its metadata:
And now with ExifTool, we can delete the metadata of “SuperSafe – Exported.pdf”:
If we reopen “SuperSafe – Exported.pdf” with ExifTool, we can see that the sensitivity label is gone:
After removing the metadata of “SuperSafe.pdf”, Alex can upload the two pdf files to an online storage platform:
The upload was successful. Alex now sends the same files via email:
The exfiltration is now successful. The diagram below depicts the entire exfiltration:
Now that the exfiltration was successful, it is the moment to deep dive into the Microsoft security & compliance solutions in order to try to identify and mitigate the exfiltration.
The device timeline is a feature from Microsoft Defender for Endpoint (MDE) that provides the events that happened on the device onboarded to Defender for Endpoint. MDE is included in the Enterprise E5 license and therefore does not involve additional cost. The goal of this feature is to help analysts and administrators in researching and investigating anomalous behaviors. After reproducing the removal of metadata on a new file called “VerySuperSafe.pdf”, the following sequence can be observed in the device timeline:
The diagram below provides a more high level view over the sequence:
The following information from the events could be used in hunting queries to identify similar behavior:
While the existing protections use sensitivity labels, it is clear that this classification tool alone is not enough to properly identify and protect sensitive information. This is because the sensitivity label ‘Super Secret’ is only applied manually.
An important improvement would be to have one or more classifiers that can help in identifying sensitive information. The classifiers can be Sensitive Information Type (SIT) which are based on keywords, RegEx, fingerprints or exact data match (EDM). Microsoft Purview also provides the ability to create Trainable Classifier, which can be summarized as a Sensitive Information Type powered by machine learning. Note that the Trainable Classifier (TC) must be trained thoughtfully to meet a sufficient level of confidence in its classification.
Once the sensitive information is translated into SITs or TCs, a sensitivity label policy can be created to automatically apply the sensitivity label ‘Super Secret’ based on the information found in the file.
Finally, the sensitivity label ‘Super Secret’ can be modified to include encryption. This ensures that no unauthorized user is able to open and read the documents even if the sensitivity label is removed.
To mitigate this exfiltration scenario, the DLP policies created in Microsoft Purview can be improved with additional rules. As a reminder, one DLP policy can contain multiple rules with different conditions and actions.
Starting with the DLP 1:
This second rule prevents the emails, even if the emails themselves are correctly labeled, to be sent out to external domains if the attachment has no sensitivity label. Additionally, the third rule ensures that any form of information identified as super secret via the classifiers cannot be sent out to external domains.
Regarding the DLP 2:
Similarly to the improvement for the emails, this second rule ensures that all files supporting sensitivity labels cannot be uploaded to unauthorized online storage. Comparably to the DLP1, the third rule ensures that any form of information identified as super secret via the classifiers cannot be uploaded to unauthorized online storage. From a high level point of view, these additional DLP rules ensure that everything that is explicitly ‘Super Secret’, contains information that can be identified as ‘Super Secret’, or has been tampered with (i.e., label removal), cannot be send to external domains or uploaded to unauthorized online storage platforms.
The Insider Risk Management (IRM) solution from Purview could also help in identifying potential exfiltration activities through the analysis of users activities. This can be achieved through the creation of the IRM policy ‘DEMO – Data exfiltration’ that does the following:
Following a review, this alert can be dismissed or confirmed. Confirming the alert will escalate to an insider risk case, which we will cover in another article.
Overall, IRM policies provide valuable information about correlated exfiltration events rather than isolated activities. The risk assignment can be used to quickly highlight the risky users as well as configuring dedicated risk-based protection through Adaptive Protection, a topic we will cover in another article.
It is clear that relying solely on manual Sensitivity Label application and basic Data Loss Prevention (DLP) rules for classifying and protecting information is insufficient. While it may seem better than having no measures in place, this approach can be counterproductive. It might satisfy compliance audits, creating a false sense of security as this protection can be evaded easily.
Here is a summary on the main topics to keep in mind when pursuing data security:
If you are interested in implementing data security measures or review your current controls, don’t hesitate to visit our website www.nviso.eu or connect with us on LinkedIn.
Should you have any questions or remarks, please feel free to contact me with the details at the end of the article.
While the topic tackled in this article reflects professional experience and expertise, the Microsoft resources I used below will also help you in understanding Microsoft Purview:
Mathéo is a Senior Cybersecurity Consultant and member of the Cloud Security Team. His area of expertise revolves around Azure and Microsoft 365 with a focus on Microsoft Purview, Entra ID, Intune, and Defender, where he has an extensive experience of assessing, designing and implementing multiple security solutions in various industries.
Mathéo confirmed his skills by passing the CISSP and all the security-related Microsoft certification, including the Microsoft Certified Cybersecurity Architect.