Language:EN
Let's talk
← Back to insightsInsights

Phishing protection in Microsoft 365: how to harden your organisation with SPF, DKIM and DMARC

Reading time: 5 min ·

Did you know that in 2022 more than 26% of cyberthreats in Spain were phishing attacks that used Trojans to infect devices? According to ESET's Threat Report, attackers combined phishing techniques with Trojan malware, tricking users into downloading or running malicious programs that looked legitimate but actually let the attackers access sensitive information or control the infected system. Cybercriminals keep refining their techniques to deceive unsuspecting users, stealing information and reaching critical business systems. Your organisation could be next.

Protecting your domain with Microsoft 365

Microsoft 365 offers the tools needed to protect your domain against these attacks, but they have to be configured and/or enabled to be effective.

They are not always enabled by default. These settings not only protect your email; they are also part of the security improvements we check in our audits and apply in our comprehensive protection service. Find out more about the security issues and vulnerabilities Allbit Solutions can help you mitigate.

Source: ESET Threat Report

Against this growing threat landscape, Microsoft 365 offers the tools needed to protect your domain. Email authentication protocols such as SPF, DKIM and DMARC are your best allies to make sure that the email sent and received from your domain is authentic and free from spoofing.

In this article we show you how to configure these protocols in Microsoft 365 to improve your protection against phishing attacks.

It is time to harden your business before it is too late!

What are SPF, DKIM and DMARC and why do they matter?

To protect your domain and the email you send and receive, it is essential to implement SPF, DKIM and DMARC. These three technologies work together to validate email and make sure it is not spoofed.

SPF (Sender Policy Framework)

Defines which servers can send email on behalf of your domain, helping to prevent spoofing of sender addresses.

  • Recommended SPF record:
    • v=spf1 include:spf.protection.outlook.com -all
  • Explanation:
    • v=spf1: indicates that version 1 of SPF is being used.
    • include:spf.protection.outlook.com: allows Microsoft 365 servers to send email on behalf of your domain.
    • -all: specifies that any server not included in the list must be considered unauthorised to send email from your domain.

Configuring SPF in Microsoft 365

To configure SPF and protect your domain against spoofing, follow these steps:

  1. Sign in to your domain provider's admin panel.
  2. Create a new record or edit the existing one with these values:
    • Type: TXT
    • Host name: @
    • Value: v=spf1 include:spf.protection.outlook.com -all
  3. Save the changes.

Note: if you send email from other servers, include those servers in the SPF record. Only authorised servers should be listed.

Additional considerations for SPF in Microsoft 365

Enable SPF record: hard fail in the Microsoft 365 anti-spam policies so that unauthorised email is rejected automatically.

  1. Go to the M365 admin center.
  2. Navigate to Security > Anti-spam policies.
    https://security.microsoft.com/antispam
  3. Find the section on SPF checking and enable SPF record: hard fail.

DKIM (DomainKeys Identified Mail)

DKIM adds a digital signature to email sent from your domain, allowing the recipient to verify that the message was not altered in transit.

  1. Host name: selector1._domainkey
  2. Value: selector1-your-domain-com._domainkey.tenantdomain.onmicrosoft.com
  3. Repeat for selector2._domainkey.

Configuring DKIM in Microsoft 365

  1. Go to the Microsoft Defender portal.
  2. Select Policies & Rules > Threat policies > Email Authentication Settings > DKIM.
    https://security.microsoft.com/authentication?viewid=DKIM
  3. Select the domain where you will configure DKIM and copy the records shown.

Steps at your domain provider

  1. Go to your domain provider's admin panel.
  2. Create the following records:
    • Type: CNAME
    • Host name: selector1._domainkey
    • Value: selector1-your-domain-com._domainkey.tenantdomain.onmicrosoft.com
      Then repeat these values for selector2._domainkey.
  3. Save the changes.
  4. Go back to the Microsoft Defender portal and enable DKIM signing for your email.

Note: the new DNS records can take up to 48 hours to propagate.

DMARC (Domain-based Message Authentication, Reporting & Conformance)

DMARC coordinates SPF and DKIM to define what happens to unauthenticated email and provides detailed reports on possible abuse of the domain.

  • Example DMARC record:
    • v=DMARC1;
      p=quarantine;
      rua=mailto:your-email@yourdomain.com;
      ruf=mailto:your-email@yourdomain.com; fo=1
  • Explanation:
    • v=DMARC1: indicates DMARC version 1.
    • p=quarantine: defines the policy for email that fails the SPF or DKIM checks.
      In this case, suspicious messages are quarantined.
    • rua=mailto:…: address where aggregate DMARC reports, summarising email authentication, are sent.
    • ruf=mailto:…: address where detailed failure reports are sent for email that failed authentication.
    • fo=1: requests a failure report for any message that fails SPF or DKIM validation.

Additional considerations for DMARC in Microsoft 365

It is important to understand that DMARC determines how other servers should treat email sent from your domain if it fails the SPF or DKIM checks. By setting p=quarantine or p=reject, external servers can handle unauthenticated email effectively, moving it to the spam folder or rejecting it.

Every organisation should configure DMARC correctly to protect itself against spoofing and other email abuse. It is essential that the anti-phishing policies in Microsoft 365 are aligned with your DMARC record. Adjusting anti-phishing policies in Microsoft 365:

  1. Go to the Microsoft Defender portal.
  2. Go to Policies & Rules under Email & Collaboration.
  3. Open the Anti-phishing policies section.
    https://security.microsoft.com/antiphishing
  4. Check that every active policy is configured correctly.

Protect your domain, protect your business

Configuring SPF, DKIM and DMARC is essential to protect your domain's reputation and your company's security. At Allbit Solutions we can help you implement these protocols and strengthen your defences. Contact us now and our team will be ready to help you put these measures in place! Contact us here

Useful links

These resources provide up-to-date data and detailed guides on phishing threats and security settings in Microsoft 365 (some sources are in Spanish):

  1. Phishing and cybersecurity statistics:
  2. Security settings in Microsoft 365:

Shall we talk about your Microsoft environment?

Talk to a specialist →