Skip to content

Conversation

@praneeth-0000
Copy link
Collaborator

External collaboration is governed by explicit Cross-Tenant Access Policies

@praneeth-0000 praneeth-0000 self-assigned this Jan 16, 2026
@praneeth-0000 praneeth-0000 added enhancement New feature or request ready for review PR is ready for review and merging labels Jan 16, 2026
@alexandair alexandair requested a review from Copilot January 16, 2026 18:29
Copy link
Contributor

Copilot AI left a 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 (25378) to validate that external collaboration is governed by explicit Cross-Tenant Access Policies in Microsoft Entra ID. The test ensures that default outbound B2B collaboration settings block all users and all applications, requiring organizations to explicitly define cross-tenant access policies for external collaboration.

Changes:

  • Adds Test-Assessment.25378.ps1 implementing the assessment logic for Cross-Tenant Access Policy validation
  • Adds Test-Assessment.25378.md providing risk context and remediation guidance

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/powershell/tests/Test-Assessment.25378.ps1 New PowerShell assessment test that validates Cross-Tenant Access Policy default outbound settings block all users and applications
src/powershell/tests/Test-Assessment.25378.md Documentation explaining security risks of unrestricted B2B collaboration and remediation steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +134 to +142
# Summary Section
$mdInfo += "`n## [Default Cross-Tenant Access Settings - Outbound B2B Collaboration]($portalLink)`n`n"
$mdInfo += "| Setting | Configured Value | Expected Value | Status |`n"
$mdInfo += "| :--- | :--- | :--- | :---: |`n"
$mdInfo += "| Is Service Default | $isServiceDefaultStr | false | $isServiceDefaultStatus |`n"
$mdInfo += "| Users and Groups Access Type | $usersAndGroupsAccessType | blocked | $usersAccessStatus |`n"
$mdInfo += "| Users and Groups Target | $($usersAndGroupsTargets[0]) | AllUsers | $usersTargetStatus |`n"
$mdInfo += "| Applications Access Type | $applicationsAccessType | blocked | $appsAccessStatus |`n"
$mdInfo += "| Applications Target | $($applicationsTargets[0]) | AllApplications | $appsTargetStatus |`n"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing array index [0] directly could fail if the array is empty. While $usersAndGroupsTargets is initialized with @('N/A'), if it's reassigned on line 76 with an empty array from $b2bOutbound.usersAndGroups.targets.target, this would cause an index out of bounds error. Add a check or use a safer accessor pattern.

Suggested change
# Summary Section
$mdInfo += "`n## [Default Cross-Tenant Access Settings - Outbound B2B Collaboration]($portalLink)`n`n"
$mdInfo += "| Setting | Configured Value | Expected Value | Status |`n"
$mdInfo += "| :--- | :--- | :--- | :---: |`n"
$mdInfo += "| Is Service Default | $isServiceDefaultStr | false | $isServiceDefaultStatus |`n"
$mdInfo += "| Users and Groups Access Type | $usersAndGroupsAccessType | blocked | $usersAccessStatus |`n"
$mdInfo += "| Users and Groups Target | $($usersAndGroupsTargets[0]) | AllUsers | $usersTargetStatus |`n"
$mdInfo += "| Applications Access Type | $applicationsAccessType | blocked | $appsAccessStatus |`n"
$mdInfo += "| Applications Target | $($applicationsTargets[0]) | AllApplications | $appsTargetStatus |`n"
$usersAndGroupsTargetDisplay = if ($null -ne $usersAndGroupsTargets -and $usersAndGroupsTargets.Count -gt 0) { $usersAndGroupsTargets[0] } else { 'N/A' }
$applicationsTargetDisplay = if ($null -ne $applicationsTargets -and $applicationsTargets.Count -gt 0) { $applicationsTargets[0] } else { 'N/A' }
# Summary Section
$mdInfo += "`n## [Default Cross-Tenant Access Settings - Outbound B2B Collaboration]($portalLink)`n`n"
$mdInfo += "| Setting | Configured Value | Expected Value | Status |`n"
$mdInfo += "| :--- | :--- | :--- | :---: |`n"
$mdInfo += "| Is Service Default | $isServiceDefaultStr | false | $isServiceDefaultStatus |`n"
$mdInfo += "| Users and Groups Access Type | $usersAndGroupsAccessType | blocked | $usersAccessStatus |`n"
$mdInfo += "| Users and Groups Target | $usersAndGroupsTargetDisplay | AllUsers | $usersTargetStatus |`n"
$mdInfo += "| Applications Access Type | $applicationsAccessType | blocked | $appsAccessStatus |`n"
$mdInfo += "| Applications Target | $applicationsTargetDisplay | AllApplications | $appsTargetStatus |`n"

Copilot uses AI. Check for mistakes.
$mdInfo += "| Users and Groups Access Type | $usersAndGroupsAccessType | blocked | $usersAccessStatus |`n"
$mdInfo += "| Users and Groups Target | $($usersAndGroupsTargets[0]) | AllUsers | $usersTargetStatus |`n"
$mdInfo += "| Applications Access Type | $applicationsAccessType | blocked | $appsAccessStatus |`n"
$mdInfo += "| Applications Target | $($applicationsTargets[0]) | AllApplications | $appsTargetStatus |`n"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to line 140, accessing array index [0] directly could fail if the array becomes empty after reassignment on line 86. Add a check or use a safer accessor pattern to prevent potential index out of bounds errors.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space between the closing bracket and opening parenthesis in the markdown link syntax. It should be ](https:// not ]( https:// to ensure the link renders correctly.

Suggested change
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:](https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space between the closing bracket and opening parenthesis in the markdown link syntax. It should be ](https:// not ]( https:// to ensure the link renders correctly.

Suggested change
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:](https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space between the closing bracket and opening parenthesis in the markdown link syntax. It should be ](https:// not ]( https:// to ensure the link renders correctly.

Suggested change
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:](https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space between the closing bracket and opening parenthesis in the markdown link syntax. It should be ](https:// not ]( https:// to ensure the link renders correctly.

Suggested change
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:]( https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:]( https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:]( https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)
- [Use the cross-tenant access activity workbook to identify current external collaboration patterns before blocking default access:](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/workbook-cross-tenant-access-activity)
- [Configure default outbound B2B collaboration settings to block access in the Microsoft Entra admin center:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#modify-outbound-access-settings)
- [Add organization-specific settings for approved partner tenants that require B2B collaboration:](https://learn.microsoft.com/en-us/entra/external-id/cross-tenant-access-settings-b2b-collaboration#add-an-organization)
- [Update default cross-tenant access policy via Microsoft Graph API:](https://learn.microsoft.com/en-us/graph/api/crosstenantaccesspolicyconfigurationdefault-update)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready for review PR is ready for review and merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants