MDCA: Monitor Sensitive Label Downgrading Near Real-Time
Use Case
The client wants to keep their private information safe when people from inside or outside the company access it — with visibility into strictly confidential documents that get downgraded to a lower label.
When a label downgrade happens, they want to get an alert as quickly as possible.
Solution
To accommodate the use case, we'll create a Kusto Query Language (KQL) query in Advanced Hunting and a custom detection rule. The query is designed to run continuously, so we get the alarm in near real-time.
Prerequisites
Your organization must have Microsoft Information Protection set up. See the create sensitivity labels guide.
Implementation
1) Getting label IDs
First we need to grab the IDs from our Information Protection labels.
- Go to Graph Explorer and sign in with a Global Admin account.
- Go to Modify permissions and grant consent for
InformationProtectionPolicy.Read. - Paste the URL and run the query.
- Go through all the results and copy each label ID for later use.
- Save all your IDs and label names for later use.
2) Creating the Advanced Hunting query
- Go to security.microsoft.com → Hunting → Advanced Hunting.
- Create a new query.
- Copy the query from my GitHub repo: mdca-label-downgrade-query.kql.
- Paste it into your newly created Advanced Hunting query.
- (Important) Replace
listLabelNameswith your saved label IDs and friendly names (from step 1). - (Important) Modify the two lines (Source & Destination) with your Strictly Confidential label IDs.
- Click Save as and select my-queries as the location.
- Without closing the query, proceed to step 3 below.
3) Creating the custom detection rule
- Within the query, click Create Custom Detection Rule.
- Alert details: fill in name, frequency, title, severity, category and description.
- Impacted entities: select
AccountId. - Actions: skip this or leave it default.
- Submit and create the detection rule.
4) Testing: generate an alert
- Find a test user or use your current admin account.
- Go to a SharePoint site and create a new document.
- Give it a name, title and some content.
- Select your version of the Strictly Confidential label (Source).
- Refresh the browser inside the document.
- Downgrade the label to lower than Strictly Confidential (Destination).
5) Testing: wait for the alert
After a couple of minutes the alert appeared. This detection rule is NRT (near real-time), so it should show up quickly.
Conclusion
Advanced Hunting with a custom detection rule is very useful for monitoring CloudAppEvents near real-time. This label downgrade can also be monitored through Sentinel or Insider Risk Management.
Let me know if you have questions or need help.