-
Notifications
You must be signed in to change notification settings - Fork 117
35002 - Add test for Cross-Tenant Access Policy (XTAP) RMS settings #720
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
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 PR adds a new assessment test (35002) to check if Microsoft Rights Management Services (RMS) is properly allowed in Cross-Tenant Access Policies (XTAP). The test ensures that RMS (App ID: 00000012-0000-0000-c000-000000000000) is not blocked in both inbound and outbound B2B collaboration settings, which is critical for enabling encrypted content sharing across organizational boundaries.
Key Changes
- Adds a new PowerShell test function that validates XTAP settings for RMS application access
- Implements logic to check both default policies and partner-specific policy overrides
- Includes comprehensive unit tests covering various scenarios (allowed, blocked, inherited settings)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/powershell/tests/Test-Assessment.35002.ps1 |
Implements the main assessment test logic with helper functions to evaluate RMS access status in XTAP settings |
src/powershell/tests/Test-Assessment.35002.md |
Provides documentation explaining the test purpose, risks, and remediation steps for configuring XTAP RMS settings |
code-tests/test-assessments/Test-Assessment.35002.Tests.ps1 |
Contains comprehensive unit tests covering multiple scenarios including explicit/implicit allow/block conditions and error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| It "Should pass when Inbound and Outbound Block specific apps but NOT RMS (Implicit Allow)" { | ||
| $script:defaultPolicyResponse = [PSCustomObject]@{ |
Copilot
AI
Dec 22, 2025
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.
Inconsistent indentation: the variable assignment uses extra leading spaces (6 spaces instead of the standard 12 spaces for this level). This should be aligned with the indentation used in other test cases in this file.
| } | ||
|
|
||
| It "Should ignore inherited partner settings" { | ||
| $script:defaultPolicyResponse = [PSCustomObject]@{ |
Copilot
AI
Dec 22, 2025
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.
Inconsistent indentation: the variable assignment uses extra leading spaces (6 spaces instead of the standard 12 spaces for this level). This should be aligned with the indentation used in other test cases in this file.
| $script:defaultPolicyResponse = [PSCustomObject]@{ | |
| $script:defaultPolicyResponse = [PSCustomObject]@{ |
| [ZtTest( | ||
| Category = 'Entra', | ||
| ImplementationCost = 'Low', | ||
| MinimumLicense = ('MIP_P2'), |
Copilot
AI
Dec 22, 2025
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 MinimumLicense value 'MIP_P2' is not a valid license type supported by the Get-ZtLicense function. The function only accepts 'EntraIDP1', 'EntraIDP2', 'EntraIDGovernance', 'EntraWorkloadID', or 'Intune'. This needs to be changed to a valid license type that corresponds to Microsoft Information Protection capabilities, which would likely be 'EntraIDP2' or another existing license type that includes MIP features.
| MinimumLicense = ('MIP_P2'), | |
| MinimumLicense = ('EntraIDP2'), |
|
|
||
| #region Data Collection | ||
| Write-PSFMessage '🟦 Start' -Tag Test -Level VeryVerbose | ||
|
|
Copilot
AI
Dec 22, 2025
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 test implementation is missing the license check that other similar tests include. After line 76, there should be a license validation block that checks if the tenant has the required license and returns early if not, similar to how other P2 tests handle this. For example, this test should include something like: if ( -not (Get-ZtLicense EntraIDP2) ) { Add-ZtTestResultDetail -SkippedBecause NotLicensedEntraIDP2; return }
| if (-not (Get-ZtLicense MIPP2)) { | |
| Add-ZtTestResultDetail -SkippedBecause NotLicensedMIPP2 | |
| return | |
| } |
| } | ||
|
|
||
| It "Should pass when Inbound and Outbound allow All Apps" { | ||
| $script:defaultPolicyResponse = [PSCustomObject]@{ |
Copilot
AI
Dec 22, 2025
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.
Inconsistent indentation: the variable assignment uses extra leading spaces (6 spaces instead of the standard 12 spaces for this level). This should be aligned with the indentation used in other test cases in this file.
| $script:defaultPolicyResponse = [PSCustomObject]@{ | |
| $script:defaultPolicyResponse = [PSCustomObject]@{ |
Fix https://github.com/microsoft/ztspecs/issues/57