<?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>Thoughts Electrique &#187; Sysadmin</title>
	<atom:link href="http://www.sebastian.himberger.de/blog/tag/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sebastian.himberger.de/blog</link>
	<description>Sebastian Himbergers blog about technology and software development</description>
	<lastBuildDate>Thu, 08 Jul 2010 17:05:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Ubuntu LTS default repository problem</title>
		<link>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 04:25:20 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Opinionated]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=580</guid>
		<description><![CDATA[I&#8217;ve often seen Ubuntu being chosen instead of Debian because the LTS version offers support and security-fixes for five years. This kind of SLA is often a critical argument. But while Ubuntu is happily claiming to be enterprise-ready they yet enable the universe and multiverse software repositories per default even in the LTS server edition. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often seen <a href="http://www.ubuntu.com">Ubuntu </a>being chosen instead of <a href="http://www.debian.org" target="_blank">Debian </a>because the LTS version offers support and security-fixes for five years. This kind of SLA is often a critical argument. But while Ubuntu is happily claiming to be enterprise-ready they yet enable the <em>universe </em>and <em>multiverse </em>software repositories per default even in the LTS server edition. Since <a href="http://www.ubuntu.com/community/ubuntustory/components" target="_blank">these two repositories are not included in the SLA</a> you might end up with software that is not provided with patches and therefore the whole security guarantee get&#8217;s thrown out of the window. While I&#8217;m not saying community backed security is bad it basically sets Ubuntu into the same mode of operation as Debian and this even without a specific warning or even notice. To be on the safe side you should disable the <em>universe</em> and <em>multiverse</em> repositories after installation or at least be aware of this fact.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/11/08/the-ubuntu-lts-defaultrepository-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating a broken SME 7.1 Server to version 7.4</title>
		<link>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:06:49 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SME]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=542</guid>
		<description><![CDATA[The SME Server is a great Linux distribution for small to medium sized businesses. I&#8217;ve been doing some emergency sysadmin stuff quite a while ago and encountered the upgrade-hell from 7.1 to version 7.4. Since updating the operating system from 7.1 to 7.4 wasn&#8217;t easy I decided to write a quick blog post to save [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-555" style="border: none; float: left; margin: 4px;" title="The SME Logo" src="http://www.sebastian.himberger.de/blog/wp-content/uploads/2009/10/sme-logo.png" alt="The SME Logo" width="150" height="141" />The <a title="SME Server website" href="http://wiki.contribs.org/Main_Page" target="_blank">SME Server</a> is a great Linux distribution for small to medium sized businesses. I&#8217;ve been doing some emergency sysadmin stuff quite a while ago and encountered the upgrade-hell from 7.1 to version 7.4. Since updating the operating system from 7.1 to 7.4 wasn&#8217;t easy I decided to write a quick blog post to save you from tinkering.</p>
<p><span id="more-542"></span></p>
<p>Updating the SME in general is pretty straighforward but if the customer made modifications to the <em>yum</em> configuration it can quickly turn into a nightmare. Luckily there <a title="Upgrading from 7.1 Tutorial" href="http://wiki.contribs.org/Updating_from_SME_7.1.x_or_earlier#Yum_Update" target="_blank">is a tutorial available in the SME Wiki</a> which can help you to get started. Unfortunately the yum installation was completly broken so I had to update the packages by hand. I pulled the packages from the SME repository at and installed them via</p>
<pre class="terminal">export SME_MIRROR_URL="http://mirror.jvsnet.ro/sme/releases/7/smeos/i386/SME/RPMS"

wget $SME_MIRROR_URL/dialog-1.0.20040731-3.i386.rpm
wget $SME_MIRROR_URL/python-sqlite-1.1.7-1.2.1.i386.rpm
wget $SME_MIRROR_URL/yum-metadata-parser-1.0-8.el4.centos.i386.rpm
wget $SME_MIRROR_URL/e-smith-formmagick-2.0.0-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/smeserver-yum-2.0.0-4.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/yum-plugin-fastestmirror-0.2.4-3.c4.noarch.rpm
wget $SME_MIRROR_URL/e-smith-lib-2.0.0-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/sqlite-3.3.6-2.i386.rpm
wget $SME_MIRROR_URL/yum-plugin-installonlyn-0.91-1.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/perl-CGI-FormMagick-0.92-16.el4.sme.noarch.rpm
wget $SME_MIRROR_URL/yum-2.4.3-4.el4.centos.noarch.rpm

rpm -Uvh --nodeps --force *.rpm</pre>
<p>You maybe have to adjust this mirror url. This is why I factored it out into a seperate variable.</p>
<p>After this you should reset your <em>yum</em> repositories and clean the <em>yum</em> cache.</p>
<pre class="terminal">cd /home/e-smith/db/
mv yum_repositories yum_repositories.po
/etc/e-smith/events/actions/initialize-default-databases
signal-event yum-modify
yum clean all</pre>
<p>After doing so, issue the following commands to let <em>SME</em> rewrite it&#8217;s config.</p>
<pre class="terminal">signal-event post-upgrade; signal-event reboot</pre>
<p>Now you can update <em>yum</em> through yum itself (I know this sounds strange but this second update helps to get all the GPG keys for the repositories right).</p>
<pre class="terminal">yum update yum
signal-event post-upgrade; signal-event reboot</pre>
<p>Now you can proceed with a normal update to get the whole system up to 7.4. I had to do this following process twice because the updates seem to have pulled in some new dependencies which in turn have to get updated.</p>
<pre class="terminal">yum update yum
signal-event post-upgrade; signal-event reboot</pre>
<p>That&#8217;s it. I&#8217;m sure there might be an easier way but at least these are the steps the helped me get the system up to date. If you have questions just leave me a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/10/23/updating-a-broken-sme-7-1-server-to-version-74/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom php.ini and URL rewriting in Plesk 9 with fastcgi</title>
		<link>http://www.sebastian.himberger.de/blog/2009/03/19/custom-phpini-and-url-rewriting-in-plesk-9-with-fastcgi/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/03/19/custom-phpini-and-url-rewriting-in-plesk-9-with-fastcgi/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 17:43:42 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=366</guid>
		<description><![CDATA[For a current hosting server I&#8217;m using the Plesk control panel 9.0.1 for Ubuntu 8.04. Since version 9 Plesk allows the usage of Postfix as an MTA and PHP via FastCGI. This is very nice and much more secure than the old model using mod_php.
The Problem
One problem with the current Plesk version (as with most [...]]]></description>
			<content:encoded><![CDATA[<p>For a current hosting server I&#8217;m using the <a title="Official Plesk website" href="http://www.parallels.com/de/products/plesk/" target="_blank">Plesk control panel 9.0.1</a> for Ubuntu 8.04. Since version 9 Plesk allows the usage of <a title="Postfix website" href="http://www.postfix.org/" target="_blank">Postfix</a> as an <a title="Mail Transfer Agent explain at Wikipedia" href="http://en.wikipedia.org/wiki/Mail_Transfer_Agent" target="_blank">MTA</a> and PHP via <a title="FastCGI website" href="http://www.fastcgi.com/" target="_blank">FastCGI</a>. This is very nice and much more secure than the old model using mod_php.</p>
<h3>The Problem</h3>
<p>One problem with the current Plesk version (as with most Plesk versions :/) is that it has some nasty bugs. For example mod_rewrite doesn&#8217;t work with the FastCGI configuration. The problem is that the generated virtual host configuration has a small but important problem. The generated host looks something like this:</p>
<pre class="file">&lt;VirtualHost 88.198.164.10:80&gt;
  ServerName   playground.himberger.de:80
  ServerAlias  www.playground.himberger.de

  &lt;IfModule mod_fcgid.c&gt;
    &lt;Files ~ (\.php)&gt;
      SetHandler fcgid-script
      FCGIWrapper /usr/bin/php5-cgi .php
<strong>      Options ExecCGI</strong>
      allow from all
    &lt;/Files&gt;
  &lt;/IfModule&gt;
&lt;/VirtualHost&gt;</pre>
<p>The issue with this configuration is the line &#8220;<strong>Options ExecCGI</strong>&#8220;. This line enables the execution of CGI scripts for this particular directory but overrides all the Options set earlier. These are in parts needed for mod_rewrite. To fix this the line should be &#8220;<strong>Options +ExecCGI</strong>&#8220;. Sadly changing the configuration doesn&#8217;t help because at the next opportunity Plesk will regenerate the config file and your change is gone.</p>
<p>Luckily there is a way around this&#8230;</p>
<p><span id="more-366"></span></p>
<h3>Enable mod_rewrite (the solution)</h3>
<p>Luckily Plesk allows you to append a custom configuration to the virtual host by creating a file <em>vhost.conf</em> in the <em>${yourvhost}/conf</em> directory. By putting the following config in your <em>vhost.conf</em> you can take back the overwritten Options (don&#8217;t forget to restart the Apache HTTPD).</p>
<pre class="file">&lt;Directory "/var/www/vhosts/${yourvhost}/httpdocs"&gt;
  &lt;Files ~ (\.php)&gt;
    Options All
  &lt;/Files&gt;
&lt;/Directory&gt;</pre>
<p>You have to be very specific (using the enclosing Directory directive) to cause the current setting to be overridden.</p>
<p>With this knowledge at hand we can do some other nice tricks.</p>
<h3>Using a custom php.ini with fastcgi</h3>
<p>Since we are now able to override the Plesk generated configuration we can also alter the fastcgi command and for example specify a custom php.ini:</p>
<pre class="file">&lt;Directory "/var/www/vhosts/${yourvhost}/httpdocs"&gt;
  &lt;Files ~ (\.php)&gt;
   <strong> FCGIWrapper "/usr/bin/php5-cgi -c /etc/phpconfigs/${yourvhost}"  .php</strong>
    Options All
  &lt;/Files&gt;
&lt;/Directory&gt;</pre>
<p>The <strong><strong>FCGIWrapper</strong></strong> command will use the directory specified with the <em>-c</em> parameter for it&#8217;s php configuration. Simply put your php.ini in this directory and it will automatically be picked up. This way you can easily use a per customer PHP configuration with fastcgi and Plesk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/03/19/custom-phpini-and-url-rewriting-in-plesk-9-with-fastcgi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Static IPs and default route on 1und1 CentOS 5 Servers</title>
		<link>http://www.sebastian.himberger.de/blog/2009/03/11/static-ips-and-default-route-on-1und1-centos-5-servers/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/03/11/static-ips-and-default-route-on-1und1-centos-5-servers/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 22:10:19 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[1und1]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=358</guid>
		<description><![CDATA[I&#8217;ve been experiencing some serverdowns at a client who uses 1und1 CentOS 5 Servers. After some investigation I discovered that cronjobs were still running although the server appeared to be down. Checking the syslogs showed me a bunch of failed DHCP requests which remebered me of the fact that 1und1 uses DHCP to configure the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experiencing some serverdowns at a client who uses <a title="1und1 german website" href="http://www.1und1.de" target="_blank">1und1</a> <a title="Official CentOS website" href="http://www.centos.org/" target="_blank">CentOS </a>5 Servers. After some investigation I discovered that cronjobs were still running although the server appeared to be down. Checking the syslogs showed me a bunch of failed DHCP requests which remebered me of the fact that <strong>1und1 uses DHCP to configure the server machines</strong>. I don&#8217;t think this is a good idea so I changed the setup to static IPs.</p>
<p>Since 1und1 puts every server behind a dedicated firewall the setup is not as easy as you think. I&#8217;ll document it here because It may be useful for other people and certainly for myself after a couple of months.</p>
<h3>Configure a static IP address</h3>
<p>Open the file <em>/etc/sysconfig/network-scripts/ifcfg-eth0</em> and edit it to look like the following:</p>
<pre class="file">DEVICE=eth0
BOOTPROTO=none
TYPE=Ethernet
ONBOOT=yes
HWADDR=$YOURMACADDRESS
NETMASK=255.255.255.255
IPADDR=$YOURIP
GATEWAY=10.255.255.1</pre>
<p>Save the file.</p>
<h3>Configure static routes</h3>
<p>This is the tricky part. Configuring a default gateway using the <em>GATEWAY=</em> setting is not enough. You have to setup the routes yourself. To do so create a new file <em>/etc/sysconfig/network-scripts/route-eth0 </em>with the following contents:</p>
<pre class="file">10.255.255.1 dev eth0
default via 10.255.255.1 dev eth0</pre>
<p>Now you only have to reload the networking configuration via</p>
<pre class="terminal">service network reload</pre>
<p>and you are done!</p>
<p><a title="Tutorial for CentOS4" href="http://webui.sourcelabs.com/centos/mail/user/threads/How_to_create_static_routes_on_startup_with_CentOS4%253F.meta" target="_blank">This post</a> helped me a lot with the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/03/11/static-ips-and-default-route-on-1und1-centos-5-servers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I&#8217;m choosing Tomcat (again)</title>
		<link>http://www.sebastian.himberger.de/blog/2009/02/26/im-choosing-tomcat-again/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/02/26/im-choosing-tomcat-again/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 20:46:12 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Opinionated]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=347</guid>
		<description><![CDATA[As you may remember from my last blogpost I&#8217;m currently setting up a new hosting Server. Since this server will also host some OpenCms and JEE sites I need to set up a Servlet Container. In almost all of my projects until today Tomcat was successfully used for this purpose. Be it stand alone or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-348 alignleft" style="margin: 5px; float: left;" title="Tomcat from Shrek" src="http://www.sebastian.himberger.de/blog/wp-content/uploads/2009/02/tomcat-300x225.jpg" alt="" width="200" height="150" />As you may remember from my last blogpost I&#8217;m currently setting up a new hosting Server. Since this server will also host some <a title="OpenCms website" href="http://www.opencms.org" target="_blank">OpenCms</a> and JEE sites I need to set up a Servlet Container. In almost all of my projects until today <a title="Tomcat website" href="http://tomcat.apache.org" target="_blank">Tomcat</a> was successfully used for this purpose. Be it stand alone or embedded in a JEE application server (e.g. JBoss).</p>
<p>I must admit that I always had some kind of a love-hate relationship with Tomcat. The classloader had some bad issues when reloading a webapplication too often and often killed the complete server. Taking down all of the other webapplications too. Although this has gotten a lot better recently it&#8217;s still bothering me a bit.</p>
<p>Since I had some time after my last project I started investigating other open source alternatives. I often heard of Jetty, praised for it&#8217;s speed and simplicity, it seemed like a great alternative and I played around with it a bit. I really liked it since it was simple to use and easy to deploy but as I started to google for things like performance measurements or how to use it with a security manager I didn&#8217;t really found a lot of documentation (compared to Tomcat) and the performance doesn&#8217;t really doesn&#8217;t seem to differ from Tomcats.</p>
<p>So I&#8217;m once again going the Tomcat route. It has a big community and is even used in military and government organizations. It&#8217;s really not a technology decision (although I think Tomcat is solid) but more political thinking.</p>
<p>It will also save me some time which I can invest in trying out other technologies. <em>Meow&#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/02/26/im-choosing-tomcat-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing a host using the Shoreline firewall / Shorewall</title>
		<link>http://www.sebastian.himberger.de/blog/2009/02/25/securing-a-host-using-the-shoreline-firewall-shorewall/</link>
		<comments>http://www.sebastian.himberger.de/blog/2009/02/25/securing-a-host-using-the-shoreline-firewall-shorewall/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 13:03:04 +0000</pubDate>
		<dc:creator>Sebastian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Shorewall]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.sebastian.himberger.de/blog/?p=337</guid>
		<description><![CDATA[Since I&#8217;m currently setting up a new server for hosting purposes I want to share some of my favourite sysadmin tools and practices.
The first featured tool is the shoreline firewall or shorewall. You can find the project at: http://www.shorewall.net/
Shorewall basically is a set of nice configuration files for iptables. Another benefit of shorewall is that [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m currently setting up a new server for hosting purposes I want to share some of my favourite sysadmin tools and practices.</p>
<p>The first featured tool is the <em>shoreline firewall</em> or <em>shorewall</em>. You can find the project at: <a title="Shorewall website" href="http://www.shorewall.net/" target="_blank">http://www.shorewall.net/</a></p>
<p>Shorewall basically is a set of nice configuration files for <a title="Definition at Wikipedia" href="http://en.wikipedia.org/wiki/Iptables" target="_blank">iptables</a>. Another benefit of shorewall is that it has no runtime part. You just fire up the tool, it configures your iptables and quits. This reduces the load and increases security. Additionally to the technical features there is one thing that makes shorewall really stand out: It has extensive, well-written and understandable documentation. You rarely find a use-case which is not already described in the documentation.</p>
<p>Read on to find out how to set up shorewall in minutes.</p>
<p><span id="more-337"></span></p>
<h3>Setting up shorewall</h3>
<p>In this section I will describe how to secure a single server directly connected to the internet. There is no hardware firewall or DMZ involved.</p>
<p>First you have to install shorewall on your server. Since I use Ubuntu 8.04 there is already a prepackaged version in the repository.</p>
<pre class="terminal">aptitude install shorewall</pre>
<p>Then you have to copy some of the example configuration files to your /etc/shorewall directory.</p>
<pre class="terminal">cp -prv /usr/share/doc/shorewall-common/default-config/rules /etc/shorewall
cp -prv /usr/share/doc/shorewall-common/default-config/zones /etc/shorewall
cp -prv /usr/share/doc/shorewall-common/default-config/modules /etc/shorewall
cp -prv /usr/share/doc/shorewall-common/default-config/interfaces /etc/shorewall
cp -prv /usr/share/doc/shorewall-common/default-config/policy /etc/shorewall</pre>
<p>To understand the meaning I will first give a very short explanation of the shorewall terminology (the terms are pretty standard): Shorewall sees the network as a collection of <strong>zones</strong> (your local network, the internet, the firewall host itself, &#8230;). Network <strong>interfaces </strong>(eth0, eth1, &#8230;)<strong> </strong>are connected to the <strong>zones</strong> and allow traffic to move in and out. If traffic want&#8217;s to move between zones the firewall checks the configured <strong>rules</strong> wether there is a rule allowing or denying the traffic flow. If there is no rule for the specific case it applies a <strong>policy</strong> (default rule).</p>
<p>With this in mind the filenames should be straightforward to understand. The <strong>modules </strong>file loads shorewall specific modules (for example enables the ftp connection tracking). You don&#8217;t have to modify the modules file for a basic setup.</p>
<p>Lets first define the zones in the <strong>zones </strong>file.</p>
<pre class="file">###############################################################################
#ZONE   TYPE            OPTIONS         IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
net     ipv4
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</pre>
<p>As you can see there are only two zones defined: The internet (net) and the server itself (fw).</p>
<p>We now connect the network interfaces to the zones using the <strong>interfaces </strong>file.</p>
<pre class="file">###############################################################################
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     eth0            detect          norfc1918
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</pre>
<p>That&#8217;s it. If you have more interfaces you of course have to connect these to the zones too. But if this is the case it&#8217;s very likely that you are striving for a more complex configuration anyway.</p>
<p>After defining the traffic sources we will now implement the default policy using the <strong>policy </strong>file.</p>
<pre class="file">###############################################################################
#SOURCE         DEST            POLICY          LOG             LIMIT:BURST
#                                               LEVEL
fw              net             ACCEPT
net             fw              DROP
all             all             DROP
#LAST LINE -- DO NOT REMOVE</pre>
<p>This policy allows the firewall to access all internet services and drops all incoming connections silently. Since this is not very useful for a server we now allow public access to some specific services by defining some rules in the <strong>rules </strong>file.</p>
<pre class="file">#############################################################################
#ACTION         SOURCE          DEST            PROTO   DEST    SOURCE
#                                                       PORT    PORT(S)
#SECTION ESTABLISHED
#SECTION RELATED
SECTION NEW
ACCEPT          net             fw              icmp    echo-request
ACCEPT          net             fw              tcp     22
ACCEPT          net             fw              tcp     80
ACCEPT          net             fw              tcp     443
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE</pre>
<p>As cou can see we allowed our server to reply to pings, incoming SSH connections and to serve up websites through HTTP and HTTPS.</p>
<p><strong>In Ubuntu you now have to set the <em>startup </em>variable in <em>/etc/default/shorewall</em> to <em>1</em> and run <em>/etc/init.d/shorewall start</em>. Be sure to check that everything works as expected before you close your SSH session!.</strong></p>
<p>That&#8217;s it. <a title="Shorewall website" href="http://www.shorewall.net/" target="_blank">Visit the shorewall website for more information</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastian.himberger.de/blog/2009/02/25/securing-a-host-using-the-shoreline-firewall-shorewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
