<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[CleverPeople.com: All Site Blogs: April 2021}]]></title>
	<link>https://cleverpeople.com/blog/all/1617249600/1619841600</link>
	<atom:link href="https://cleverpeople.com/blog/all/1617249600/1619841600" rel="self" type="application/rss+xml" />
	<description><![CDATA[}]]></description>
		<item>
	<guid isPermaLink="true">https://cleverpeople.com/blog/view/2582/blocking-spam-and-hack-attacks-by-tld</guid>
	<pubDate>Tue, 13 Apr 2021 23:06:02 -0400</pubDate>
	<link>https://cleverpeople.com/blog/view/2582/blocking-spam-and-hack-attacks-by-tld</link>
	<title><![CDATA[Blocking spam and hack attacks by TLD]]></title>
	<description><![CDATA[<p>Much of the <strong>email spam</strong> and <strong>hack attacks</strong> I see against my servers can be blocked up-front by using <strong>Postfix </strong>and <strong>modsecurity </strong>filters. <em><u>NOTE</u>: Your use case may vary, so these suggestions may or may not be practical based on your business needs!</em></p><p>First, in <strong>modsecurity </strong>I block problematic country .TLDs, which I know is anti-social, but it prevents lots of headaches for my current business use case. This doesn't prevent a determined hacker from using a VPN for attacks in another country (like US), but it does cut down on much of the noise so that the system administrator can focus on actual hack attacks.</p><p>In the <strong><em>crs-setup.conf</em></strong> file I block the problematic TLDs:</p><p><em>SecAction \<br />
&nbsp;"id:<u>[your rule ID may vary!]</u>,\<br />
&nbsp; phase:1,\<br />
&nbsp; nolog,\<br />
&nbsp; pass,\<br />
&nbsp; t:none,\<br />
&nbsp; setvar:'tx.high_risk_country_codes=RU CN RO UA ID YU LT EG BG TR PK MY AF IQ IR KP SA SC SY VA AE IL IN'"</em><br />
&nbsp;</p><p>And for spam control, in my postfix <strong><em>main.cf</em></strong> file, my configuration for the&nbsp;<em>smtpd_sender_restrictions </em>line looks like this (the last part is what is relevant by adding a PCRE list of domains):</p><p><em>smtpd_sender_restrictions &nbsp;= permit_mynetworks, permit_sasl_authenticated, reject_unauthenticated_sender_login_mismatch, check_sender_access pcre:/etc/postfix/reject_domains</em></p><p>And in the <strong><em>/etc/postfix/reject_domains</em> </strong>file I block each of&nbsp;the domains that are most likely to produce spam:</p><p><em>/\.xyz$/ REJECT We reject all .xyz domains due to spam</em><br />
&nbsp;</p><p><em>Note: Since the&nbsp;<strong>/etc/postfix/reject_domains </strong>file is not hashed, there's no need to run the <strong>postmap </strong>command after changes (unlike <strong>helo_access </strong>and other hashed files).</em></p><p>Once your Postfix changes are complete, you need to restart or reload Postfix with a command similar to:</p><p><em>sudo service postfix reload</em></p><p>Since&nbsp;<em>Postfix </em>is technically an MTA, you shouldn't really use it as your primary&nbsp;spam-fighting solution. I use many other tools such as <em>SpamAssassin </em>as Bayesian milters to fight spam, but you can head much of it off from the start by blocking domains and TLDs that are problematic for you!</p>]]></description>
	<dc:creator>Gary Wright II</dc:creator>		</item>
</channel>
</rss>
