-
Notifications
You must be signed in to change notification settings - Fork 121
Data-35018: Downgrade Justification Required for Sensitivity Labels #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||
| When sensitivity label policies do not require users to provide justification when removing or downgrading labels, users can silently reduce the classification level of sensitive content without creating an audit trail explaining why. This creates a compliance and audit risk because organizations lose visibility into intentional label downgrades that may indicate inappropriate access to sensitive data. When a user removes a "Confidential" label and replaces it with "Internal" or no label at all, organizations should require explicit justification to create an audit record of this action. Downgrade justification is a lightweight control that increases accountability for label decisions without significantly impacting user workflows. When justification is not required, compromised user accounts or departing employees could systematically downgrade labels on sensitive documents to enable data exfiltration, leaving no clear audit trail of the unauthorized changes. Configuring downgrade justification requirements on sensitivity label policies ensures that any intentional reduction in classification level is logged with a user-provided business reason, supporting both compliance audits and insider threat investigations. Downgrade justification should be configured alongside other label controls (mandatory labeling, default labels, and mandatory enforcement) to create a comprehensive data governance framework. | ||||
|
|
||||
| **Remediation action** | ||||
| 1. Navigate to [Sensitivity label policies](https://purview.microsoft.com/informationprotection/labelpolicies) in Microsoft Purview | ||||
| 2. Create or update a policy to enable downgrade justification requirement | ||||
| 3. Enable: "Require users to provide justification to change a label" | ||||
| 4. Define predefined justification reasons | ||||
| 5. Set policy scope (global or specific groups) | ||||
| 6. Verify audit logging is enabled | ||||
| 7. Test with pilot users | ||||
|
|
||||
| **Learn More:** [Require users to provide justification to change a label](https://learn.microsoft.com/en-us/purview/sensitivity-labels-office-apps#require-users-to-provide-justification-to-change-a-label) | ||||
|
|
||||
| - [Plan for sensitivity labels](https://learn.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels#plan-for-sensitivity-labels) | ||||
| - [Create and publish sensitivity labels](https://learn.microsoft.com/en-us/microsoft-365/compliance/create-sensitivity-labels) | ||||
| - [Require users to provide justification to change a label](https://learn.microsoft.com/en-us/purview/sensitivity-labels-office-apps#require-users-to-provide-justification-to-change-a-label) | ||||
| - [Plan your sensitivity label solution](https://learn.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels#plan-for-sensitivity-labels) | ||||
|
||||
| - [Plan your sensitivity label solution](https://learn.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels#plan-for-sensitivity-labels) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,174 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <# | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Downgrade Justification Required for Sensitivity Labels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sensitivity label policies should require users to provide justification when removing or downgrading labels. When downgrade justification is not required, users can silently reduce the classification level of sensitive content without creating an audit trail, creating compliance and audit risks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .NOTES | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Test ID: 35018 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pillar: Data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Risk Level: Medium | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function Test-Assessment-35018 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ZtTest( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Category = 'Information Protection', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ImplementationCost = 'Low', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MinimumLicense = ('Microsoft 365 E3'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pillar = 'Data', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RiskLevel = 'Medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SfiPillar = 'Protect tenants and production systems', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TenantType = ('Workforce'), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TestId = 35018, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Title = 'Downgrade Justification Required for Sensitivity Labels', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UserImpact = 'Medium' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [CmdletBinding()] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| param() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #region Data Collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-PSFMessage '🟦 Start' -Tag Test -Level VeryVerbose | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $activity = 'Checking Sensitivity Label Policy Downgrade Justification Requirements' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-ZtProgress -Activity $activity -Status 'Query 1: Getting all enabled label policies' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Query 1: Get all enabled label policies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $labelPolicies = $null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $errorMsg = $null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $investigateReason = $null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $labelPolicies = @(Get-LabelPolicy -ErrorAction Stop | Where-Object { $_.Enabled -eq $true }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $errorMsg = $_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $investigateReason = "Unable to query Label Policies: $($_)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-PSFMessage "Error querying Label Policies: $_" -Level Error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #endregion Data Collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #region Assessment Logic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $testStatus = $null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $policiesWithDowngradeJustification = @() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $policyDetails = @() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($errorMsg) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $testStatus = 'Investigate' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Write-ZtProgress -Activity $activity -Status 'Query 2 & 3: Examining label policy downgrade justification settings' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # For each enabled policy, examine settings for downgrade justification | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($policy in $labelPolicies) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Query 3: Get detail on specific policy settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $policySettings = Get-LabelPolicy -Identity $policy.Identity -ErrorAction Stop | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Select-Object -ExpandProperty Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Convert Settings array to hashtable for easier querying | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $settingsHash = @{} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($policySettings) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($setting in $policySettings) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Parse [key, value] format | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $match = $setting -match '^\[(.*?),\s*(.+)\]$' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $match = $setting -match '^\[(.*?),\s*(.+)\]$' | |
| $match = $setting -match '^\[([^,]+),\s*([^\]]+)\]$' |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern uses ToLower() on both key and value, which will convert boolean 'True'/'False' values to lowercase. While the comparison on line 85 correctly checks for 'true' in lowercase, this approach may cause issues if other settings have case-sensitive values. Consider preserving the original case for the value and only normalizing the key, or explicitly handle boolean values separately.
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PolicyScope logic appears incorrect. It checks if ExchangeLocation.Type.value is not 'Tenant' to determine 'Scoped', but this will mark policies as 'Global' when ExchangeLocation is null or when Type.value equals 'Tenant'. This logic may not accurately distinguish between global and scoped policies. Consider verifying the correct property to check for policy scope, or implement a more robust check that handles null values and different location types appropriately.
| $policyDetail = [PSCustomObject]@{ | |
| PolicyName = $policy.Name | |
| Enabled = $policy.Enabled | |
| RequireDowngradeJustification = $hasDowngradeJustification | |
| PolicyScope = if ($policy.ExchangeLocation -and $policy.ExchangeLocation.Type.value -ne 'Tenant') { 'Scoped' } else { 'Global' } | |
| $policyScope = 'Unknown' | |
| if ($policy.ExchangeLocation) { | |
| $locType = $null | |
| if ($policy.ExchangeLocation.Type -and $policy.ExchangeLocation.Type.Value) { | |
| $locType = $policy.ExchangeLocation.Type.Value | |
| } | |
| if ($locType) { | |
| if ($locType -eq 'Tenant') { | |
| $policyScope = 'Global' | |
| } | |
| else { | |
| $policyScope = 'Scoped' | |
| } | |
| } | |
| } | |
| $policyDetail = [PSCustomObject]@{ | |
| PolicyName = $policy.Name | |
| Enabled = $policy.Enabled | |
| RequireDowngradeJustification = $hasDowngradeJustification | |
| PolicyScope = $policyScope |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an error occurs in the inner try-catch block (lines 64-105), $investigateReason is set but the error is logged at Warning level instead of Error level. Additionally, the test continues processing other policies even when one policy fails. Consider whether partial failures should result in an 'Investigate' status or if successfully processed policies should still contribute to Pass/Fail determination. The current logic (line 109-117) will mark the test as 'Investigate' even if only one policy failed but others passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 1 is extremely long (over 1000 characters) with no paragraph breaks, making it very difficult to read. Consider breaking this into multiple paragraphs to improve readability. For example, separate the problem statement, the risk explanation, and the solution recommendation into distinct paragraphs.