<?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>Fail2Ban Archives - Vavai&#039;s Personal Notes</title>
	<atom:link href="https://www.vavai.net/tag/fail2ban/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.vavai.net/tag/fail2ban/</link>
	<description>Life is our precious gift</description>
	<lastBuildDate>Sat, 20 Oct 2018 23:55:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Fail2Ban, Zimbra’s DoSFilter and Failed Login Lockout Policy</title>
		<link>https://www.vavai.net/fail2ban-zimbras-dosfilter-and-failed-login-lockout-policy/</link>
					<comments>https://www.vavai.net/fail2ban-zimbras-dosfilter-and-failed-login-lockout-policy/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Sat, 20 Oct 2018 23:55:08 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[DoSFilter]]></category>
		<category><![CDATA[Fail2Ban]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[Zimbra]]></category>
		<guid isPermaLink="false">http://v2.vavai.net/?p=2053</guid>

					<description><![CDATA[<p>On each Zimbra deployment strategy, I&#8217;ve never activate Failed Login Lockout Policy as it tend to block legitimate user from being logged in due to brute force attack from others. The legitimate users often become a victim for spammer or robot attempt to login. I would also prefer Fail2ban to block login attempt from spammer...</p>
<p>The post <a href="https://www.vavai.net/fail2ban-zimbras-dosfilter-and-failed-login-lockout-policy/">Fail2Ban, Zimbra’s DoSFilter and Failed Login Lockout Policy</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>On each Zimbra deployment strategy, I&#8217;ve never activate Failed Login Lockout Policy as it tend to block legitimate user from being logged in due to brute force attack from others. The legitimate users often become a victim for spammer or robot attempt to login.<br />
I would also prefer Fail2ban to block login attempt from spammer rather than Zimbra&#8217;s built in filter, DoSFilter. But it seems to be changed after looking at (just a short reply <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ) on a discussion on <a href="https://forums.zimbra.org/viewtopic.php?f=15&amp;t=65051&amp;p=286557#p286557">Zimbra Forums</a>.<br />
<img fetchpriority="high" decoding="async" class="alignnone size-large wp-image-2055" src="http://v2.vavai.net/wp-content/uploads/2018/10/Zimbra-logo-color-1024x225.png" alt="" width="602" height="132" srcset="https://d3b35uem336dgh.cloudfront.net/wp-content/uploads/2018/10/Zimbra-logo-color-1024x225.png 1024w, https://d3b35uem336dgh.cloudfront.net/wp-content/uploads/2018/10/Zimbra-logo-color-300x66.png 300w, https://d3b35uem336dgh.cloudfront.net/wp-content/uploads/2018/10/Zimbra-logo-color-768x168.png 768w, https://d3b35uem336dgh.cloudfront.net/wp-content/uploads/2018/10/Zimbra-logo-color.png 1500w" sizes="(max-width: 602px) 100vw, 602px" /><br />
L Mark Stone of Mission Critical Email write up : <a href="https://www.missioncriticalemail.com/2018/10/19/using-zimbras-dosfilter-and-failed-login-lockout-policy-together/">&#8220;Using Zimbra’s DoSFilter and Failed Login Lockout Policy Together&#8221;</a></p>
<blockquote><p>Zimbra’s DoSFilter (<a href="https://wiki.zimbra.com/wiki/DoSFilter" target="_blank" rel="noopener noreferrer">Denial of Service Filter</a>) is a mechanism to throttle or block IP addresses that have a repeated number of failed logins to your Zimbra system.  Zimbra’s Classes of Service include a Failed Login Lockout policy that will put a mailbox in Locked Out mode, hopefully before a brute force attack is successful.  The two together can improve system security and protect legitimate users, but only if configured appropriately.<br />
DoSFilter is generally easier to configure than fail2ban in multiserver systems, because in a multi-server system the logger host is usually one of the mailbox servers, but you want to do the fail2ban blocking on the MTA and Proxy servers.  Making all that work is complex, and if you are running Network Edition, Zimbra Support can help you troubleshoot DoSFilter; with fail2ban you are on your own.  On single server Zimbra systems, fail2ban works fine, but you’ll need to source up to date Zimbra “jail” configuration files, so yet another reason to favor DoSFilter over fail2ban.</p></blockquote>
<p>As one of top Zimbra Expert involved on Zimbra Forums since the beginning and managing his business focus on email, Mark has his own&#8217;s experience to deal with Zimbra security improvement and his blog post interesting enough to be implemented.</p>
<p>The post <a href="https://www.vavai.net/fail2ban-zimbras-dosfilter-and-failed-login-lockout-policy/">Fail2Ban, Zimbra’s DoSFilter and Failed Login Lockout Policy</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/fail2ban-zimbras-dosfilter-and-failed-login-lockout-policy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tips : Improving Zimbra Mail Server Security with Fail2Ban</title>
		<link>https://www.vavai.net/tips-improving-zimbra-mail-server-security-with-fail2ban/</link>
					<comments>https://www.vavai.net/tips-improving-zimbra-mail-server-security-with-fail2ban/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Fri, 21 Oct 2011 04:45:31 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Fail2Ban]]></category>
		<category><![CDATA[SLES]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[Zimbra]]></category>
		<guid isPermaLink="false">http://v2.vavai.net/?p=1305</guid>

					<description><![CDATA[<p>Zimbra mail server has it’s own anti spam based on SpamAssasin and anti virus addon based on ClamAV to block incoming and outgoing malicious. The default addon has a pretty good performance when configured properly, but if you want to increase the security of Zimbra mail server, fail2ban is an additional plugin to be considered. What is...</p>
<p>The post <a href="https://www.vavai.net/tips-improving-zimbra-mail-server-security-with-fail2ban/">Tips : Improving Zimbra Mail Server Security with Fail2Ban</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://54.254.121.108/wp-content/uploads/2011/10/Fail2ban_logo.png"><img decoding="async" class="size-full wp-image-1359 alignleft" style="margin: 5px;" alt="Fail2ban_logo" src="http://54.254.121.108/wp-content/uploads/2011/10/Fail2ban_logo.png" width="135" height="130" /></a>Zimbra mail server has it’s own anti spam based on SpamAssasin and anti virus addon based on ClamAV to block incoming and outgoing malicious. The default addon has a pretty good performance when configured properly, but if you want to increase the security of Zimbra mail server, fail2ban is an additional plugin to be considered.</p>
<p style="text-align: justify;">What is Fail2Ban</p>
<p style="text-align: justify;"><em>Fail2ban is an intrusion prevention framework written in the Python programming language. It is able to run on POSIX systems that have an interface to a packet-control system or firewall installed locally (for example, iptables or TCP Wrapper).</em></p>
<p style="text-align: justify;"><em>Fail2ban operates by monitoring log files (e.g. /var/log/pwdfail, /var/log/auth.log, etc.) for selected entries and running scripts based on them. Most commonly this is used to block selected IP addresses that may belong to hosts that are trying to breach the system’s security. It can ban any host IP that makes too many login attempts or performs any other unwanted action within a time frame defined by the administrator.</em></p>
<p>Here is a guide to improve the security of Zimbra mail server by using Fail2Ban :</p>
<ol>
<li>Install Fail2Ban and IPtables. If you are using <a href="http://web.archive.org/web/20130530072636/http://v2.vavai.net/2011/12/installing-zimbra-mail-server-on-sles-11-sp1-64-bit-in-less-than-30-minutes-part-3/">Minimal Server Appliance</a>, both Fail2ban and IPtables has been successfully installed on the appliance. To install it manually, run the following command with root permission :
<pre>zypper ar http://download.opensuse.org/repositories/security/SLE_11/ fail2ban
zypper in fail2ban</pre>
</li>
<li>Create a new file <strong>/etc/fail2ban/filter.d/zimbra.conf</strong>. This file contains regular expression to parsing Zimbra log which will trigger the banned process if it happens several times in a specified time interval. Contents of<strong>/etc/fail2ban/filter.d/zimbra.conf</strong> :
<div id="highlighter_936138">
<pre># Fail2Ban configuration file
#
# Author:
#
# $Revision: 1 $
#
[Definition]
# Option:  failregex
# Notes.:  regex to match the password failures messages in the logfile. The
#          host must be matched by a group named "host". The tag "&lt;HOST&gt;" can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P&lt;host&gt;[\w\-.^_]+)
# Values:  TEXT
#
failregex = \[ip=&lt;HOST&gt;;\] account - authentication failed for .* \(no such account\)$
                        \[ip=&lt;HOST&gt;;\] security - cmd=Auth; .* error=authentication failed for .*, invalid password;$
                        ;oip=&lt;HOST&gt;;.* security - cmd=Auth; .* protocol=soap; error=authentication failed for .* invalid password;$
                        \[oip=&lt;HOST&gt;;.* SoapEngine - handler exception: authentication failed for .*, account not found$
                        WARN .*;ip=&lt;HOST&gt;;ua=ZimbraWebClient .* security - cmd=AdminAuth; .* error=authentication failed for .*;$
                        NOQUEUE: reject: RCPT from .*\[&lt;HOST&gt;\]: 550 5.1.1 .*: Recipient address rejected:
# .*\[ip=&lt;HOST&gt;;\] .* - authentication failed for .* \(invalid password\)
#
# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =</pre>
</div>
</li>
<li>Create/edit <strong>/etc/fail2ban/jail.conf</strong> with the following contents :
<div id="highlighter_585059">
<pre># Fail2Ban configuration file
#
# Author: Cyril Jaquier
#
# $Revision: 747 $
## The DEFAULT allows a global definition of the options. They can be overridden
# in each jail afterwards.
[DEFAULT]
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
# ban a host which matches an address in this list. Several addresses can be
# defined using space separator.
ignoreip = 127.0.0.1/8 202.43.115.188/32
# "bantime" is the number of seconds that a host is banned.
bantime = 600
# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime = 600
# "maxretry" is the number of failures before a host get banned.
maxretry = 3
# "backend" specifies the backend used to get files modification. Available
# options are "gamin", "polling" and "auto". This option can be overridden in
# each jail too (use "gamin" for a jail and "polling" for another).
#
# gamin: requires Gamin (a file alteration monitor) to be installed. If Gamin
# is not installed, Fail2ban will use polling.
# polling: uses a polling algorithm which does not require external libraries.
# auto: will choose Gamin if available and polling otherwise.
backend = auto
# This jail corresponds to the standard configuration in Fail2ban 0.6.
# The mail-whois action send a notification e-mail with a whois request
# in the body.
[ssh-iptables]
enabled = false
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
sendmail-whois[name=SSH, dest=zeze@vavai.com, sender=fail2ban@excellent.co.id]
logpath = /var/log/messages
maxretry = 5
# This jail forces the backend to "polling".
[sasl-iptables]
enabled = false
filter = sasl
backend = polling
action = iptables[name=sasl, port=smtp, protocol=tcp]
sendmail-whois[name=sasl, dest=support@excellent.co.id]
logpath = /var/log/zimbra.log
# Here we use TCP-Wrappers instead of Netfilter/Iptables. "ignoreregex" is
# used to avoid banning the user "myuser".
[ssh-tcpwrapper]
enabled = false
filter = sshd
action = hostsdeny
sendmail-whois[name=SSH, dest=support@excellent.co.id]
ignoreregex = for myuser from
logpath = /var/log/messages
# This jail uses ipfw, the standard firewall on FreeBSD. The "ignoreip"
# option is overridden in this jail. Moreover, the action "mail-whois" defines
# the variable "name" which contains a comma using "". The characters '' are
# valid too.
[zimbra-account]
enabled = true
filter = zimbra
action = iptables-allports[name=zimbra-account]
sendmail[name=zimbra-account, dest=support@excellent.co.id]
logpath = /opt/zimbra/log/mailbox.log
bantime = 600
maxretry = 5
[zimbra-audit]
enabled = true
filter = zimbra
action = iptables-allports[name=zimbra-audit]
sendmail[name=Zimbra-audit, dest=support@excellent.co.id]
logpath = /opt/zimbra/log/audit.log
bantime = 600
maxretry = 5
[zimbra-recipient]
enabled = true
filter = zimbra
action = iptables-allports[name=zimbra-recipient]
sendmail[name=Zimbra-recipient, dest=support@excellent.co.id]
logpath = /var/log/zimbra.log
#findtime = 604800
bantime = 172800
maxretry = 5
[postfix]
enabled = true
filter = postfix
action = iptables-multiport[name=postfix, port=smtp, protocol=tcp]
sendmail-buffered[name=Postfix, dest=support@excellent.co.id]
logpath = /var/log/zimbra.log
bantime = -1
maxretry = 5
#[sasl]
#enabled = true
#port = smtp,ssmtp,imap2,imap3,imaps,pop3,pop3s
#filter = sasl
# You might consider monitoring /var/log/warn.log instead
# if you are running postfix. See http://bugs.debian.org/507990
#logpath = /var/log/zimbra.log</pre>
</div>
<p style="text-align: justify;">jail.conf contains data log path to be check and email address for banned notification. Do not forget to fill in the parameters ignoreip to prevent Fail2Ban banned internal network</p>
</li>
<li>Edit file <strong>/etc/fail2ban/action.d/sendmail.conf</strong> and change the line :
<div id="highlighter_867532">
<pre>Fail2Ban" | /usr/sbin/sendmail -f &lt;sender&gt; &lt;dest&gt;</pre>
</div>
<p>into</p>
<div id="highlighter_315958">
<pre>Fail2Ban" | /opt/zimbra/postfix/sbin/sendmail -f &lt;sender&gt; &lt;dest&gt;</pre>
</div>
</li>
<li>Restart Fail2Ban services
<div id="highlighter_273041">
<pre>service fail2ban restart</pre>
</div>
</li>
</ol>
<p style="text-align: justify;">Fail2Ban will sent a notification email to specified email address if found intrusion that match with Fail2Ban rule. IP will be instantly banned if it has qualified many times and match with Fail2Ban rules in a predefined time interval. We can also modify jail.conf  or create another regular expression to check other logs.</p>
<p>Below are screenshot of notification email from Fail2Ban:<br />
<a href="http://web.archive.org/web/20130530072636/http://www.excellent.co.id/product-services/zimbra/implementasi-fail2ban-untuk-meningkatkan-performa-keamanan-zimbra-mail-server-2/attachment/fail2ban/" rel="attachment wp-att-2207"><img decoding="async" title="fail2ban" alt="" src="http://web.archive.org/web/20130530072636im_/http://www.excellent.co.id/wp-content/uploads/2012/09/fail2ban.jpeg" width="416" height="283" /></a></p>
<p style="text-align: justify;">Fail2Ban is quite powerful and can be used to anticipate the kind of brute-force attack, both on email and other server services such as web servers, FTP servers, database servers and others.</p>
<p>The post <a href="https://www.vavai.net/tips-improving-zimbra-mail-server-security-with-fail2ban/">Tips : Improving Zimbra Mail Server Security with Fail2Ban</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/tips-improving-zimbra-mail-server-security-with-fail2ban/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 28/51 objects using Disk
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d3b35uem336dgh.cloudfront.net
Lazy Loading (feed)
Minified using Disk
Database Caching 14/30 queries in 0.014 seconds using Disk

Served from: www.vavai.net @ 2026-11-12 02:42:58 by W3 Total Cache
-->