Safe Links in Microsoft Defender for Office 365

What are Safe Links?

In organizations with Microsoft Defender for Office 365, Safe Links scanning protects your organization from malicious links that are used in phishing and other attacks. Specifically, Safe Links provides URL scanning and rewriting of inbound email messages during mail flow, and time-of-click verification of URLs and links in email messages, Teams, and supported Office 365 apps. Safe Links scanning occurs in addition to regular anti-spam and anti-malware protection.

Although there’s no default Safe Links policy, the Built-in protection preset security policy provides Safe Links protection in e-mail messages, Microsoft Teams, and files in supported Office apps to all recipients for customers that have at least one Defender for Office 365 license (users who aren’t defined in the Standard or Strict preset security policies or in custom Safe Links policies). You can also create Safe Links policies that apply to specific users, group, or domains.

Safe Links protection by Safe Links policies is available in the following locations:

  • Email messages: Safe Links protection for links in email messages.

     Note

    Safe Links does not work on mail-enabled public folders.

    Safe Links supports only HTTP(S) and FTP formats.

    Using another service to wrap links before Defender for Office 365 might prevent Safe Links from process links, including wrapping, detonating, or otherwise validating the “maliciousness” of the link.

  • Microsoft Teams: Safe Links protection for links in Teams conversations, group chats, or from channels.
  • Office apps: Safe Links protection for supported Office desktop, mobile, and web apps.

You need to specify the recipient conditions and exceptions that determine who the policy applies to. You can use these properties for conditions and exceptions:

  • Users
  • Groups
  • Domains

You can only use a condition or exception once, but the condition or exception can contain multiple values. Multiple values of the same condition or exception use OR logic (for example, <recipient1> or <recipient2>). Different conditions or exceptions use AND logic (for example, <recipient1> and <member of group 1>).

 Important

Multiple different types of conditions or exceptions are not additive; they’re inclusive. The policy is applied only to those recipients that match all of the specified recipient filters. For example, you configure a recipient filter condition in the policy with the following values:

  • Users: romain@contoso.com
  • Groups: Executives

The policy is applied to romain@contoso.com only if he’s also a member of the Executives group. If he’s not a member of the group, then the policy is not applied to him.

Likewise, if you use the same recipient filter as an exception to the policy, the policy is not applied to romain@contoso.com only if he’s also a member of the Executives group. If he’s not a member of the group, then the policy still applies to him.

 

Safe Links scans incoming email for known malicious hyperlinks. Scanned URLs are rewritten or wrapped using the Microsoft standard URL prefix: https://nam01.safelinks.protection.outlook.com. After the link is rewritten, it’s analyzed for potentially malicious content.

After Safe Links rewrites a URL, the URL remains rewritten even if the message is manually forwarded or replied to (both to internal and external recipients). Additional links that are added to the forwarded or replied-to message aren’t rewritten.

For automatic forwarding by Inbox rules or SMTP forwarding, the URL isn’t rewritten in the message that’s intended for the final recipient unless one of the following statements is true:

  • The recipient is also protected by Safe Links.
  • The URL was already rewritten in a previous communication.

As long as Safe Links protection is turned on, URLs are scanned prior to message delivery, regardless of whether the URLs are rewritten or not. In supported versions of Outlook (Outlook for Desktop version 16.0.12513 or later), unwrapped URLs are checked by a client-side API call to Safe Links at the time of click.

The settings in Safe Links policies that apply to email messages are described in the following list:

  • On: Safe Links checks a list of known, malicious links when users click links in email. URLs are rewritten by default.: Turn on or turn off Safe Links scanning in email messages. The recommended value is selected (on), and results in the following actions:
    • Safe Links scanning is turned on in Outlook (C2R) on Windows.
    • URLs are rewritten and users are routed through Safe Links protection when they click URLs in messages.
    • When clicked, URLs are checked against a list of known malicious URLs.
    • URLs that don’t have a valid reputation are detonated asynchronously in the background.

    The following settings are available only if Safe Links scanning in email messages is turned on:

    • Apply Safe Links to email messages sent within the organization: Turn on or turn off Safe Links scanning on messages sent between internal senders and internal recipients within the same Exchange Online organization. The recommended value is selected (on).
    • Apply real-time URL scanning for suspicious links and links that point to files: Turns on real-time scanning of links, including links in email messages that point to downloadable content. The recommended value is selected (on).
      • Wait for URL scanning to complete before delivering the message:
        • Selected (on): Messages that contain URLs are held until scanning is finished. Messages are delivered only after the URLs are confirmed to be safe. This is the recommended value.
        • Not selected (off): If URL scanning can’t complete, deliver the message anyway.
    • Do not rewrite URLs, do checks via SafeLinks API only: If this setting is selected (on), no URL wrapping takes place. In supported versions of Outlook (Outlook for Desktop version 16.0.12513 or later), Safe Links is called exclusively via APIs at the time of URL click.

     

How Safe Links works in email messages

At a high level, here’s how Safe Links protection works on URLs in email messages:

  1. All email goes through EOP, where internet protocol (IP) and envelope filters, signature-based malware protection, anti-spam and anti-malware filters before the message is delivered to the recipient’s mailbox.
  2. The user opens the message in their mailbox and clicks on a URL in the message.
  3. Safe Links immediately checks the URL before opening the website:
    • If the URL points to a website that has been determined to be malicious, a malicious website warning page (or a different warning page) opens.
    • If the URL points to a downloadable file, and the Apply real-time URL scanning for suspicious links and links that point to files setting is turned on in the policy that applies to the user, the downloadable file is checked.
    • If the URL is determined to be safe, the website opens.

 

You turn on or turn off Safe Links protection for Microsoft Teams in Safe Links policies. Specifically, you use the On: Safe Links checks a list of known, malicious links when users click links in Microsoft Teams. URLs are not rewritten setting in the Teams section. The recommended value is on (selected).

 Note

When you turn on or turn off Safe Links protection for Teams, it might take up to 24 hours for the change to take effect.

URLs in Teams are checked against a list of known malicious links when the protected user clicks the link (time-of-click protection). URLs aren’t rewritten. If a link is found to be malicious, users have the following experiences:

  • If the link was clicked in a Teams conversation, group chat, or from channels, the warning page as shown in the screenshot appears in the default web browser.
  • If the link was clicked from a pinned tab, the warning page appears in the Teams interface within that tab. The option to open the link in a web browser is disabled for security reasons.
  • Depending on how the Let users click through to the original URL setting in the policy is configured, the user is or isn’t allowed to click through to the original URL (Continue anyway (not recommended) in the screenshot). We recommend that you don’t select the Let users click through to the original URL setting so users can’t click through to the original URL.

If the user who sent the link isn’t protected by a Safe Links policy where Teams protection is turned on, the user is free to click through to the original URL on their computer or device.

 

Clicking the Go Back button on the warning page returns the user to their original context or URL location. However, clicking on the original link again causes Safe Links to rescan the URL, so the warning page reappears.

At a high level, here’s how Safe Links protection works for URLs in Microsoft Teams:

  1. A user starts the Teams app.
  2. Microsoft 365 verifies that the user’s organization includes Microsoft Defender for Office 365, and that the user is included in an active Safe Links policy where protection for Microsoft Teams is turned on.
  3. URLs are validated at the time of click for the user in chats, group chats, channels, and tabs.

 

Safe Links protection for Office apps checks links in Office documents, not links in email messages. But, it can check links in attached Office documents in email messages after the document is opened.

You turn on or turn off Safe Links protection for Office apps in Safe Links policies. Specifically, you use the On: Safe Links checks a list of known, malicious links when users click links in Microsoft Office apps. URLs are not rewritten setting in the Office 365 apps section. The recommended value is on (selected).

Safe Links protection for Office apps has the following client requirements:

  • Microsoft 365 Apps or Microsoft 365 Business Premium:
    • Current versions of Word, Excel, and PowerPoint on Windows, Mac, or in a web browser.
    • Office apps on iOS or Android devices.
    • Visio on Windows.
    • OneNote in a web browser.
    • Outlook for Windows when opening saved EML or MSG files.
  • Supported Office apps and Microsoft 365 services are configured to use modern authentication.
  • Users are signed in using their work or school accounts.

 

At a high level, here’s how Safe Links protection works for URLs in Office apps. The supported Office apps are described in the previous section.

  1. A user signs in using their work or school account in an organization that includes Microsoft 365 Apps or Microsoft 365 Business Premium.
  2. The user opens and clicks on a link an Office document in a supported Office app.
  3. Safe Links immediately checks the URL before opening the target website:
    • If the URL points to a website that has been determined to be malicious, a malicious website warning page (or a different warning page) opens.
    • If the URL points to a downloadable file, and the Safe Links policy that applies to the user is configured to scan links to downloadable content (Apply real-time URL scanning for suspicious links and links that point to files), the downloadable file is checked.
    • If the URL is considered safe, the user is taken to the website.
    • If Safe Links scanning is unable to complete, Safe Links protection doesn’t trigger. In Office desktop clients, the user is warned before they proceed to the destination website.

 Note

It may take several seconds at the beginning of each session to verify that Safe Links for Office apps is available to the user.

 

These settings apply to Safe Links in email, Teams, and Office apps:

  • Track user clicks: Turn on or turn off storing Safe Links click data for URLs clicked. We recommend that you leave this setting selected (on).In Safe Links for Office apps, this setting applies to the desktop versions Word, Excel, PowerPoint, and Visio.If you select this setting, the following settings are available:
    • Let users click through to the original URL: Controls whether users can click through the warning page to the original URL. The recommend value is not selected (off).In Safe Links for Office apps, this setting applies to the original URL in the desktop versions Word, Excel, PowerPoint, and Visio.
    • Display the organization branding on notification and warning pages: This option shows your organization’s branding on warning pages. Branding helps users identify legitimate warnings, because default Microsoft warning pages are often used by attackers.

After you create multiple policies, you can specify the order that they’re applied. No two policies can have the same priority, and policy processing stops after the first policy is applied (the highest priority policy for that recipient). The Built-in protection policy is always applied last. The Safe Links policies associated Standard and Strict preset security policies are always applied before custom Safe Links policies.