Skip to main content
Five Steps for Cloud Compliance Readiness·A practical playbook for security teamsDownload
CIS Microsoft 365 Foundations v7.0.0 · 2.1.5

Safe Attachments should be turned on for SharePoint, OneDrive and Teams

  • E5 Level 2
  • Microsoft Defender
  • Automated check

This check looks at whether Defender for Office 365 scans files in SharePoint, OneDrive and Microsoft Teams for malware. The safe setting is that the protection is turned on for the tenant; it requires a Defender for Office 365 plan.

Why it matters

Email filters only see files that arrive by email. Once a file is uploaded to a SharePoint library, a OneDrive folder or a Teams chat, it can be shared widely and opened by many people. If a malicious file gets in through a compromised account or an external share, nothing stops colleagues opening it. Safe Attachments for these services detects malicious files after upload and blocks them from being opened, moved, copied or shared.

See Microsoft's description in Safe Attachments for SharePoint, OneDrive, and Microsoft Teams.

How to check it yourself

In the Microsoft Defender portal go to Email & collaboration > Policies & rules > Threat policies > Safe Attachments, select Global settings and read Turn on Defender for Office 365 for SharePoint, OneDrive, and Microsoft Teams.

Read-only Exchange Online PowerShell, and a SharePoint Online check for the related download block:

Connect-ExchangeOnline
Get-AtpPolicyForO365 | Format-List EnableATPForSPOTeamsODB

Connect-SPOService -Url https://TENANT-admin.sharepoint.com
Get-SPOTenant | Format-List DisallowInfectedFileDownload

EnableATPForSPOTeamsODB should be True.

How to fix it

Confirm your tenant has a Defender for Office 365 plan, then turn the toggle on in Global settings and save. Settings can take up to 30 minutes to apply. Microsoft also recommends blocking downloads of detected files and creating an alert policy so admins are told about detections.

PowerShell (this changes your tenant, so run it yourself; ConfigCobra never changes your environment):

Set-AtpPolicyForO365 -EnableATPForSPOTeamsODB $true
Set-SPOTenant -DisallowInfectedFileDownload $true

What changes when you fix it

When a file is identified as malicious, users can no longer open, move, copy or share it, but they can still delete it. With the download block also on, nobody including admins can download the file, which matters if an admin needs to inspect a sample. Clean files are unaffected. Security administrators may receive alerts for detections, so decide who should get them. If your tenant does not have a Defender for Office 365 plan, the setting cannot be used, so check licensing before you plan the change. Tell SharePoint site owners and Teams users beforehand that a blocked file is expected behaviour and should be reported to the security team rather than worked around.

Included in

BenchmarkCIS IDProfile
CIS Microsoft 365 Foundations v7.0.02.1.5E5 Level 2

Check this on your Microsoft 365

ConfigCobra runs this check with every other control of the CIS Microsoft 365 Foundations Benchmark, read-only.

Get in touch

Let's talk.

Whether you're evaluating ConfigCobra, running an audit, or managing a client fleet — we respond within one business day.

Free trial