Create Microsoft Purview Sensitivity Labels (MIP) detector
Scan Microsoft Purview Sensitivity Labels with Custom Regex Detectors
Last updated
Was this helpful?
Scan Microsoft Purview Sensitivity Labels with Custom Regex Detectors
Nightfall exposes Microsoft Information Protection (MIP) label metadata during file scanning, allowing you to detect files based on their Microsoft Purview sensitivity labels using Custom Regex Detectors.
This enables organizations to build policies around their existing Microsoft Purview classification strategy without relying solely on content inspection.
Common use cases include:
Detecting files labeled Confidential, Internal, or Restricted
Alerting when labeled files are shared externally
Blocking uploads of sensitive classified content
Triggering remediation workflows for protected documents
Monitoring the movement of labeled files across SaaS applications
When a file contains a Microsoft Purview sensitivity label, Nightfall extracts the label metadata and makes it available during scanning in the following format:
mip.label.name=<Label Name>For example:
mip.label.name=Confidentialmip.label.name=InternalYou can create Custom Regex Detectors that match the labels used within your organization.
To scan for Microsoft Purview sensitivity labels, create a Custom Regex Detector and use it in a Nightfall policy or workflow.
Create a Custom Regex Detector.
Add a regex that matches the sensitivity labels relevant to your organization.
Use the detector in Nightfall policies and workflows.
Test against files containing the corresponding sensitivity labels.
For example, to detect files labeled Confidential or Internal, use the following pattern:
This detector will match files that contain either sensitivity label.
Component
Description
(?m)
Enables multiline mode so anchors apply to individual metadata lines
^
Matches the beginning of the metadata line
mip\.label\.name=
Matches the MIP label metadata field
(Confidential|Internal)
Matches either label value
$
Matches the end of the metadata line
Microsoft Purview allows organizations to create custom sensitivity labels. Because label names vary between organizations, Nightfall does not provide predefined detectors for specific labels.
Instead, create Custom Regex Detectors that match the labels used within your environment.
For example:
Use anchors (^ and $) to ensure the detector matches only the intended label value.
Recommended:
Not recommended:
The recommended pattern reduces unintended matches and improves detector accuracy.
Use the same sensitivity labels already defined in Microsoft Purview to:
Reduce policy complexity
Leverage existing data classification investments
Improve policy consistency across security tools
Before enabling enforcement actions, validate that your detector correctly identifies files containing the expected sensitivity labels.
Detection is based on MIP label metadata present within the scanned file.
Label names are organization-specific and may vary across environments.
Custom Regex Detectors must be configured to match the label names used by your organization.
Last updated
Was this helpful?
Was this helpful?
(?m)^mip\.label\.name=(Confidential|Internal)$(?m)^mip\.label\.name=(Restricted)$(?m)^mip\.label\.name=(Customer Data)$(?m)^mip\.label\.name=(Highly Confidential)$
(?m)^mip\.label\.name=(Confidential)$Confidential