-
Notifications
You must be signed in to change notification settings - Fork 247
CIS M365v6.0.1 SPO tests Chapter 7 #1755
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
Open
Mynster9361
wants to merge
46
commits into
maester365:main
Choose a base branch
from
Mynster9361:CIS-M365v6.0.1-SPO-tests-Chapter-7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
2fd993d
Added CIS M365v5 SPO tests
76e88b3
Update powershell/public/maester/spo/Test-MtSpoDefaultSharingLink.ps1
SamErde ac83443
Update powershell/public/maester/spo/Test-MtSpoB2BIntegration.md
SamErde f7dd070
Update website/docs/tests/maester/MT.1113.md
SamErde 7869165
Update website/docs/tests/maester/MT.1118.md
SamErde 5c88be6
changed invoke logic for spo tests
a6b37de
Updated CISM365v57-SPO
6554161
Merge branch 'main' into CISM365v57-SPO
HenrikPiecha ff61284
removed test that has been flagged as obsolet by cis
947e9bd
Merge branch
f3dcbed
Update powershell/public/maester/spo/Test-MtSpoGuestAccessExpiry.ps1
SamErde 772b7c0
Update powershell/public/maester/spo/Test-MtSpoGuestCannotShareUnowne…
SamErde 6850f8e
Update powershell/public/maester/spo/Test-MtSpoB2BIntegration.md
SamErde 36ac2fa
Update powershell/public/maester/spo/Test-MtSpoGuestCannotShareUnowne…
SamErde c3ac6d7
Update powershell/public/maester/spo/Test-MtSpoPreventDownloadMalicio…
SamErde 7b6f32e
Update website/docs/tests/maester/MT.1113.md
SamErde 389f31a
Update powershell/public/Connect-Maester.ps1
SamErde 6b2f02b
Update powershell/public/maester/spo/Test-MtSpoGuestCannotShareUnowne…
SamErde 9ebb6be
Update powershell/Maester.psd1
SamErde 328e18c
Update powershell/public/Connect-Maester.ps1
SamErde bbfc7e7
Update powershell/public/Connect-Maester.ps1
SamErde ada7781
Initial cleanup and update to the PR #1433
Mynster9361 155a59d
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
Mynster9361 e8f8ff6
intial fixes to markdown files
Mynster9361 8211d95
Merge branch 'CIS-M365v6.0.1-SPO-tests-Chapter-7' of https://github.c…
Mynster9361 7e33999
update command based help
Mynster9361 e68b36f
updated code in cis tests
Mynster9361 1efb299
added connection for Maester to PnP.PowerShell
Mynster9361 eb4c6b8
added test and skip reason for NotConnectedSharePointOnline
Mynster9361 21c805d
updated commands with test for SharePointOnline
Mynster9361 405cdc6
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
Mynster9361 9d77454
added files from update-commandreference due tothis error from build
Mynster9361 a6a0b8f
Merge branch 'CIS-M365v6.0.1-SPO-tests-Chapter-7' of https://github.c…
Mynster9361 c24c1a7
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
SamErde ec00f86
minor additions and fixes after feedback
Mynster9361 a839c3b
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
SamErde d950cc5
Did not see there already was a PR related to Sharepoint Online.
Mynster9361 2f436ee
Merge branch 'CIS-M365v6.0.1-SPO-tests-Chapter-7' of https://github.c…
Mynster9361 85fd443
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
Mynster9361 8189cb1
Potential fix for pull request finding
SamErde 7b102e2
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
SamErde 9e4f9dd
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
Mynster9361 a2312fc
Potential fix for pull request finding
Mynster9361 362cc01
Merge branch 'main' into CIS-M365v6.0.1-SPO-tests-Chapter-7
SamErde 97ba82f
checked everything tested the 3 implementation / authentication metho…
Mynster9361 a943a95
Merge branch 'CIS-M365v6.0.1-SPO-tests-Chapter-7' of https://github.c…
Mynster9361 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| 7.2.2 (L1) Ensure SharePoint and OneDrive integration with Azure AD B2B is enabled | ||
|
|
||
| Entra ID B2B provides authentication and management of guests. Authentication happens via one-time passcode when they don't already have a work or school account or a Microsoft account. Integration with SharePoint and OneDrive allows for more granular control of how guest user accounts are managed in the organization's AAD, unifying a similar guest experience already deployed in other Microsoft 365 services such as Teams. | ||
|
|
||
| >Note: Global Reader role currently can't access SharePoint using PowerShell. | ||
|
|
||
| ## Rationale | ||
|
|
||
| External users assigned guest accounts will be subject to Entra ID access policies, such as multi-factor authentication. This provides a way to manage guest identities and control access to SharePoint and OneDrive resources. Without this integration, files can be shared without account registration, making it more challenging to audit and manage who has access to the organization's data. | ||
|
|
||
| ## Impact | ||
|
|
||
| B2B collaboration is used with other Entra services so should not be new or unusual. Microsoft also has made the experience seamless when turning on integration on SharePoint sites that already have active files shared with guest users. The referenced Microsoft article on the subject has more details on this. | ||
|
|
||
| ## Remediation | ||
|
|
||
| 1. Connect to SharePoint Online using `Connect-SPOService` | ||
| 2. Run the following command: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -EnableAzureADB2BIntegration $true | ||
| ``` | ||
|
|
||
| >Default Value: False | ||
|
|
||
| ## Related Links | ||
|
|
||
| * [Enabling the integration](https://learn.microsoft.com/en-us/sharepoint/sharepoint-azureb2b-integration#enabling-the-integration) | ||
| * [What is Microsoft Entra B2B collaboration?](https://learn.microsoft.com/en-us/entra/external-id/what-is-b2b) | ||
| * [Set-SPOTenant](https://learn.microsoft.com/en-us/powershell/module/microsoft.online.sharepoint.powershell/set-spotenant?view=sharepoint-ps) | ||
| * [CIS Microsoft 365 Foundations Benchmark v6.0.1 - Page 368](https://www.cisecurity.org/benchmark/microsoft_365) | ||
|
Mynster9361 marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Ensure your SharePoint tenant is integrated with Microsoft Entra B2B for external sharing. | ||
|
|
||
| .DESCRIPTION | ||
| Microsoft Entra B2B integration allows you to manage external sharing in SharePoint Online using Microsoft Entra. With this integration, you can use Microsoft Entra to control access to your SharePoint Online resources, including sites, lists, and libraries. This provides a more secure and streamlined way to manage external sharing in SharePoint Online. | ||
| When Microsoft Entra B2B integration is enabled, you can use Microsoft Entra to create and manage guest users, assign permissions, and monitor access to your SharePoint Online resources. This allows you to have better control over who can access your SharePoint Online resources and what they can do with them. | ||
| The recommended state is EnableAzureADB2BIntegration set to $true. | ||
|
|
||
| .EXAMPLE | ||
| Test-MtCisSpoB2BIntegration | ||
|
|
||
| Returns true if the SharePoint tenant is integrated with Microsoft Entra B2B, false otherwise. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-MtCisSpoB2BIntegration | ||
| #> | ||
| function Test-MtCisSpoB2BIntegration { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
| Write-Verbose "Testing SharePoint Entra B2B integration..." | ||
|
|
||
| $return = $true | ||
| try { | ||
| $B2BIntegration = Get-SPOTenant | Select-Object -ExpandProperty EnableAzureADB2BIntegration | ||
| if ($B2BIntegration) { | ||
| $testResult = "Well done. Your SharePoint tenant is integrated with Microsoft Entra B2B." | ||
| } else { | ||
| $testResult = "Your SharePoint tenant is not integrated with Microsoft Entra B2B." | ||
| $return = $false | ||
| } | ||
| Add-MtTestResultDetail -Result $testResult | ||
| return $return | ||
| } catch { | ||
| Add-MtTestResultDetail -SkippedBecause Error -SkippedError $_ | ||
| return $null | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| 7.2.7 (L1) Ensure link sharing is restricted in SharePoint and OneDrive | ||
|
|
||
| This setting sets the default link type that a user will see when sharing content in OneDrive or SharePoint. It does not restrict or exclude any other options. The recommended state is **Specific people (only the people the user specifies) or Only people in your organization** (more restrictive). | ||
|
Mynster9361 marked this conversation as resolved.
|
||
|
|
||
| ## Rationale | ||
|
|
||
| By defaulting to specific people, the user will first need to consider whether or not the content being shared should be accessible by the entire organization versus select individuals. This aids in reinforcing the concept of least privilege. | ||
|
|
||
| ## Remediation | ||
|
|
||
| 1. Navigate to [SharePoint admin center](https://admin.microsoft.com/sharepoint) | ||
| 2. Click to expand **Policies** > **Sharing**. | ||
| 3. Scroll to **File and folder links.** | ||
| 4. Set **Choose the type of link that's selected by default when users share files and folders in SharePoint and OneDrive to Specific people (only the people the user specifies) or Only people in your organization.** | ||
|
|
||
|
|
||
| ### PowerShell | ||
|
|
||
| 1. Connect to SharePoint Online using `Connect-SPOService` | ||
| 2. Run the following command: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -DefaultSharingLinkType Direct | ||
| ``` | ||
|
|
||
| 3. Or, to set a more restrictive state: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -DefaultSharingLinkType Internal | ||
| ``` | ||
|
Mynster9361 marked this conversation as resolved.
|
||
|
|
||
| >Default Value: Only people in your organization (Internal) | ||
|
|
||
| ## Related Links | ||
|
|
||
| * [Set-SPOTenant](https://learn.microsoft.com/en-us/powershell/module/microsoft.online.sharepoint.powershell/set-spotenant?view=sharepoint-ps) | ||
| * [CIS Microsoft 365 Foundations Benchmark v6.0.1 - Page 381](https://www.cisecurity.org/benchmark/microsoft_365) | ||
|
Mynster9361 marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| 7.2.7 (L1) Ensure link sharing is restricted in SharePoint and OneDrive | ||
|
|
||
| .DESCRIPTION | ||
| By default, the sharing link experience in SharePoint and OneDrive is set to "Anyone with the link". This means that when users share files or folders, the default option allows anyone with the link to access the content, which can lead to unintentional overexposure of sensitive information. By changing the default sharing link type to "Specific people", users are encouraged to be more deliberate about who they share content with, reducing the risk of unauthorized access and supporting a more secure sharing environment. | ||
|
|
||
| .EXAMPLE | ||
| Test-MtCisSpoDefaultSharingLink | ||
|
|
||
| Returns true if the default sharing link type is set to a restrictive option, false otherwise. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-MtCisSpoDefaultSharingLink | ||
| #> | ||
| function Test-MtCisSpoDefaultSharingLink { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
| Write-Verbose "Testing default sharing link type in SharePoint Online..." | ||
|
|
||
| $return = $true | ||
| try { | ||
| $DefaultSharingLinkType = Get-SPOTenant | Select-Object -ExpandProperty DefaultSharingLinkType | ||
| if ($DefaultSharingLinkType -eq "Direct" -or $DefaultSharingLinkType -eq "Internal") { | ||
| $testResult = "Well done. Default sharing link type is set to a restrictive option." | ||
| } else { | ||
| $testResult = "Default sharing link type is not set to a restrictive option." | ||
| $return = $false | ||
| } | ||
| Add-MtTestResultDetail -Result $testResult | ||
| return $return | ||
| } catch { | ||
| Add-MtTestResultDetail -SkippedBecause Error -SkippedError $_ | ||
| return $null | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
powershell/public/cis/Test-MtCisSpoDefaultSharingLinkPermission.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| 7.2.11 (L1) Ensure the SharePoint default sharing link permission is set | ||
|
|
||
| This setting configures the permission that is selected by default for sharing link from a SharePoint site. | ||
|
|
||
| The recommended state is **View**. | ||
|
|
||
| ## Rationale | ||
|
|
||
| Setting the view permission as the default ensures that users must deliberately select the edit permission when sharing a link. This approach reduces the risk of unintentionally granting edit privileges to a resource that only requires read access, supporting the principle of least privilege. | ||
|
|
||
| ## Impact | ||
|
|
||
| Not applicable. | ||
|
|
||
| ## Remediation | ||
|
|
||
| 1. Navigate to [SharePoint admin center](https://admin.microsoft.com/sharepoint) | ||
| 2. Click to expand **Policies** > **Sharing**. | ||
| 3. Scroll to **File and folder links.** | ||
| 4. Ensure **Choose the permission that's selected by default for sharing links** is set to **View**. | ||
|
|
||
| ### PowerShell | ||
|
|
||
| 1. Connect to SharePoint Online using `Connect-SPOService` | ||
| 2. Run the following command: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -DefaultLinkPermission View | ||
| ``` | ||
|
|
||
| >Default Value: DefaultLinkPermission : Edit | ||
|
|
||
| ## Related Links | ||
|
|
||
| * [Manage sharing settings for SharePoint and OneDrive in Microsoft 365](https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off#file-and-folder-links) | ||
| * [CIS Microsoft 365 Foundations Benchmark v6.0.1 - Page 391](https://www.cisecurity.org/benchmark/microsoft_365) | ||
|
Mynster9361 marked this conversation as resolved.
Outdated
|
||
37 changes: 37 additions & 0 deletions
37
powershell/public/cis/Test-MtCisSpoDefaultSharingLinkPermission.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| 7.2.11 (L1) Ensure the SharePoint default sharing link permission is set | ||
|
|
||
| .DESCRIPTION | ||
| By default, the sharing link permission in SharePoint and OneDrive is set to "Edit". This means that when users share files or folders, the default option allows recipients to edit the content, which can lead to unintentional modifications or deletions of sensitive information. By changing the default sharing link permission to "View", users are encouraged to be more deliberate about granting edit permissions, reducing the risk of unauthorized changes and supporting a more secure sharing environment. | ||
|
|
||
| .EXAMPLE | ||
| Test-MtCisSpoDefaultSharingLinkPermission | ||
|
|
||
| Returns true if the default sharing link permission is set to a restrictive option, false otherwise. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-MtCisSpoDefaultSharingLinkPermission | ||
| #> | ||
| function Test-MtCisSpoDefaultSharingLinkPermission { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
| Write-Verbose "Testing default sharing link permission in SharePoint Online..." | ||
|
|
||
| $return = $true | ||
| try { | ||
| $DefaultLinkPermission = Get-SPOTenant | Select-Object -ExpandProperty DefaultLinkPermission | ||
| if ($DefaultLinkPermission -eq "View") { | ||
| $testResult = "Well done. Default sharing link permission is set to View." | ||
| } else { | ||
| $testResult = "Default sharing link permission is not set to View." | ||
| $return = $false | ||
| } | ||
| Add-MtTestResultDetail -Result $testResult | ||
| return $return | ||
| } catch { | ||
| Add-MtTestResultDetail -SkippedBecause Error -SkippedError $_ | ||
| return $null | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| 7.2.9 (L1) Ensure guest access to a site or OneDrive will expire automatically | ||
|
|
||
| This policy setting configures the expiration time for each guest that is invited to the SharePoint site or with whom users share individual files and folders with. | ||
|
|
||
| The recommended state is **30** or less. | ||
|
|
||
| ## Rationale | ||
|
|
||
| This setting ensures that guests who no longer need access to the site or link no longer have access after a set period of time. Allowing guest access for an indefinite amount of time could lead to loss of data confidentiality and oversight. | ||
|
|
||
| >Note: Guest membership applies at the Microsoft 365 group level. Guests who have permission to view a SharePoint site or use a sharing link may also have access to a Microsoft Teams team or security group. | ||
|
|
||
| ## Impact | ||
|
|
||
| Site collection administrators will have to renew access to guests who still need access after 30 days. They will receive an e-mail notification once per week about guest access that is about to expire. | ||
|
|
||
| >Note: The guest expiration policy only applies to guests who use sharing links or guests who have direct permissions to a SharePoint site after the guest policy is enabled. The guest policy does not apply to guest users that have pre-existing permissions or access through a sharing link before the guest expiration policy is applied. | ||
|
|
||
| ## Remediation | ||
|
|
||
| 1. Navigate to [SharePoint admin center](https://admin.microsoft.com/sharepoint) | ||
| 2. Click to expand **Policies** > **Sharing**. | ||
| 3. Scroll to and expand **More external sharing settings.** | ||
| 4. Set **Guest access to a site or OneDrive will expire automatically after this many days** to ***30*** | ||
|
|
||
| ### PowerShell | ||
|
|
||
| 1. Connect to SharePoint Online using `Connect-SPOService` | ||
| 2. Run the following command: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -ExternalUserExpireInDays 30 -ExternalUserExpirationRequired $True | ||
| ``` | ||
|
|
||
| >Default Value: ExternalUserExpirationRequired $false, ExternalUserExpireInDays 60 days | ||
|
|
||
| ## Related Links | ||
|
|
||
| * [Manage sharing settings for SharePoint and OneDrive in Microsoft 365](https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off#change-the-organization-level-external-sharing-setting) | ||
| * [Managing SharePoint Online Security: A Team Effort](https://learn.microsoft.com/en-us/microsoft-365/community/sharepoint-security-a-team-effort) | ||
| * [CIS Microsoft 365 Foundations Benchmark v6.0.1 - Page 385](https://www.cisecurity.org/benchmark/microsoft_365) | ||
|
Mynster9361 marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| 7.2.9 (L1) Ensure guest access to a site or OneDrive will expire automatically | ||
|
|
||
| .DESCRIPTION | ||
| By default, guest access to a SharePoint site or OneDrive does not expire. | ||
| This means that once a guest user is granted access to a site or OneDrive, they will have indefinite access until manually removed by an administrator. Enabling automatic expiration of guest access helps to ensure that external users do not retain access to sensitive information longer than necessary, reducing the risk of unauthorized access and supporting a more secure sharing environment. The recommended state is to enable guest access expiration and set it to 30 days or less. | ||
|
|
||
| .EXAMPLE | ||
| Test-MtCisSpoGuestAccessExpiry | ||
|
|
||
| Returns true if guest access expiration is enabled and set to 30 days or less, false otherwise. | ||
|
|
||
| .LINK | ||
| https://maester.dev/docs/commands/Test-MtCisSpoGuestAccessExpiry | ||
| #> | ||
| function Test-MtCisSpoGuestAccessExpiry { | ||
| [CmdletBinding()] | ||
| [OutputType([bool])] | ||
| param() | ||
| Write-Verbose "Testing guest access expiration settings in SharePoint Online..." | ||
|
|
||
| $return = $true | ||
| try { | ||
| $spoTenant = Get-SPOTenant | ||
| if ($spoTenant.ExternalUserExpirationRequired -eq $true -and $spoTenant.ExternalUserExpireInDays -gt 0 -and $spoTenant.ExternalUserExpireInDays -le 30) { | ||
| $testResult = "Well done. Guest access expiration is enabled and set to 30 days or less ($($spoTenant.ExternalUserExpireInDays) days)." | ||
| } else { | ||
| $testResult = "Guest access expiration is not enabled or set to more than 30 days." | ||
| $return = $false | ||
| } | ||
| Add-MtTestResultDetail -Result $testResult | ||
| return $return | ||
| } catch { | ||
| Add-MtTestResultDetail -SkippedBecause Error -SkippedError $_ | ||
| return $null | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
powershell/public/cis/Test-MtCisSpoGuestCannotShareUnownedItem.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| 7.2.5 (L2) Ensure that SharePoint guest users cannot share items they don't own | ||
|
|
||
| SharePoint gives users the ability to share files, folders, and site collections. Internal users can share with external collaborators, and with the right permissions could share to other external parties. | ||
|
|
||
| ## Rationale | ||
|
|
||
| Sharing and collaboration are key; however, file, folder, or site collection owners should have the authority over what external users get shared with to prevent unauthorized disclosures of information. | ||
|
|
||
| ## Impact | ||
|
|
||
| The impact associated with this change is highly dependent upon current practices. If users do not regularly share with external parties, then minimal impact is likely. However, if users do regularly share with guests/externally, minimum impacts could occur as those external users will be unable to 're-share' content. | ||
|
|
||
| ## Remediation | ||
|
|
||
| 1. Navigate to [SharePoint admin center](https://admin.microsoft.com/sharepoint) | ||
| 2. Click to expand **Policies** > **Sharing**. | ||
| 3. Scroll to and expand **More external sharing settings.**, uncheck **Allow guests to share items they don't own.** | ||
| 4. Click **Save**. | ||
|
|
||
| ### PowerShell | ||
|
|
||
| 1. Connect to SharePoint Online using `Connect-SPOService` | ||
| 2. Run the following command: | ||
|
|
||
| ```powershell | ||
| Set-SPOTenant -PreventExternalUsersFromResharing $True | ||
| ``` | ||
|
|
||
| >Default Value: Checked (False) | ||
|
|
||
| ## Related Links | ||
|
|
||
| * [Manage sharing settings for SharePoint and OneDrive in Microsoft 365](https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off#change-the-organization-level-external-sharing-setting) | ||
| * [Overview of external sharing in SharePoint and OneDrive in Microsoft 365](https://learn.microsoft.com/en-us/sharepoint/external-sharing-overview) | ||
| * [CIS Microsoft 365 Foundations Benchmark v6.0.1 - Page 376](https://www.cisecurity.org/benchmark/microsoft_365) | ||
|
Mynster9361 marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.