Better Email with SPF, DKIM, and DMARC
Jim Wagner, Technology Coordinator
Arcadia Valley R-II School District
Ironton, Missouri
jwagner@avr2.org
Last updated July 2020
Introduction
Have your users experienced any of these problems?
How did email get to be such a threat?
Internet email was first used by a small, trusted group of researchers. That group has expanded to billions of people of all kinds bringing us
What’s the weakest link in data security?
Our users, of course. They
User education is critical, but it’s hard
Some things we can’t fix.
Then there are things we can do to protect our users and our data.
G Suite Toolbox Check MX Tool
https://toolbox.googleapps.com/apps/checkmx/
MX Tool Sample Output
The report on our domain originally looked something like this.
3 Admin Tools for User Protection and Email Integrity
SPF, DKIM, DMARC
Google and other major mail providers already analyze messages with these tools, but it’s up to each sending domain to configure them to reap the benefits.
Why SPF, DKIM, and DMARC?
Increased Email Integrity with SPF+DKIM+DMARC
SPF - Sender Policy Framework
SPF - Sender Policy Framework
SPF - Sender Policy Framework
DNS lookups
Take your SPF live
SPF Caveats - With Encouragement
DKIM - DomainKeys Identified Mail
Implement DKIM Signing for Devices
Configure G Suite SMTP Relay Service
DMARC - Introduction
DMARC - Why use it?
DMARC - Why use it?
Without DMARC and its reporting feature you have no idea to what extent your domain is being forged (abused), much less have any control over it. It can be a real eye opener.
Over two very atypical days in July 2020, Yahoo reported receiving over 444,000 emails that appeared to be from our domain, which has only about 1,000 users. Essentially all of those messages were forgeries, malicious in some way. Thanks to DMARC those forged messages to Yahoo were blocked.
DMARC DNS TXT Record Format
DMARC Policy Record Examples
Headers of DMARC-Passed Message
Received: by 10.114.82.136 with SMTP id i8csp330009ldy;� Thu, 29 Sep 2016 06:54:14 -0700 (PDT)�X-Received: by 10.107.205.65 with SMTP id d62mr2848545iog.221.1475157254397;� Thu, 29 Sep 2016 06:54:14 -0700 (PDT)�Return-Path: <xxxxx@avr2.org>�Received-SPF: pass (google.com: domain of xxxxx@avr2.org designates 2607:f8b0:4001:c0b::22a as permitted sender) client-ip=2607:f8b0:4001:c0b::22a;�Authentication-Results: mx.google.com;� dkim=pass header.i=@avr2.org;� spf=pass (google.com: domain of xxxxx@avr2.org designates 2607:f8b0:4001:c0b::22a as permitted sender) smtp.mailfrom=xxxxx@avr2.org;� dmarc=pass (p=QUARANTINE dis=NONE) header.from=avr2.org�Received: by mail-it0-x22a.google.com with SMTP id r192so174728442ita.0� for <yyyyy@avr2.org>; Thu, 29 Sep 2016 06:54:14 -0700 (PDT)�DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;� d=avr2.org; s=google;� h=mime-version:in-reply-to:references:from:date:message-id:subject:to;� bh=CV0gT45fS+rXEYE2qoK7YWlUiPgVO1Hk1fgu09Qq21E=;� b=cLigjs4sViPtNAxj1zJ3/1gvetGOLyLQKN046Z2mWeu3JIS0yORqP5u6hWycRGonKh� Kc1T8NrSbMTZEO0sfEzzgOn1+tXblSmEqWpoVh5WTsGoVbrAxt57cr/kfhcWXkta5K//� tnmSrt6EjKa02RKMBLYrXk8WnXalY6fOl9COY=�
Headers of DMARC-Quarantined Message
Received: by 10.114.10.227 with SMTP id l3csp1878602ldb;� Mon, 29 Aug 2016 18:29:31 -0700 (PDT)�X-Received: by 10.194.123.228 with SMTP id md4mr678908wjb.91.1472520571146;� Mon, 29 Aug 2016 18:29:31 -0700 (PDT)�Return-Path: <xxxxx@avr2.org>�Received: from ks209126.kimsufi.com (ks209126.kimsufi.com. [94.23.240.148])� by mx.google.com with ESMTPS id eu7si35351789wjc.142.2016.08.29.18.29.26� (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);� Mon, 29 Aug 2016 18:29:31 -0700 (PDT)�Received-SPF: softfail (google.com: domain of transitioning xxxxx@avr2.org does not designate 94.23.240.148 as permitted sender) client-ip=94.23.240.148;�Authentication-Results: mx.google.com;� spf=softfail (google.com: domain of transitioning xxxxx@avr2.org does not designate 94.23.240.148 as permitted sender) smtp.mailfrom=xxxxx@avr2.org;� dmarc=fail (p=QUARANTINE dis=QUARANTINE) header.from=avr2.org�Received: from localhost (localhost.localdomain [127.0.0.1])� by ks209126.kimsufi.com (Postfix) with ESMTP id DEFA46F22F82;� Tue, 30 Aug 2016 00:19:14 +0200 (CEST)
Sample DMARC Aggregate Records
-<record>�-<row>�<source_ip>2607:f8b0:400d:c0d::22a</source_ip>�<count>16</count>�-<policy_evaluated>�<disposition>none</disposition> PASS�<dkim>pass</dkim> ALIGNED�<spf>pass</spf> ALIGNED�</policy_evaluated>�</row>�-<identifiers>�<header_from>avr2.org</header_from>�</identifiers>�-<auth_results>�-<dkim>�<domain>avr2.org</domain> = header_from�<result>pass</result>�<selector>google</selector>�</dkim>�-<spf>�<domain>avr2.org</domain> = header_from�<result>pass</result>�</spf>�</auth_results>�</record>
-<record>�-<row>�<source_ip>208.117.52.23</source_ip>�<count>1</count>�-<policy_evaluated>�<disposition>quarantine</disposition> FAIL�<dkim>fail</dkim> BECAUSE NOT ALIGNED�<spf>fail</spf> BECAUSE NOT ALIGNED�</policy_evaluated>�</row>�-<identifiers>�<header_from>avr2.org</header_from>�</identifiers>�-<auth_results>�-<dkim>�<domain>mobymax.com</domain> ≠ header_from�<result>pass</result>�<selector>smtpapi</selector>�</dkim>�-<spf>�<domain>email.mobymax.com</domain> ≠ header_from�<result>pass</result>�</spf>�</auth_results>�</record>
Google’s Handling of DMARC-Quarantined Messages
(As of October 2016. Attachments were still accessible.)
DMARC Reports
DMARC Implementation
Summary - 3 Tools for Better Email
Email Integrity Requires Cooperative Effort
Thank you!
Following this slide are
Resources
Google support links
Resources
SPF
Resources
DMARC
Other Security Options in Gmail
G Suite Email Safety Settings
Apps > G Suite > Gmail > Safety
More G Suite Security Options
OAuth/API Options in the Google Admin console
Via OAuth users can just give an application access to portions of their G Suite account data: Gmail, Drive, etc. Neither passwords nor 2-step verification matter. These present numerous possible legal and security challenges.
On May 3, 2017 the world saw the first large scale phishing attack to exploit Google OAuth. Recipients received an email with a link to a page that prompted the user to allow the “Google Docs” app access to their email. That “Google Docs” was actually a malicious third-party app to which victims gave full control of their email, allowing the attack to spread.
OAuth/API Options in the Google Admin console
G Suite admins can create a whitelist of trusted OAuth apps via G Suite under Security > API Permissions.
Google Password Alert Extension for Chrome
Google’s description:
If you enter your Google Account password or Google for Work password into anywhere other than Google's sign-in page, you’ll receive an alert, so you can quickly change your password if needed. ��Password Alert also checks each page you visit to see if it's impersonating Google's sign-in page, and alerts you if so.
This extension can be force-installed for users.