-
Notifications
You must be signed in to change notification settings - Fork 124
Data-35017: Default label configured for sensitivity labels #766
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?
Conversation
03b5494 to
9e75a81
Compare
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.
Pull request overview
This pull request adds a new assessment test (Test-Assessment-35017) that validates whether sensitivity label policies have default labels configured for various Microsoft 365 workloads. The test checks for default label configuration across documents/emails, Outlook, Power BI, and SharePoint/Microsoft 365 Groups, helping organizations ensure consistent baseline data classification.
Changes:
- Adds Test-Assessment.35017.ps1 with logic to assess default label configuration across multiple workloads
- Adds Test-Assessment.35017.md with remediation guidance for configuring default sensitivity labels
- Introduces Get-LabelPolicySettings.ps1 as a shared helper function for parsing sensitivity label policy XML settings, designed for reuse across multiple tests (35016, 35017, etc.)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/powershell/tests/Test-Assessment.35017.ps1 | Main test function that retrieves enabled label policies, validates default label IDs, determines policy scope, and generates detailed reports with pass/fail status |
| src/powershell/tests/Test-Assessment.35017.md | Documentation explaining the importance of default labels, remediation steps, and Microsoft Learn reference links |
| src/powershell/private/tests-shared/Get-LabelPolicySettings.ps1 | Shared helper function that parses PolicySettingsBlob XML to extract default label settings and mandatory labeling configurations for multiple workloads |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexandair
left a comment
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.
@aahmed-spec Please, address my feedback.
| param() | ||
|
|
||
| #region Helper Functions | ||
| function Test-ValidLabelId { |
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.
This helper function is an overkill. We don't need the whole function for checking if the label ID is valid GUID.
This is enough:
$guid = [System.Guid]::Empty
return [System.Guid]::TryParse($VALUEWEARECHECKING, [ref]$guid)That code already cover cases when value is $null or empty string:
PS> $labelid = $null
PS> $guid = [System.Guid]::Empty
PS> return [System.Guid]::TryParse($LabelId, [ref]$guid)
False
PS> $labelid = ''
PS> $guid = [System.Guid]::Empty
PS> return [System.Guid]::TryParse($LabelId, [ref]$guid)
FalseThere 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.
@alexandair I have made the changes, let me know if it looks good.
No description provided.