turbot/steampipe-mod-microsoft365-compliance

Control: 7.2.6 Ensure SharePoint external sharing is managed through domain whitelist/blacklists

Description

Control sharing of documents to external domains by either blocking domains or only allowing sharing with specific named domains.

Attackers will often attempt to expose sensitive information to external entities through sharing, and restricting the domains that users can share documents with will reduce that surface area.

Remediation

To remediate using the UI:

  1. Navigate to SharePoint admin center https://admin.microsoft.com/sharepoint.
  2. Expand Policies then click Sharing.
  3. Expand More external sharing settings and check Limit external sharing by domain.
  4. Select Add domains to add a list of approved domains.
  5. Click Save at the bottom of the page.

To remediate using PowerShell:

  1. Connect to SharePoint Online using Connect-SPOService.
  2. Run the following PowerShell command:
Set-SPOTenant -SharingDomainRestrictionMode AllowList -
SharingAllowedDomainList "domain1.com domain2.com"

Default Value

Limit external sharing by domain is unchecked SharingDomainRestrictionMode: None SharingDomainRestrictionMode: <Undefined>

Usage

Run the control in your terminal:

powerpipe control run microsoft365_compliance.control.cis_v500_7_2_6

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
tenant_id as resource,
case
when jsonb_array_length(sharepoint_settings -> 'sharing_allowed_domain_list') > 0 then 'ok'
else 'alarm'
end as status,
case
when jsonb_array_length(sharepoint_settings -> 'sharing_allowed_domain_list') > 0 then title || ' sharepoint external sharing is managed through domain whitelist/blacklists.'
else title || ' sharepoint external sharing is not managed through domain whitelist/blacklists.'
end as reason
, tenant_id as tenant_id
from
microsoft365_organization;

Tags