turbot/steampipe-mod-microsoft365-compliance

Control: 7.2.5 Ensure that SharePoint guest users cannot share items they don't own

Description

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.

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.

Remediation

To remediate using the UI:

  1. Navigate to SharePoint admin center https://admin.microsoft.com/sharepoint.
  2. Click to expand Policies then select Sharing.
  3. Expand More external sharing settings, uncheck Allow guests to share items they don't own.
  4. Click Save.

To remediate using PowerShell:

  1. Connect to SharePoint Online service using Connect-SPOService.
  2. Run the following SharePoint Online PowerShell command:
Set-SPOTenant -PreventExternalUsersFromResharing $True

Default Value

Checked (False)

Usage

Run the control in your terminal:

powerpipe control run microsoft365_compliance.control.cis_v500_7_2_5

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run microsoft365_compliance.control.cis_v500_7_2_5 --share

SQL

This control uses a named query:

select
tenant_id as resource,
case
when not (sharepoint_settings -> 'is_resharing_by_external_users_enabled')::bool then 'ok'
else 'alarm'
end as status,
case
when not (sharepoint_settings -> 'is_resharing_by_external_users_enabled')::bool then title || ' SharePoint guest users cannot share items they don''t own.'
else title || ' SharePoint guest users can share items they don''t own.'
end as reason
, tenant_id as tenant_id
from
microsoft365_organization;

Tags