<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>email security | KC's Blog</title>
	<atom:link href="https://www.kjctech.net/tag/email-security/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kjctech.net</link>
	<description></description>
	<lastBuildDate>Fri, 06 Oct 2023 17:22:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/www.kjctech.net/wp-content/uploads/2016/12/cropped-KC-Logo.png?fit=32%2C32&#038;ssl=1</url>
	<title>email security | KC's Blog</title>
	<link>https://www.kjctech.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">24634607</site>	<item>
		<title>M365 &#8211; How To Stop SPF-Failed Emails From Passing Through</title>
		<link>https://www.kjctech.net/m365-how-to-stop-spf-failed-emails-from-passing-through/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=m365-how-to-stop-spf-failed-emails-from-passing-through</link>
					<comments>https://www.kjctech.net/m365-how-to-stop-spf-failed-emails-from-passing-through/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Thu, 25 May 2023 06:09:11 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[email security]]></category>
		<category><![CDATA[Microsoft 365]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=5076</guid>

					<description><![CDATA[<p>By default, SPF-failed emails will still get delivered in Microsoft 365. To its credit, they do most likely end up in the Junks folder. I understand the reason behind it because even in 2023, there are still many mail servers that aren&#8217;t configured correctly. But the fact that an SPF-failed email passes through still bothers me. To stop it, you [&#8230;]</p>
The post <a href="https://www.kjctech.net/m365-how-to-stop-spf-failed-emails-from-passing-through/">M365 – How To Stop SPF-Failed Emails From Passing Through</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>By default, SPF-failed emails will still get delivered in Microsoft 365. To its credit, they do most likely end up in the Junks folder. I understand the reason behind it because even in 2023, there are still many mail servers that aren&#8217;t configured correctly. But the fact that an SPF-failed email passes through still bothers me.</p>



<p>To stop it, you will need to add a Transport Rule that catches them via a matching message header. However, since SPF is only one of the authentication methods for email security. There are also DKIM and DMARC to consider as well.</p>



<p>Exchange Online runs authentication tests and puts the results in a header called &#8220;<strong><em>Authentication-Results</em></strong><em>&#8220;</em>, in the form of something like this:</p>



<pre class="wp-block-preformatted">Authentication-Results: spf=pass; dkim=pass; dmarc=pass; compauth=pass</pre>



<p>The field <strong>compauth</strong> is a very interesting one. According to <a href="https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/message-headers-eop-mdo?view=o365-worldwide" target="_blank" rel="noopener" title="">Anti-spam message headers in Microsoft 365</a>, it&#8217;s used by Microsoft 365 to combine multiple types of authentication or any other part of the message to determine whether or not the message is authenticated.</p>



<p>It would be perfect for my case. If any message&#8217;s Authentication-Results header contains compauth=fail, I am happy to drop it. However, the Transport Rule doesn&#8217;t take that part and for whatever reason, it just wouldn&#8217;t match. What a bummer.</p>



<p>So, naturally, my next bet would be to use DMARC. Here is how it goes.</p>



<p>Head over to the Exchange Admin dashboard, go to Mail flow > Rules, and click Add a rule.</p>



<p>Give a name, and add a condition that</p>



<pre class="wp-block-preformatted">If the message header Authentication-Results includes dmarc=faile</pre>



<pre class="wp-block-preformatted">Do the following actions, such as redirect to quarantine, or reject it back to the sender with or without an explanation.</pre>



<p>Since we are using DMARC, I believe we should respect its action setting too. So an exception might be necessary.</p>



<pre class="wp-block-preformatted">Except if the message header Authentication-Results includes 'dmarc=fail action=none'</pre>



<p>To wrap it up, a rule like this should get the job done.</p>



<figure class="wp-block-image size-full"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="531" height="595" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=531%2C595&#038;ssl=1" alt="" class="wp-image-5078" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?w=531&amp;ssl=1 531w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=450%2C504&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=250%2C280&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=520%2C583&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=360%2C403&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2023/05/image-8.png?resize=100%2C112&amp;ssl=1 100w" sizes="(max-width: 531px) 100vw, 531px" /></figure>The post <a href="https://www.kjctech.net/m365-how-to-stop-spf-failed-emails-from-passing-through/">M365 – How To Stop SPF-Failed Emails From Passing Through</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/m365-how-to-stop-spf-failed-emails-from-passing-through/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5076</post-id>	</item>
		<item>
		<title>Blocking Attachments based on the File Extension on Microsoft 365</title>
		<link>https://www.kjctech.net/blocking-attachments-based-on-the-file-extension-on-microsoft-365/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blocking-attachments-based-on-the-file-extension-on-microsoft-365</link>
					<comments>https://www.kjctech.net/blocking-attachments-based-on-the-file-extension-on-microsoft-365/#comments</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Mon, 10 May 2021 06:08:53 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[email security]]></category>
		<category><![CDATA[Office 365]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=4617</guid>

					<description><![CDATA[<p>After getting a lot of phishing emails with suspicious HTML attachments, I was scared and decided to pull the trigger to get them blocked on the server level so no one will see them in their Outlook inbox. Sign into Microsoft 365 Portal and go to Exchange Admin Center. Click Mail Flow on the left-side pane, and click the little [&#8230;]</p>
The post <a href="https://www.kjctech.net/blocking-attachments-based-on-the-file-extension-on-microsoft-365/">Blocking Attachments based on the File Extension on Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>After getting a lot of phishing emails with suspicious HTML attachments, I was scared and decided to pull the trigger to get them blocked on the server level so no one will see them in their Outlook inbox.</p>



<p>Sign into <a href="https://admin.microsoft.com/" target="_blank" rel="noreferrer noopener">Microsoft 365 Portal</a> and go to Exchange Admin Center.</p>



<p>Click Mail Flow on the left-side pane, and click the little + icon to add a new rule.</p>



<p>Name the Rule, select the following rule as the condition,</p>



<pre class="wp-block-preformatted">Any attachment's file extension matches...'html' or 'htm'</pre>



<p>Pick on the following actions as it fits your goal.</p>



<ul class="wp-block-list"><li>Forward the message for approval</li><li>Redirect the message to</li><li>Block the message</li><li>ect.</li></ul>



<p>If you only want to apply the rule to incoming messages, you can add an exception to allow outgoing emails with the same attachment.</p>



<p>Here is one example of the rule I set in place.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="600" height="525" src="//i0.wp.com/kjctech.net/wp-content/uploads/2021/05/image-4-600x525.png" alt="" class="wp-image-4618" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=600%2C525&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=450%2C394&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=250%2C219&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=768%2C672&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=700%2C612&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=520%2C455&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=360%2C315&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?resize=100%2C87&amp;ssl=1 100w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-4.png?w=783&amp;ssl=1 783w" sizes="(max-width: 600px) 100vw, 600px" /></figure>



<p>If you are using the Approval approach, you will get emails containing any HTML files for you to approve, like below.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="549" height="189" src="//i0.wp.com/kjctech.net/wp-content/uploads/2021/05/image-5.png" alt="" class="wp-image-4619" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?w=549&amp;ssl=1 549w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?resize=450%2C155&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?resize=250%2C86&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?resize=520%2C179&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?resize=360%2C124&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2021/05/image-5.png?resize=100%2C34&amp;ssl=1 100w" sizes="(max-width: 549px) 100vw, 549px" /></figure>



<p>As you can tell, it&#8217;s already caught one.</p>The post <a href="https://www.kjctech.net/blocking-attachments-based-on-the-file-extension-on-microsoft-365/">Blocking Attachments based on the File Extension on Microsoft 365</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/blocking-attachments-based-on-the-file-extension-on-microsoft-365/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4617</post-id>	</item>
		<item>
		<title>Authenticating Emails with SPF, DKIM, and DMARC</title>
		<link>https://www.kjctech.net/authentic-emails-with-spf-dkim-and-dmarc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=authentic-emails-with-spf-dkim-and-dmarc</link>
					<comments>https://www.kjctech.net/authentic-emails-with-spf-dkim-and-dmarc/#comments</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Mon, 29 Apr 2019 18:55:20 +0000</pubDate>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[email security]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=4288</guid>

					<description><![CDATA[<p>SPF, DKIM, and DMARC are different methods to authenticate your email to serve one dedicated purpose, detecting forged sender addresses in emails used in phishing or spam. SPF, Sender Policy Framework, allows the receiver to check that an email claiming from a specific domain comes from an IP address authorized by that domain&#8217;s admin. A typical SPF record is a [&#8230;]</p>
The post <a href="https://www.kjctech.net/authentic-emails-with-spf-dkim-and-dmarc/">Authenticating Emails with SPF, DKIM, and DMARC</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>SPF, DKIM, and DMARC are different methods to authenticate your email to serve one dedicated purpose, detecting forged sender addresses in emails used in phishing or spam. </p>



<p><strong>SPF</strong>, Sender Policy Framework, allows the receiver to check that an email claiming from a specific domain comes from an IP address authorized by that domain&#8217;s admin. A typical SPF record is a TXT DNS entry similar to this:</p>



<pre class="wp-block-preformatted"> "v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a -all" </pre>



<p>it simply tells that emails from the specific domain are sent either from 192.0.2.0/24 or 198.51.100.123 or should be rejected if came from anywhere else.</p>



<p>Tool to check SPF record:  <a href="https://mxtoolbox.com/spf.aspx">https://mxtoolbox.com/spf.aspx</a> </p>



<p><strong>DKIM</strong>, DomainKeys Identified Mail, allows the receiver to check that an email claiming from a specific domain was indeed authorized by the owner of that domain. It requires a digital signature linked to a domain name for each outgoing email message. At the receiver end, the email can be verified by looking up the sender&#8217;s public key in DNS. To achieve this, you will need a public key entry in the domain&#8217;s DNS as well as a digital certificate on the mail server.</p>



<p>You don&#8217;t need to implement both SPF and DKIM. Utilizing either one of them should be good enough.</p>



<p><strong>/Update on May 7, 2019/ </strong></p>



<p>Thanks to Dave for pointing out that you do need both SPF and DKIM. Yes, SPF and DKIM accomplish the same goal with a different approach. Implementing both would be ideal. I should have pointed out that most of the mail providers like Office 365 and G Suite have default DKIM in place for those who don&#8217;t have it implemented. It&#8217;s always recommended to use your own DKIM key on all outgoing messages.</p>



<p>Tool to verify DKIM setup: <a href="https://mxtoolbox.com/DKIM.aspx">https://mxtoolbox.com/DKIM.aspx</a> </p>



<p>To set up and enable DKIM in Office 365, follow <a href="https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/use-dkim-to-validate-outbound-email" target="_blank" rel="noopener">this documentation</a>.</p>



<p><strong>DMARC</strong>, Domain-based Message Authentication, Reporting, and Conformance extends both SPF and DKIM and gives the domain owners a way to protect their domain from unauthorized use, a.k.a email spoofing. A TXT entry was added in DNS as a policy to specify which mechanism (SPF or DKIM) is employed when sending emails from that domain and how to check From field presented to end-users.</p>



<pre class="wp-block-preformatted">"v=DMARC1;p=none;sp=quarantine;pct=100;rua=mailto:dmarcreports@example.com;"</pre>



<p>it simply translates that DMARC version 1 will be used with none in Policy, Quarantine in the subdomain, percentage of &#8220;bad&#8221; emails to apply the policy, and an email address to receive aggregate reports.</p>



<p>Note that <strong>_dmarc </strong>needs to be in the Host field when adding the TXT record. You will need to set up either SPF or DKIM first before setting up DMARC. A message that doesn&#8217;t pass SPF or DKIM checks triggers the DMARC policy.</p>



<p>Once it&#8217;s published, the mailbox specified in the entry will be getting reports in XML format once per day.</p>



<p>It&#8217;s recommended to set the policy to none when first implemented so no impact will be made to your email setup. Once you have collected enough data and analyzed it, you can then change the policy to either reject or quarantine.</p>



<p>Tool to verify DMARC record: </p>



<ul class="wp-block-list">
<li><a href="https://mxtoolbox.com/DMARC.aspx">https://mxtoolbox.com/DMARC.aspx</a> </li>



<li><a href="https://www.learndmarc.com/" target="_blank" rel="noopener" title="">https://www.learndmarc.com/</a> &#8211; a visual breakdown of how email servers communicate, giving you a better understanding of SPF, DKIM and DMARC and how they work together.</li>
</ul>



<h2 class="wp-block-heading">Resource</h2>



<ul class="wp-block-list">
<li>SPF Wiki &#8211;  <a href="https://en.wikipedia.org/wiki/Sender_Policy_Framework">https://en.wikipedia.org/wiki/Sender_Policy_Framework</a> </li>



<li>DKIM Wiki &#8211;  <a href="https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail">https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail</a> </li>



<li>DMARC Wiki &#8211;  <a href="https://en.wikipedia.org/wiki/DMARC">https://en.wikipedia.org/wiki/DMARC</a> </li>



<li>DMARC &#8211;  <a href="https://dmarc.org/overview/">https://dmarc.org/overview/</a> </li>



<li>Email Authenticity 101 &#8211;<a href="https://www.alexblackie.com/articles/email-authenticity-dkim-spf-dmarc/" target="_blank" rel="noreferrer noopener"> https://www.alexblackie.com/articles/email-authenticity-dkim-spf-dmarc/</a> </li>
</ul>



<p></p>The post <a href="https://www.kjctech.net/authentic-emails-with-spf-dkim-and-dmarc/">Authenticating Emails with SPF, DKIM, and DMARC</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/authentic-emails-with-spf-dkim-and-dmarc/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4288</post-id>	</item>
	</channel>
</rss>
