<?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>Racker Hacker &#187; security</title>
	<atom:link href="http://rackerhacker.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:07:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using OpenSSL&#039;s s_client command with web servers using Server Name Indication (SNI)</title>
		<link>http://rackerhacker.com/2012/02/07/using-openssls-s_client-command-with-web-servers-using-server-name-indication-sni/</link>
		<comments>http://rackerhacker.com/2012/02/07/using-openssls-s_client-command-with-web-servers-using-server-name-indication-sni/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 14:07:41 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2998</guid>
		<description><![CDATA[One of the handiest tools in the OpenSSL toolbox is s_client. You can quickly view lots of details about the SSL certificates installed on a particular server and diagnose problems. For example, use this command to look at Google's SSL certificates: openssl s_client -connect encrypted.google.com:443 You'll see the chain of certificates back to the original [...]<p><a href="http://rackerhacker.com/2012/02/07/using-openssls-s_client-command-with-web-servers-using-server-name-indication-sni/">Using OpenSSL's s_client command with web servers using Server Name Indication (SNI)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the handiest tools in the OpenSSL toolbox is <code>s_client</code>.  You can quickly view lots of details about the SSL certificates installed on a particular server and diagnose problems.  For example, use this command to look at Google's SSL certificates:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">openssl s_client -connect encrypted.google.com:443</pre></div></div>

<p>You'll see the chain of certificates back to the original certificate authority where Google bought its certificate at the top, a copy of their SSL certificate in plain text in the middle, and a bunch of session-related information at the bottom.</p>
<p>This works really well when a site has one SSL certificate installed per IP address (this used to be a hard requirement).  With <a href="http://en.wikipedia.org/wiki/Server_Name_Indication">Server Name Indication</a> (SNI), a web server can have multiple SSL certificates installed on the same IP address.  SNI-capable browsers will specify the hostname of the server they're trying to reach during the initial handshake process.  This allows the web server to determine the correct SSL certificate to use for the connection.</p>
<p>If you try to connect to rackerhacker.com with <code>s_client</code>, you'll find that you receive the default SSL certificate installed on my server and not the one for this site:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$ openssl s_client -connect rackerhacker.com:443
Certificate chain
 0 s:/C=US/ST=Texas/L=San Antonio/O=MHTX Enterprises/CN=*.mhtx.net
   i:/C=US/O=SecureTrust Corporation/CN=SecureTrust CA
 1 s:/C=US/O=SecureTrust Corporation/CN=SecureTrust CA
   i:/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority</pre></div></div>

<p>Add on the <code>-servername</code> argument and <code>s_client</code> will do the additional SNI negotiation step for you:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$ openssl s_client -connect rackerhacker.com:443 -servername rackerhacker.com
Certificate chain
 0 s:/OU=Domain Control Validated/OU=PositiveSSL/CN=rackerhacker.com
   i:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=PositiveSSL CA
 1 s:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=PositiveSSL CA
   i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
 2 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
   i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
 3 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
   i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root</pre></div></div>

<p>You may be asking yourself this question:</p>
<blockquote><p>Why doesn't the web server just use the <code>Host:</code> header that my browser sends already to figure out which SSL certificate to use?</p></blockquote>
<p>Keep in mind that the SSL negotiation must occur <b>prior</b> to sending the HTTP request through to the remote server.  That means that the browser and the server have to do the certificate exchange earlier in the process and the browser wouldn't get the opportunity to specify which site it's trying to reach.  SNI fixes that by allowing a <code>Host:</code> header type of exchange during the SSL negotiation process.</p>
<p><a href="http://rackerhacker.com/2012/02/07/using-openssls-s_client-command-with-web-servers-using-server-name-indication-sni/">Using OpenSSL's s_client command with web servers using Server Name Indication (SNI)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/07/using-openssls-s_client-command-with-web-servers-using-server-name-indication-sni/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Kerberos-hater&#039;s guide to installing Kerberos</title>
		<link>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/</link>
		<comments>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 21:03:52 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[nis]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhca]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2949</guid>
		<description><![CDATA[As promised in my earlier post entitled Kerberos for haters, I've assembled the simplest possible guide to get Kerberos up an running on two CentOS 5 servers. Also, I don't really hate Kerberos. It's a bit of an inside joke with my coworkers who are studying for some of the RHCA exams at Rackspace. The [...]<p><a href="http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/">The Kerberos-hater's guide to installing Kerberos</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://rackerhacker.com/wp-content/uploads/2012/02/haters_gonna_hate_elephhant.jpg"><img src="http://rackerhacker.com/wp-content/uploads/2012/02/haters_gonna_hate_elephhant-238x300.jpg" alt="Haters gonna hate - elephant" title="Haters gonna hate - elephant" width="171" height="216" class="alignright size-medium wp-image-2953" /></a>As promised in my earlier post entitled <a href="/2012/02/02/kerberos-for-haters/">Kerberos for haters</a>, I've assembled the simplest possible guide to get Kerberos up an running on two CentOS 5 servers.</p>
<p>Also, I don't really <em>hate</em> Kerberos.  It's a bit of an inside joke with my coworkers who are studying for some of the <a href="http://www.redhat.com/training/certifications/rhca/">RHCA</a> exams at Rackspace.  The additional security provided by Kerberos is quite good but the setup involves a lot of small steps.  If you miss one of the steps or if you get something done out of order, you may have to scrap the whole setup and start over unless you can make sense of the errors in the log files.  A lot of my dislikes for Kerberos comes from the number of steps required in the setup process and the difficulty in tracking down issues when they crop up.</p>
<p>To complete this guide, you'll need the following:</p>
<ul>
<li>two CentOS, Red Hat Enterprise Linux or Scientific Linux 5 servers or VM's</li>
<li>some patience</li>
</ul>
<p>Here's how I plan to name my servers:</p>
<ul>
<li><strong>kdc.example.com</strong> - the Kerberos KDC server at 192.168.250.2</li>
<li><strong>client.example.com</strong> - the Kerberos client at 192.168.250.3</li>
</ul>
<p><strong>CRITICAL STEP:</strong> Before getting started, ensure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in <code>/etc/hosts</code>.  Your server and client must be able to know the IP and hostname of the other system as well as themselves.</p>
<p>First off, we will need <a href="http://en.wikipedia.org/wiki/Network_Information_Service">NIS</a> working to serve up the user information for our client.  Install the NIS server components on the KDC server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum install ypserv</pre></div></div>

<p>Set the NIS domain and set a static port for <code>ypserv</code> to make it easier to firewall off.  Edit <code>/etc/sysconfig/network</code> on the KDC server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">NISDOMAINNAME=EXAMPLE.COM
YPSERV_ARGS=&quot;-p 808&quot;</pre></div></div>

<p>Manually set the NIS domain on the KDC server and add it to <code>/etc/yp.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# nisdomain EXAMPLE.COM
[root@kdc ~]# echo &quot;domain EXAMPLE.COM server kdc.example.com&quot; &gt;&gt; /etc/yp.conf</pre></div></div>

<p>Adjust <code>/var/yp/securenets</code> on the KDC server for additional security:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# echo &quot;255.0.0.0 127.0.0.0&quot; &gt;&gt; /var/yp/securenets
[root@kdc ~]# echo &quot;255.255.255.0 192.168.250.0&quot; &gt;&gt; /var/yp/securenets</pre></div></div>

<p>Start the NIS server and generate the NIS maps:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# /etc/init.d/ypserv start; chkconfig ypserv on
[root@kdc ~]# make -C /var/yp</pre></div></div>

<p>I usually like to prepare my iptables rules ahead of time so I ensure that it doesn't derail me later on.  Paste this into the KDC's terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -N SERVICES
iptables -I INPUT -j SERVICES
iptables -A SERVICES -p tcp --dport 111 -j ACCEPT -m comment --comment &quot;rpc&quot;
iptables -A SERVICES -p udp --dport 111 -j ACCEPT -m comment --comment &quot;rpc&quot;
iptables -A SERVICES -p tcp --dport 808 -j ACCEPT -m comment --comment &quot;nis&quot;
iptables -A SERVICES -p udp --dport 808 -j ACCEPT -m comment --comment &quot;nis&quot;
iptables -A SERVICES -p tcp --dport 88 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p udp --dport 88 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p udp --dport 464 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p tcp --dport 749 -j ACCEPT -m comment --comment &quot;kerberos&quot;
/etc/init.d/iptables save</pre></div></div>

<p>We need our time in sync for Kerberos to work properly.  Install NTP on both nodes, start it, and ensure it comes up at boot time:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum -y install ntp &amp;&amp; chkconfig ntpd on &amp;&amp; /etc/init.d/ntpd start
[root@client ~]# yum -y install ntp &amp;&amp; chkconfig ntpd on &amp;&amp; /etc/init.d/ntpd start</pre></div></div>

<p>Now we're ready to set up Kerberos.  Start by installing some packages on the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum install krb5-server krb5-workstation</pre></div></div>

<p>We will need to make some edits to <code>/etc/krb5.conf</code> on the KDC to set up our KDC realm.  Ensure that the <code>default_realm</code> is set:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">default_realm = EXAMPLE.COM</pre></div></div>

<p>The <code>[realms]</code> section should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[realms]
EXAMPLE.COM = {
	kdc = 192.168.250.2:88
	admin_server = 192.168.250.2:749
}</pre></div></div>

<p>The <code>[domain_realm]</code> section should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[domain_realm]
kdc.example.com = EXAMPLE.COM
client.example.com = EXAMPLE.COM</pre></div></div>

<p>Add <code>validate = true</code> within the <code>pam { }</code> block of the <code>[appdefaults]</code> section:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[appdefaults]
 pam = {
   validate = true</pre></div></div>

<p>Adjust <code>/var/kerberos/krb5kdc/kdc.conf</code> on the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[realms]
EXAMPLE.COM = {
	master_key_type = des-hmac-sha1
	default_principal_flags = +preauth
}</pre></div></div>

<p>There's one last configuration file to edit on the KDC!  Ensure that <code>/var/kerberos/krb5kdc/kadm5.acl</code> looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">*/admin@EXAMPLE.COM	    *</pre></div></div>

<p>We're now ready to make a KDC database to hold our sensitive Kerberos data.  Create the database and set a good password which you can remember.  This command also stashes your password on the KDC so you don't have to enter it each time you start the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kdb5_util create -r EXAMPLE.COM -s</pre></div></div>

<p>On the KDC, create a principal for the admin user as well as user1 (which we'll create shortly).  Also, export the admin details to the kadmind key tab.  You'll get some extra output after each one of these commands but I've snipped it to reduce the length of the post.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# kadmin.local
kadmin.local:  addprinc root/admin
kadmin.local:  addprinc user1
kadmin.local:  ktadd -k /var/kerberos/krb5kdc/kadm5.keytab kadmin/admin
kadmin.local:  ktadd -k /var/kerberos/krb5kdc/kadm5.keytab kadmin/changepw
kadmin.local:  exit</pre></div></div>

<p>Let's start the Kerberos KDC and kadmin daemons:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# /etc/init.d/krb5kdc start; /etc/init.d/kadmin start
[root@kdc ~]# chkconfig krb5kdc on; chkconfig kadmin on</pre></div></div>

<p>Now that the administration work is done, let's create a principal for our KDC server and stick it in it's keytab:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# kadmin.local
kadmin.local:  addprinc -randkey host/kdc.example.com
kadmin.local:  ktadd host/kdc.example.com</pre></div></div>

<p>Transfer your <code>/etc/krb5.conf</code> from the KDC server to the client.  Hop onto the client server, install the Kerberos client package and add some host principals:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# yum install krb5-workstation
[root@client ~]# kadmin.local
kadmin.local:  addpinc --randkey host/client.example.com
kadmin.local:  ktadd host/kdc.example.com</pre></div></div>

<p>There aren't any daemons on the client side, so the configuration is pretty much wrapped up there for Kerberos.  However, we now need to tell both servers to use Kerberos for auth and your client servers needs to use NIS to get user data.</p>
<ul>
<li>On the KDC:
<ul>
<li>run <code>authconfig-tui</code></li>
<li>choose <b>Use Kerberos</b> from the second column</li>
<li>press <b>Next</b></li>
<li>don't edit the configuration (authconfig got the data from <code>/etc/krb.conf</code>)</li>
<li>press <b>OK</b></li>
</ul>
</li>
<li>On the client:
<ul>
<li>run <code>authconfig-tui</code></li>
<li>choose <b>Use NIS</b> and <b>Use Kerberos</b></li>
<li>press <b>Next</b></li>
<li>enter your NIS domain (EXAMPLE.COM) and NIS server (kdc.example.com or 192.168.250.2)</li>
<li>press <b>Next</b></li>
<li>don't edit the Kerberos configuration (authconfig got the data from <code>/etc/krb.conf</code>)</li>
<li>press <b>OK</b></li>
</ul>
</li>
</ul>
<p><b>Got NIS problems?</b>  If the NIS connection stalls on the client, ensure that you have the iptables rules present on the KDC that we added near the beginning of this guide.  Also, if you forgot to add <b>both</b> hosts to <b>both</b> servers' <code>/etc/hosts</code>, go do that now.</p>
<p>Let's make our test user on the KDC.  <b>Don't add this user to the client</b> -- we'll get the user information via NIS and authenticate via Kerberos shortly.  We'll also rebuild our NIS maps after adding the user:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# useradd user1
[root@kdc ~]# passwd user1
[root@kdc ~]# make -C /var/yp/</pre></div></div>

<p>On the client, see if you can get the password hash for the user1 account via NIS:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ypcat -d EXAMPLE.COM -h kdc.example.com passwd | grep user1
user1:$1$sUlSTlCv$riK5El3z8N4y.mi5Fe3Q60:500:500::/home/user1:/bin/bash</pre></div></div>

<p>You can see why NIS isn't a good way to authenticate users.  Someone could easily pull the hash for any account and brute force the hash on their own server.  Go back to the KDC and lock out the user account:</p>
<pre>
[root@kdc ~]# usermod -p '!!' user1
</pre>
<p>Go back to the client and try to pull the password hash now:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ypcat -d EXAMPLE.COM -h kdc.example.com passwd | grep user1
user1:!!:500:500::/home/user1:/bin/bash</pre></div></div>

<p>On the plus side, the user's password hash is now gone.  On the negative side, you've just prevented this user from logging in locally or via NIS. Don't worry, the user can log in via Kerberos now.  Let's prepare a home directory on the client for the user:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# mkdir /home/user1
[root@client ~]# cp -av /etc/skel/.bash* /home/user1/
[root@client ~]# chown -R user1:user1 /home/user1/</pre></div></div>

<p>Note: In a real-world scenario, you'd probably want to export this user's home directory via NFS so they didn't get a different home directory on every server.</p>
<p>While you're still on the client, try to log into the client via the user.  Use the password that you used when you created the user1 principal on the KDC.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ssh user1@localhost
user1@localhost's password:
[user1@client ~]$ whoami
user1</pre></div></div>

<p>List your Kerberos tickets and you should see one for your user principal:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[user1@client ~]$ klist
Ticket cache: FILE:/tmp/krb5cc_500_fCKPnZ
Default principal: user1@EXAMPLE.COM
&nbsp;
Valid starting     Expires            Service principal
02/05/12 14:18:53  02/06/12 00:18:53  krbtgt/EXAMPLE.COM@EXAMPLE.COM
	renew until 02/05/12 14:18:53</pre></div></div>

<p>Your KDC should have a couple of lines in its <code>/var/log/krb5kdc.log</code> showing the authentication:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Feb 05 14:18:53 kdc.example.com krb5kdc[4694](info): AS_REQ (12 etypes {18 17 16 23 1 3 2 11 10 15 12 13}) 192.168.250.3: ISSUE: authtime 1328473133, etypes {rep=16 tkt=16 ses=16}, user1@EXAMPLE.COM for krbtgt/EXAMPLE.COM@EXAMPLE.COM
Feb 05 14:18:53 kdc.example.com krb5kdc[4694](info): TGS_REQ (7 etypes {18 17 16 23 1 3 2}) 192.168.250.3: ISSUE: authtime 1328473133, etypes {rep=16 tkt=18 ses=18}, user1@EXAMPLE.COM for host/client.example.com@EXAMPLE.COM</pre></div></div>

<p>The first line shows that the client asked for a Authentication Server Request (AS_REQ) and the second line shows that the client then asked for a Ticket Granting Server Request (TGS_REQ).  In layman's terms, the client first asked for a ticket-granting ticket (TGT) so it could authenticate to other services.  When it actually tried to log in via <code>ssh</code> it asked for a ticket (and received it).</p>
<p><b>YOU JUST CONFIGURED KERBEROS!</b></p>
<p>From here, the sky's the limit.  Another popular implementation of Kerberos is encrypted NFSv4.  You can even go crazy and use <a href="http://wiki.centos.org/HowTos/HttpKerberosAuth">Kerberos with apache</a>.</p>
<p>Let me know if you have any questions about this post or if you spot any errors.  With this many steps, there's bound to be a typo or two in this guide.  Keep in mind that there are some obvious spots for network-level and service-level security improvements.  This guide was intended to give you the basics and it doesn't cover all of the security implications involved with a Kerberos implementation.</p>
<p><a href="http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/">The Kerberos-hater's guide to installing Kerberos</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Get notifications instead of automatic updates in Scientific Linux</title>
		<link>http://rackerhacker.com/2012/02/04/get-notifications-instead-of-automatic-updates-in-scientific-linux/</link>
		<comments>http://rackerhacker.com/2012/02/04/get-notifications-instead-of-automatic-updates-in-scientific-linux/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 19:01:54 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[scientific linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2928</guid>
		<description><![CDATA[Scientific Linux installations have a package called yum-autoupdate by default and the package contains two files: # rpm -ql yum-autoupdate /etc/cron.daily/yum-autoupdate /etc/sysconfig/yum-autoupdate The cron job contains the entire script to run automatic updates once a day and the configuration file controls its behavior. However, you can't get the same functionality as Fedora's yum-updatesd package where [...]<p><a href="http://rackerhacker.com/2012/02/04/get-notifications-instead-of-automatic-updates-in-scientific-linux/">Get notifications instead of automatic updates in Scientific Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Scientific Linux installations have a package called <code>yum-autoupdate</code> by default and the package contains two files:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># rpm -ql yum-autoupdate
/etc/cron.daily/yum-autoupdate
/etc/sysconfig/yum-autoupdate</pre></div></div>

<p>The cron job contains the entire script to run automatic updates once a day and the configuration file controls its behavior.  However, you can't get the same functionality as Fedora's <code>yum-updatesd</code> package where you can receive notifications for updates rather than automatically updating the packages.</p>
<p>To get those notifications in Scientific Linux, just make two small edits to this portion of <code>/etc/cron.daily/yum-autoupdate</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">173</span>           <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;    Starting Yum with command&quot;</span>
<span style="color: #000000;">174</span>           <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     /usr/bin/yum -c <span style="color: #007800;">$TEMPCONFIGFILE</span> -e 0 -d 1 -y update&quot;</span>         
<span style="color: #000000;">175</span>   <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000;">176</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>yum <span style="color: #660033;">-c</span> <span style="color: #007800;">$TEMPCONFIGFILE</span> <span style="color: #660033;">-e</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-d</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-y</span> update <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$TEMPFILE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000;">177</span>   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$TEMPFILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span></pre></div></div>

<p>Adjust the <code>update</code> commands to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">173</span>           <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;    Starting Yum with command&quot;</span>
<span style="color: #000000;">174</span>           <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     /usr/bin/yum -c <span style="color: #007800;">$TEMPCONFIGFILE</span> -e 0 -d 1 -y check-update&quot;</span>         
<span style="color: #000000;">175</span>   <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000;">176</span>   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>yum <span style="color: #660033;">-c</span> <span style="color: #007800;">$TEMPCONFIGFILE</span> <span style="color: #660033;">-e</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-d</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-y</span> check-update <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$TEMPFILE</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000;">177</span>   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$TEMPFILE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span></pre></div></div>

<p>Since you won't be auto-updating with this script any longer, you may want to comment out the <code>EXCLUDE=</code> line in <code>/etc/sysconfig/yum-autoupdate</code> so that you'll receive notifications for all packages with updates.  Also, to avoid having your changes updated with a newer <code>yum-autoupdate</code> package later, add the package to your list of excluded packages in <code>/etc/yum.conf</code>.</p>
<p><a href="http://rackerhacker.com/2012/02/04/get-notifications-instead-of-automatic-updates-in-scientific-linux/">Get notifications instead of automatic updates in Scientific Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/04/get-notifications-instead-of-automatic-updates-in-scientific-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kerberos for haters</title>
		<link>http://rackerhacker.com/2012/02/02/kerberos-for-haters/</link>
		<comments>http://rackerhacker.com/2012/02/02/kerberos-for-haters/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 04:29:32 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhca]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2906</guid>
		<description><![CDATA[I'll be the first one to admit that Kerberos drives me a little insane. It's a requirement for two of the exams in Red Hat's RHCA certification track and I've been forced to learn it. It provides some pretty nice security features for large server environments. You get central single sign ons, encrypted authentication, and [...]<p><a href="http://rackerhacker.com/2012/02/02/kerberos-for-haters/">Kerberos for haters</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I'll be the first one to admit that Kerberos drives me a little insane.  It's a requirement for two of the exams in <a href="http://www.redhat.com/training/certifications/rhca/">Red Hat's RHCA certification track</a> and I've been forced to learn it.  It provides some pretty nice security features for large server environments.  You get central single sign ons, encrypted authentication, and bidirectional validation.  However, getting it configured can be a real pain due to some rather archaic commands and shells.</p>
<p>Here's Kerberos in a nutshell within a two-server environment:  One server is a Kerberos key distribution center (KDC) and the other is a Kerberos client.  The KDC has the list of users and their passwords.  Consider a situation where a user tries to ssh into the Kerberos client:</p>
<ul>
<li>sshd calls to pam to authenticate the user</li>
<li>pam calls to the KDC for a ticket granting ticket (TGT) to see if the user can authenticate</li>
<li>the KDC replies to the client with a TGT encrypted with the user's password</li>
<li>pam (on the client) tries to decrypt the TGT with the password that the user provided via ssh</li>
<li>if pam can decrypt the TGT, it knows the user is providing the right password</li>
</ul>
<p>Now that the client has a a TGT for that user, it can ask for tickets to access other network services.  What if the user who just logged in wants to access another Kerberized service in the environment?</p>
<ul>
<li>client calls the KDC and asks for a ticket to grant access to the other service</li>
<li>KDC replies with two copies of the ticket:
<ul>
<li>one copy is encrypted with the user's current TGT</li>
<li>a second copy is encrypted with the password of the network service the user wants to access</li>
</ul>
</li>
<li>the client can decrypt the ticket which was encrypted with the current TGT since it has the TGT already</li>
<li>client makes an authenticator by taking the decrypted ticket and encrypting it with a timestamp</li>
<li>client passes the authenticator and the second copy of the ticket it received from the KDC</li>
<li>the other network service decrypts the second copy of the ticket and verifies the password</li>
<li>the other network service uses the decrypted ticket to decrypt the authenticator it received from the client</li>
<li>if the timestamp looks good, the other network service allows the user access</li>
</ul>
<p>Okay, that's confusing.  Let's take it one step further.  Enabling pre-authentication requires that clients send a request containing a timestamp encrypted with the user's password prior to asking for a TGT.  Without this requirement, an attacker can ask for a TGT one time and then brute force the TGT offline.  Pre-authentication forces the client to send a timestamped request encrypted with the user's password back to the KDC before they can ask for a KDC.  This means the attacker is forced to try different passwords when encrypting the timestamp in the hopes that they'll get a TGT to work with eventually.  One would hope that you have something configured on the KDC to set off an alarm for multiple failed pre-authentication attempts.</p>
<p>Oh, but we can totally kick it up another notch.  What if an attacker is able to give a bad password to a client but they're also able to impersonate the KDC?  They could reply to the TGT request (as the KDC) with a TGT encrypted with whichever password they choose and get access to the client system.  Enabling mutual authentication stops this attack since it forces the client to ask the KDC for the client's own host principal password (this password is set when the client is configured to talk to the KDC).  The attacker shouldn't have any clue what that password is and the attack will be thwarted.</p>
<p>By this point, you're either saying "Oh man, I don't ever want to do this." or "How do I set up Kerberos?".  Stay tuned if you're in the second group.  I'll have a dead simple (or as close to dead simple as one can get with Kerberos) how-to on the blog shortly.</p>
<p>In the meantime, here are a few links for extra Kerberos bedtime reading:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Kerberos_(protocol)">Kerberos on Wikipedia</a></li>
<li><a href="http://www.kerberos.org/software/whykerberos.pdf">MIT's "Why Kerberos"</a> [PDF]</li>
<li><a href="http://learn-networking.com/network-security/how-kerberos-authentication-works">How Kerberos Authentication Works</a></li>
</ul>
<p><a href="http://rackerhacker.com/2012/02/02/kerberos-for-haters/">Kerberos for haters</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/02/kerberos-for-haters/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting started with SELinux</title>
		<link>http://rackerhacker.com/2012/01/25/getting-started-with-selinux/</link>
		<comments>http://rackerhacker.com/2012/01/25/getting-started-with-selinux/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 04:28:41 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[seliux]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2838</guid>
		<description><![CDATA[I used to be one of those folks who would install Fedora, CentOS, Scientific Linux, or Red Hat and disable SELinux during the installation. It always seemed like SELinux would get in my way and keep me from getting work done. Later on, I found that one of my servers (which I'd previously secured quite [...]<p><a href="http://rackerhacker.com/2012/01/25/getting-started-with-selinux/">Getting started with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I used to be one of those folks who would install Fedora, CentOS, Scientific Linux, or Red Hat and disable SELinux during the installation.  It always seemed like SELinux would get in my way and keep me from getting work done.  </p>
<p>Later on, I found that one of my servers (which I'd previously secured quite thoroughly) had some rogue processes running that were spawned through httpd.  Had I actually been using SELinux in enforcing mode, those processes would have probably never even started.</p>
<p>If you're trying to get started with SELinux but you're not sure how to do it without completely disrupting your server's workflow, these tips should help:</p>
<p><b>Get some good reporting and monitoring</b><br />
Two of the most handy SELinux tools are <a href="https://fedorahosted.org/setroubleshoot/">setroubleshoot and setroubleshoot-server</a>.  If you're running a server without X, you can use <a href="/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/">my guide for configuring setroubleshoot-server</a>.  You will receive email alerts within seconds of an AVC denial and the emails should contain tips on how to resolve the denial if the original action should be allowed.  If the AVC denial caught something you didn't expect, you'll know about the potential security breach almost immediately.</p>
<p><b>Start out with SELinux in permissive mode</b><br />
If you're overly concerned about SELinux getting in your way, or if you're enabling SELinux on a server that has been running without SELinux since it was installed, start out with SELinux in permissive mode.  To make the change effective immediately, just run:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># setenforce 0
# getenforce
Permissive</pre></div></div>

<p>Edit <code>/etc/sysconfig/selinux</code> to make it persistent across reboots:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive</pre></div></div>

<p><b>Adjust booleans before adding your own custom modules</b><br />
There are a lot of booleans you can toggle to get the functionality you need without adding your own custom SELinux modules with <code>audit2allow</code>.  If you wanted to see all of the applicable booleans for <code>httpd</code>, just use <code>getsebool</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># getsebool -a | grep httpd
httpd_builtin_scripting --&gt; on
httpd_can_check_spam --&gt; off
httpd_can_network_connect --&gt; on
httpd_can_network_connect_cobbler --&gt; off
httpd_can_network_connect_db --&gt; off
httpd_can_network_memcache --&gt; off
httpd_can_network_relay --&gt; on
httpd_can_sendmail --&gt; on
... and so on ...</pre></div></div>

<p>Toggling booleans is easy with <code>togglesebool</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># togglesebool httpd_can_network_memcache
httpd_can_network_memcache: active</pre></div></div>

<p>Now <code>httpd</code> can talk to <code>memcache</code>.  You can also use <code>setsebool</code> if you want to be specific about your setting (this is good for scripts):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># setsebool httpd_can_network_memcache on</pre></div></div>

<p><b>Tracking your history of AVC denials</b><br />
All of your AVC denals are logged by <code>auditd</code> in <code>/var/log/audit/audit.log</code> but it's not the easiest file to read and parse.  That's where <code>aureport</code> comes in:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># aureport --avc | tail -n 5
45. 01/24/2012 04:23:29 postdrop unconfined_u:system_r:httpd_t:s0 4 fifo_file getattr system_u:object_r:postfix_public_t:s0 denied 1061
46. 01/24/2012 04:23:29 postdrop unconfined_u:system_r:httpd_t:s0 2 fifo_file write system_u:object_r:postfix_public_t:s0 denied 1062
47. 01/24/2012 04:23:29 postdrop unconfined_u:system_r:httpd_t:s0 2 fifo_file open system_u:object_r:postfix_public_t:s0 denied 1062
48. 01/24/2012 14:01:58 sendmail unconfined_u:system_r:httpd_t:s0 160 process setrlimit unconfined_u:system_r:httpd_t:s0 denied 1123
49. 01/24/2012 14:01:58 postdrop unconfined_u:system_r:httpd_t:s0 4 dir search system_u:object_r:postfix_public_t:s0 denied 1124</pre></div></div>

<p><b>Summary</b><br />
There's no need to be scared of or be annoyed by SELinux in your server environment.  While it takes some getting used to (and what new software doesn't?), you'll have an extra layer of security and access restrictions which should let you sleep a little better at night.</p>
<p><a href="http://rackerhacker.com/2012/01/25/getting-started-with-selinux/">Getting started with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/01/25/getting-started-with-selinux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SELinux and .forward files</title>
		<link>http://rackerhacker.com/2012/01/02/selinux-and-forward-files/</link>
		<comments>http://rackerhacker.com/2012/01/02/selinux-and-forward-files/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 22:44:43 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2680</guid>
		<description><![CDATA[If you want to forward e-mail from root to another user, you can usually place a .forward file in root's home directory and your mail server will take care of the rest: echo &#34;user@example.com&#34; &#62; /root/.forward With SELinux, you'll end up getting an AVC denial each time your mail server tries to read the contents [...]<p><a href="http://rackerhacker.com/2012/01/02/selinux-and-forward-files/">SELinux and .forward files</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you want to forward e-mail from root to another user, you can usually place a <code>.forward</code> file in root's home directory and your mail server will take care of the rest:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo &quot;user@example.com&quot; &gt; /root/.forward</pre></div></div>

<p>With SELinux, you'll end up getting an AVC denial each time your mail server tries to read the contents of the <code>.forward</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">type=AVC msg=audit(1325543823.787:7416): avc:  denied  { open } for  pid=9850 
  comm=&quot;local&quot; name=&quot;.forward&quot; dev=md0 ino=17694734 
  scontext=system_u:system_r:postfix_local_t:s0 
  tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file</pre></div></div>

<p>The reason is that your <code>.forward</code> file doesn't have the right SELinux contexts.  You can set the correct contest quickly with <code>restorecon</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># ls -Z /root/.forward 
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 /root/.forward
# restorecon -v /root/.forward
restorecon reset /root/.forward context unconfined_u:object_r:admin_home_t:s0-&gt;system_u:object_r:mail_forward_t:s0
# ls -Z /root/.forward 
-rw-r--r--. root root system_u:object_r:mail_home_t:s0 /root/.forward</pre></div></div>

<p>Try to send another e-mail to root and you should see the mail server forward the e-mail properly without any additional AVC denials.</p>
<p><a href="http://rackerhacker.com/2012/01/02/selinux-and-forward-files/">SELinux and .forward files</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/01/02/selinux-and-forward-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Automatically upgrading to new point releases of Scientific Linux</title>
		<link>http://rackerhacker.com/2011/11/23/automatically-upgrading-to-new-point-releases-of-scientific-linux/</link>
		<comments>http://rackerhacker.com/2011/11/23/automatically-upgrading-to-new-point-releases-of-scientific-linux/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:20:12 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[scientific linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2672</guid>
		<description><![CDATA[When you install Scientific Linux, it will keep you on the same point release that you installed. For example, if you install it from a 6.0 DVD, you'll stay on 6.0 and get security releases for that point release only. Getting it to behave like Red Hat Enterprise Linux and CentOS is a painless process. [...]<p><a href="http://rackerhacker.com/2011/11/23/automatically-upgrading-to-new-point-releases-of-scientific-linux/">Automatically upgrading to new point releases of Scientific Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>When you install Scientific Linux, it will keep you on the same point release that you installed.  For example, if you install it from a 6.0 DVD, you'll stay on 6.0 and get security releases for that point release only.</p>
<p>Getting it to behave like Red Hat Enterprise Linux and CentOS is a painless process.  Just install the <em>sl6x</em> repository with <code>yum</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum install yum-conf-sl6x</pre></div></div>

<p>Check to ensure that you're getting updates from the new repository:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># yum repolist
repo id            repo name                                              status
sl                 Scientific Linux 6.1 - x86_64                          6,251
sl-security        Scientific Linux 6.1 - x86_64 - security updates         548
sl6x               Scientific Linux 6x - x86_64                           6,251
sl6x-security      Scientific Linux 6x - x86_64 - security updates          548
repolist: 13,598</pre></div></div>

<p><a href="http://rackerhacker.com/2011/11/23/automatically-upgrading-to-new-point-releases-of-scientific-linux/">Automatically upgrading to new point releases of Scientific Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/11/23/automatically-upgrading-to-new-point-releases-of-scientific-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Receive e-mail reports for SELinux AVC denials</title>
		<link>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/</link>
		<comments>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 04:17:04 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[messagebus]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[systemd]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2537</guid>
		<description><![CDATA[SELinux isn't a technology that's easy to tackle for newcomers. However, there's been a lot of work to smooth out the rough edges while still keeping a tight grip on what applications and users are allowed to do on a Linux system. One of the biggest efforts has been around setroubleshoot. The purpose behind setroubleshoot [...]<p><a href="http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/">Receive e-mail reports for SELinux AVC denials</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>SELinux isn't a technology that's easy to tackle for newcomers.  However, there's been a lot of work to smooth out the rough edges while still keeping a tight grip on what applications and users are allowed to do on a Linux system.  One of the biggest efforts has been around <a href="https://fedorahosted.org/setroubleshoot/wiki/SETroubleShoot%20Overview">setroubleshoot</a>.</p>
<p>The purpose behind setroubleshoot is to let users know when access has been denied, help them resolve it if necessary, and to reduce overall frustration while working through tight security restrictions in the default SELinux policies.  The GUI frontend for setroubleshoot is great for users who run Linux desktops or those who run servers with a display attached.  Don't worry, you can configure setroubleshoot on remote servers to send alerts elsewhere when a GUI alert isn't an option.</p>
<p>Install a few packages to get started:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum install setroubleshoot{-server,-plugins,-doc}</pre></div></div>

<p>Open <code>/etc/setroubleshoot/setroubleshoot.conf</code> in your favorite text editor and adjust the <code>[email]</code> section to fit your server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">recipients_filepath = /var/lib/setroubleshoot/email_alert_recipients
smtp_port = 25
smtp_host = localhost
from_address = selinux@myserver.com
subject = [MyServer] SELinux AVC Alert</pre></div></div>

<p>You could probably see it coming, but you need to put the e-mail addresses for your recipients into <code>/var/lib/setroubleshoot/email_alert_recipients</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo &quot;selinux@mycompany.com&quot; &gt;&gt; /var/lib/setroubleshoot/email_alert_recipients</pre></div></div>

<p>You'll notice that setroubleshoot doesn't have an init script and it doesn't exist in systemd in Fedora 15.  It runs through the <a href="http://en.wikipedia.org/wiki/D-Bus">dbus-daemon</a> and a quick bounce of the messagebus via its init script brings in the necessary components to run setroubleshoot:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">service messagebus restart</pre></div></div>

<p>A really easy (and safe) test is to ask sshd to bind to a non-standard port.  Simply define an additional port on in your <code>/etc/ssh/sshd_config</code> like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Port 22
Port 222</pre></div></div>

<p>When you restart sshd, it will bind to port 22 with success, but it won't be allowed to bind to port 222 (since that's blocked by SELinux as a non-standard port for the <code>ssh_port_t</code> port type).  <strong>DON'T WORRY!</strong> Your sshd server will still be listening on port 22.  If you wait a moment, you'll get an e-mail (perhaps two) that not only notify you of the denial, but they make suggestions for how to fix it:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">SELinux is preventing /usr/sbin/sshd from name_bind access on the tcp_socket port 222.
&nbsp;
*****  Plugin bind_ports (99.5 confidence) suggests  *************************
&nbsp;
If you want to allow /usr/sbin/sshd to bind to network port 222
Then you need to modify the port type.
Do
# semanage port -a -t PORT_TYPE -p tcp 222
   where PORT_TYPE is one of the following: ...</pre></div></div>

<p>For this particular example, the quick fix would be to run:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">semanage port -a -t ssh_port_t -p tcp 222</pre></div></div>

<hr />
<em><br />
Much of this post's information was gathered from the detailed documentation on <a href="http://fedoraproject.org/wiki/Docs/Drafts/SELinux/SETroubleShoot/UserFAQ">Fedora's setroubleshoot User's FAQ</a> as well as <a href="http://danwalsh.livejournal.com/20931.html">Dan Walsh's setroubleshoot blog post</a>.<br />
</em></p>
<p><a href="http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/">Receive e-mail reports for SELinux AVC denials</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting apache, PHP, and memcached working with SELinux</title>
		<link>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/</link>
		<comments>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 03:55:00 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2516</guid>
		<description><![CDATA[I'm using SELinux more often now on my Fedora 15 installations and I came up against a peculiar issue today on a new server. My PHP installation is configured to store its sessions in memcached and I brought over some working configurations from another server. However, each time I accessed a page which tried to [...]<p><a href="http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/">Getting apache, PHP, and memcached working with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://rackerhacker.com/wp-content/uploads/2011/09/selinux-penguin-125.png"><img src="http://rackerhacker.com/wp-content/uploads/2011/09/selinux-penguin-125.png" alt="SELinux Penguin" title="SELinux Penguin" width="125" height="113" class="alignright size-full wp-image-2532" /></a>I'm using SELinux more often now on my Fedora 15 installations and I came up against a peculiar issue today on a new server.  My PHP installation is configured to store its sessions in memcached and I brought over some working configurations from another server.  However, each time I accessed a page which tried to initiate a session, the page load would hang for about a minute and I'd find this in my apache error logs:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[Thu Sep 08 03:23:40 2011] [error] [client 11.22.33.44] PHP Warning:  
Unknown: Failed to write session data (memcached). Please verify that 
the current setting of session.save_path is correct (127.0.0.1:11211) 
in Unknown on line 0</pre></div></div>

<p>I ran through my usual list of checks:</p>
<ul>
<li>netstat showed memcached bound to the correct ports/interfaces</li>
<li>memcached was running and I could reach it via telnet</li>
<li>memcached-tool could connect and pull stats from memcached</li>
<li>double-checked my php.ini</li>
<li>tested memcached connectivity via a PHP and ruby script -- they worked</li>
</ul>
<p>Even after all that, I still couldn't figure out what was wrong.  I ran strace on memcached while I ran a curl against the page which creates a session and I found something significant -- memcached wasn't seeing any connections whatsoever at that time.  A quick check of the lo interface with tcpdump showed the same result.  Just before I threw a chair, I remembered one thing:</p>
<p><em>SELinux.</em></p>
<p>A quick check for AVC denials showed the problem:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># aureport --avc | tail -n 1
4021. 09/08/2011 03:23:38 httpd system_u:system_r:httpd_t:s0 42 tcp_socket name_connect system_u:object_r:memcache_port_t:s0 denied 31536</pre></div></div>

<p>I'm far from being a guru on SELinux, so I leaned on audit2allow for help:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># grep memcache /var/log/audit/audit.log | audit2allow
&nbsp;
#============= httpd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     httpd_can_network_relay, httpd_can_network_memcache, httpd_can_network_connect
&nbsp;
allow httpd_t memcache_port_t:tcp_socket name_connect;</pre></div></div>

<p>The boolean we're looking for is <code>httpd_can_network_memcache</code>. Flipping the boolean can be done in a snap:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># setsebool -P httpd_can_network_memcache 1
# getsebool httpd_can_network_memcache
httpd_can_network_memcache --&gt; on</pre></div></div>

<p>After adjusting the boolean, apache was able to make connections to memcached without a hitch.  My page which created sessions loaded quickly and I could see data being stored in memcached.  If you want to check the status of all of the apache-related SELinux booleans, just use getsebool:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># getsebool -a | grep httpd | grep off$
allow_httpd_anon_write --&gt; off
allow_httpd_mod_auth_ntlm_winbind --&gt; off
allow_httpd_mod_auth_pam --&gt; off
allow_httpd_sys_script_anon_write --&gt; off
httpd_can_check_spam --&gt; off
httpd_can_network_connect_cobbler --&gt; off
httpd_can_network_connect_db --&gt; off
httpd_can_network_relay --&gt; off
httpd_can_sendmail --&gt; off
httpd_dbus_avahi --&gt; off
httpd_enable_ftp_server --&gt; off
httpd_enable_homedirs --&gt; off
httpd_execmem --&gt; off
httpd_read_user_content --&gt; off
httpd_setrlimit --&gt; off
httpd_ssi_exec --&gt; off
httpd_tmp_exec --&gt; off
httpd_unified --&gt; off
httpd_use_cifs --&gt; off
httpd_use_gpg --&gt; off
httpd_use_nfs --&gt; off</pre></div></div>

<p>If you're interested in SELinux, a good way to get your feet wet is to head over to the CentOS Wiki and review their <a href="http://wiki.centos.org/HowTos/SELinux">SELinux Howtos</a></p>
<p><a href="http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/">Getting apache, PHP, and memcached working with SELinux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/09/07/getting-apache-php-and-memcached-working-with-selinux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Strategies for detecting a compromised Linux server</title>
		<link>http://rackerhacker.com/2011/03/09/strategies-for-detecting-a-compromised-linux-server/</link>
		<comments>http://rackerhacker.com/2011/03/09/strategies-for-detecting-a-compromised-linux-server/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 02:52:16 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[general advice]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1273</guid>
		<description><![CDATA[There are few things which will rattle systems administrators more than a compromised server. It gives you the same feeling that you would have if someone broke into your house or car, except that it's much more difficult (with a server) to determine how to clean up the compromise and found out how the attacker [...]<p><a href="http://rackerhacker.com/2011/03/09/strategies-for-detecting-a-compromised-linux-server/">Strategies for detecting a compromised Linux server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>There are few things which will rattle systems administrators more than a compromised server.  It gives you the same feeling that you would have if someone broke into your house or car, except that it's much more difficult (with a server) to determine how to clean up the compromise and found out how the attacker gained access.  In addition, leaving a compromise in place for an extended period can lead to other problems:</p>
<ul>
<li>your server could be used to gain access other servers</li>
<li>data could be stolen from your server's databases or storage devices</li>
<li>an attacker could capture data from your server's local network</li>
<li>denial of service attacks could be launched using your server as an active participant</li>
</ul>
<p>The best ways to limit your server's attack surface are pretty obvious: limit network access, keep your OS packages up to date, and regularly audit any code which is accessible externally or internally.  As we all know, your server can still become compromised even with all of these preventative measures in place.</p>
<p>Here are some tips which will allow you to rapidly detect a compromise on your servers:</p>
<p><strong>Abnormal network usage patterns and atypical bandwidth consumption</strong><br />
Most sites will have a fairly normal traffic pattern which repeats itself daily.  If your traffic graph suddenly has a plateau or spikes drastically during different parts of the day, that could signify that there is something worth reviewing.  Also, if your site normally consumes about 2TB of traffic per month and you're at the 1.5TB mark on the fifth day of the month, you might want to examine the server more closely.</p>
<p>On the flip side, look for dips in network traffic as well.  This may mean that a compromise is interfering with the operation of a particular daemon, or there may be a rogue daemon listening on a trusted port during certain periods.</p>
<p>Many compromises consist of simple scripts which scan for other servers to infect or participate in large denial of service attacks.  The scans may show up as a large amount of packets, but the denial of service attacks will usually consume a large amount of bandwidth.  Keeping tabs on network traffic is easily done with open source software like <a href="http://munin-monitoring.org/">munin</a>, <a href="http://www.cacti.net/">cacti</a>, or <a href="http://oss.oetiker.ch/mrtg/">MRTG</a>.</p>
<p><strong>Unusual open ports</strong><br />
If you run a web server on port 80, but <code>netstat -ntlp</code> shows something listening on various ports over 1024, those processes are worth reviewing.  Use commands like <code>lsof</code> to probe the system for the files and network ports held open by the processes.  You can also check within <code>/proc/[pid]</code> to find the directory where the processes were originally launched.</p>
<p>Watch out for processes started within directories like <code>/dev/shm</code>, <code>/tmp</code> or any directories in which your daemons have write access.  You might see that some processes were started in a user's home directory.  If that's the case, it might be a good time to reset that user's password or clear out their ssh key.  Review the output from <code>last</code> authentication logs to see if there are account logins from peculiar locations.  If you know the user lives in the US, but there are logins from various other countries over a short period, you've got a serious problem.</p>
<p>I've used applications like <a href="http://www.chkrootkit.org/">chkrootkit</a> and <a href="http://www.rootkit.nl/projects/rootkit_hunter.html">rkhunter</a> in the past, but I still prefer a keen eye and <code>netstat</code> on most occasions. </p>
<p><strong>Command output is unusual</strong><br />
I've seen compromises in the past where the attacker actually took the time to replace integral applications like <code>ps</code>, <code>top</code> and <code>lsof</code> to hide the evidence of the ongoing compromise.  However, a quick peek in <code>/proc</code> revealed that there was a lot more going on.</p>
<p>If you suspect a compromise like this one, you may want to use the functionality provided by <code>rpm</code> to verify the integrity of the packages currently installed.  You can quickly hunt for changed files by running <code>rpm -Va | grep ^..5</code>.</p>
<p>Keeping tabs on changing files can be a challenge, but applications like <a href="http://www.tripwire.org/">tripwire</a> and good ol' <a href="http://www.logwatch.org/">logwatch</a> can save you in a pinch.</p>
<p><strong>Summary</strong><br />
We can all agree that the best way to prevent a compromise is to take precautions before putting anything into production.  In real life, something will always be forgotten, so detection is a must.  It's critical to keep in mind that <em>monitoring a server means more than keeping track on uptime</em>.  Keeping tabs on performance anomalies will allow you to find the compromise sooner and that keeps the damage done to a minimum.</p>
<p><a href="http://rackerhacker.com/2011/03/09/strategies-for-detecting-a-compromised-linux-server/">Strategies for detecting a compromised Linux server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/03/09/strategies-for-detecting-a-compromised-linux-server/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Accessing Rackspace Cloud Servers and Slicehost slices privately via OpenVPN</title>
		<link>http://rackerhacker.com/2010/11/16/accessing-rackspace-cloud-servers-and-slicehost-slices-privately-via-openvpn/</link>
		<comments>http://rackerhacker.com/2010/11/16/accessing-rackspace-cloud-servers-and-slicehost-slices-privately-via-openvpn/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 13:52:53 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[networkmanager]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1889</guid>
		<description><![CDATA[A recent blog post from Mixpanel inspired me to write a quick how-to for Fedora users on using OpenVPN to talk to instances privately in the Rackspace Cloud. The diagram at the right gives an idea of what this guide will allow you to accomplish. Consider a situation where you want to talk to the [...]<p><a href="http://rackerhacker.com/2010/11/16/accessing-rackspace-cloud-servers-and-slicehost-slices-privately-via-openvpn/">Accessing Rackspace Cloud Servers and Slicehost slices privately via OpenVPN</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1897" class="wp-caption alignright" style="width: 298px"><a href="http://rackerhacker.com/wp-content/uploads/2010/11/openvpn-to-rackspace-cloud-diagram.png"><img src="http://rackerhacker.com/wp-content/uploads/2010/11/openvpn-to-rackspace-cloud-diagram.png" alt="Diagram: OpenVPN to Rackspace Cloud Servers and Slicehost" title="Diagram: OpenVPN to Rackspace Cloud Servers and Slicehost" width="288" height="248" class="size-full wp-image-1897" /></a><p class="wp-caption-text">Diagram: OpenVPN to Rackspace Cloud Servers and Slicehost</p></div><br />
A recent <a href="http://code.mixpanel.com/openvpn-in-the-rackspace-cloud/">blog post from Mixpanel</a> inspired me to write a quick how-to for Fedora users on using OpenVPN to talk to instances privately in the Rackspace Cloud.</p>
<p>The diagram at the right gives an idea of what this guide will allow you to accomplish.  Consider a situation where you want to talk to the MySQL installation on db1 directly without requiring extra ssh tunnels or MySQL over SSL via the public network.  If you tunnel into one of your instances, you can utilize the private network to talk between your instances very easily.</p>
<p>There's one important thing to keep in mind here: even though you'll be utilizing the private network between your tunnel endpoint and your other instances, your traffic will still traverse the public network.  That means that the instance with your tunnel endpoint will still get billed for the traffic flowing through your tunnel.</p>
<p>You'll only need the openvpn package on the server side:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum -y install openvpn</pre></div></div>

<p>Throw down this simple configuration file into /etc/openvpn/server.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">port 1194
proto tcp
dev tun
persist-key
persist-tun
&nbsp;
server 10.66.66.0 255.255.255.0
ifconfig-pool-persist ipp.txt
&nbsp;
#push &quot;route 10.0.0.0 255.0.0.0&quot;
push &quot;route 10.176.0.0 255.248.0.0&quot;
keepalive 10 120
&nbsp;
ca      /etc/openvpn/my_certificate_authority.pem
cert    /home/major/vpn_server_cert.pem
key     /home/major/vpn_server_key.pem
dh      /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
&nbsp;
status log/openvpn-status.log
verb 3</pre></div></div>

<p>Here's a bit of explanation for some things you may want to configure:</p>
<ul>
<li><code>push</code> - These are the routes that will be sent over the VPN that are pushed to the clients.  If you don't use any IP addresses in the 10.0.0.0/8 network block in your office, you can probably use the commented out line above.  However, you may want to be more specific with the routes if you happen to use any 10.0.0.0/8 space in your office.</li>
<li><code>server</code> - These are the IP addresses that the VPN server will assign and NAT out through the private interface.  I've used a /24 above, but you may want to adjust the netmask if you have a lot of users making tunnels to your VPN endpoint.</li>
<li><code>ca, cert, key</code> - You will need to create a certificate authority as well as a certificate/key pair for your VPN endpoint.  I already use <a href="http://simpleauthority.com/">SimpleAuthority</a> on my Mac to manage some other CA's and certificates, but you can use <a href="http://openvpn.net/index.php/open-source/documentation/miscellaneous/77-rsa-key-management.html">openvpn's easy-rsa</a> scripts if you wish.  They are already included with the openvpn installation.</li>
</ul>
<p>Build your Diffie-Hellman parameters file:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">cd /etc/openvpn/easy-rsa/2.0/ &amp;&amp; ./build-dh</pre></div></div>

<p>Tell iptables that you want to NAT your VPN endpoint traffic out to all 10.x.x.x IP addresses on the private network:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j MASQUERADE</pre></div></div>

<p>The last step on the server side is to ensure that the kernel will forward packets from the VPN endpoint out through the private interface.  Ensure that your /etc/sysctl.conf looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Controls IP packet forwarding
net.ipv4.ip_forward = 1</pre></div></div>

<p>Adjusting your sysctl.conf ensures that forwarding is enabled at boot time, but you'll need to enable it on your VPN endpoint right now:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre></div></div>

<p>Start the openvpn server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">/etc/init.d/openvpn start</pre></div></div>

<p>If all is well, you should see openvpn listening on port 1194:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@lb2 ~]# netstat -ntlp | grep openvpn
tcp        0      0 0.0.0.0:1194      0.0.0.0:*         LISTEN      2020/openvpn</pre></div></div>

<p>You'll need to configure a client to talk to your VPN now.  This involves three steps: creating a new certificate/key pair for the client (same procedure as making your server certificates), signing the client's certificate with your CA certificate (same one that you used above to sign your server certificates), and then configuring your client application to access the VPN.</p>
<p>There are <strong>many</strong> openvpn clients out there to choose from.</p>
<p>If you're using a Linux desktop, you may want to consider using the <a href="http://geraner.typepad.com/blog/2009/10/how-to-create-an-openvpn-connect-in-linux-version-2.html">built-in VPN functionality in NetworkManager</a>.  For Mac users, I'd highly recommend using <a href="http://www.thesparklabs.com/viscosity/">Viscosity</a> ($9), but there's also <a href="http://code.google.com/p/tunnelblick/">tunnelblick</a> (free).</p>
<p><a href="http://rackerhacker.com/2010/11/16/accessing-rackspace-cloud-servers-and-slicehost-slices-privately-via-openvpn/">Accessing Rackspace Cloud Servers and Slicehost slices privately via OpenVPN</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/11/16/accessing-rackspace-cloud-servers-and-slicehost-slices-privately-via-openvpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Securing your ssh server</title>
		<link>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/</link>
		<comments>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 22:39:15 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1164</guid>
		<description><![CDATA[One of the most common questions that I see in my favorite IRC channel is: "How can I secure sshd on my server?" There's no single right answer, but most systems administrators combine multiple techniques to provide as much security as possible with the least inconvenience to the end user. Here are my favorite techniques [...]<p><a href="http://rackerhacker.com/2010/10/12/securing-your-ssh-server/">Securing your ssh server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the most common questions that I see in <a href="irc://irc.freenode.net/slicehost">my favorite IRC channel</a> is: "How can I secure sshd on my server?"  There's no single right answer, but most systems administrators combine multiple techniques to provide as much security as possible with the least inconvenience to the end user.</p>
<p>Here are my favorite techniques listed from most effective to least effective:</p>
<p><strong>SSH key pairs</strong><br />
By disabling password-based authentication and requiring ssh key pairs, you reduce the chances of compromise via a brute force attack.  This can also help you protect against weak account passwords since a valid private key is required to gain access to the server.  However, a weak account password is still a big problem if you allow your users to use sudo.</p>
<p>If you're new to using ssh keys, there are <a href="http://sial.org/howto/openssh/publickey-auth/">many</a> <a href="http://www.debian-administration.org/articles/530">great</a> <a href="http://www.linuxquestions.org/linux/answers/Networking/Public_key_authentication_with_ssh">guides</a> that can walk you through the process.</p>
<p><strong>Firewall</strong><br />
Limiting the source IP addresses that can access your server on port 22 is simple and effective.  However, if you travel on vacation often or your home IP address changes frequently, this may not be a convenient way to limit access.  Acquiring a server with trusted access through your firewall would make this method easier to use, but you'd need to <a href="http://en.wikipedia.org/wiki/Recursion">consider the security of that server as well</a>.</p>
<p>The iptables rules would look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -j ACCEPT -p tcp --dport 22 -s 10.0.0.20
iptables -A INPUT -j ACCEPT -p tcp --dport 22 -s 10.0.0.25
iptables -A INPUT -j DROP -p tcp --dport 22</pre></div></div>

<p><strong>Use a non-standard port</strong><br />
I'm not a big fan of <a href="http://en.wikipedia.org/wiki/Security_through_obscurity">security through obscurity</a> and it doesn't work well for ssh.  If someone is simply scanning a subnet to find ssh daemons, you might not be seen the first time.  However, if someone is targeting you specifically, changing the ssh port doesn't help at all.  They'll find your ssh banner quickly and begin their attack.</p>
<p>If you prefer this method, simply adjust the <code>Port</code> configuration parameter in your sshd_config file.</p>
<p><strong>Limit users and groups</strong><br />
If you have only certain users and groups who need ssh access to your server, setting user or group limits can help increase security.  Consider a server which needs ssh access for developers and a manager.  Adding this to to your sshd_config would allow only those users and groups to access your ssh daemon:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">AllowGroups developers
AllowUsers jsmith pjohnson asamuels</pre></div></div>

<p>Keep in mind that any users or groups not included in the sshd_config won't be able to access your ssh server.</p>
<p><strong>TCP wrappers</strong><br />
While <a href="http://en.wikipedia.org/wiki/TCP_Wrapper">TCP wrappers</a> are tried and true, I consider them to be a bit old-fashioned.  I've found that many new systems administrators may not think of TCP wrappers when they diagnose server issues and this could possibly cause delays when adjustments need to be made later.</p>
<p>If you're ready to use TCP wrappers to limit ssh connections, check out <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-tcpwrappers-access.html">Red Hat's extensive documentation</a>.</p>
<p><strong>fail2ban and denyhosts</strong><br />
For those systems administrators who want to take a bit more active stance on blocking brute force attacks, there's always <a href="http://en.wikipedia.org/wiki/Fail2ban">fail2ban</a> or <a href="http://en.wikipedia.org/wiki/DenyHosts">denyhosts</a>.  Both fail2ban and denyhosts monitor your authentication logs for repeated failures, but denyhosts can only work with your ssh daemon.  You can use fail2ban with other applications like web servers and FTP servers.</p>
<p>The only downside of using these applications is that if a valid user accidentally tries to authenticate unsuccessfully multiple times, they may be locked out for a period of time.  This could be a big problem if you're in the middle of a server emergency.</p>
<p>A quick search on Google will give you instructions on <a href="http://www.fail2ban.org/wiki/index.php/HOWTOs">fail2ban configuration</a> as well as <a href="http://denyhosts.sourceforge.net/faq.html#2_0">denyhosts configuration</a>.</p>
<p><strong>Port knocking</strong><br />
Although <a href="http://en.wikipedia.org/wiki/Port_knocking">port knocking</a> is another tried and true method to prevent unauthorized access, it can be annoying to use unless you have users who are willing to jump through additional hoops.  Port knocking involves a "knock" on an arbitrary port that then allows the ssh daemon to be exposed to the user who sent the original knock.</p>
<p><a href="http://www.linuxjournal.com/article/6811">Linux Journal</a> has a great article explaining how port knocking works and it provides some sample configurations as well.</p>
<p><strong>Conclusion</strong><br />
The best way to secure your ssh daemon is to apply more than one of these methods to your servers.  Weighing security versus convenience of access isn't an easy task and it will be different for every environment.  Regardless of the method or methods you choose, ensure that the rest of your team is comfortable with the changes and capable of adapting to them efficiently.</p>
<p><a href="http://rackerhacker.com/2010/10/12/securing-your-ssh-server/">Securing your ssh server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>A simple guide to redundant cloud hosting</title>
		<link>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/</link>
		<comments>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:41:16 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cloud servers]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1771</guid>
		<description><![CDATA[Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago. I've written a guide on how to host a web application redundantly in a cloud environment. While it's still a bit of a rough draft, it should be a good starting point for those [...]<p><a href="http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/">A simple guide to redundant cloud hosting</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago.  I've <a href="/redundant-cloud-hosting-configuration-guide/">written a guide</a> on how to host a web application redundantly in a cloud environment.  While it's still a bit of a rough draft, it should be a good starting point for those who haven't worked in virtualized environments before.  Also, it may show some of the more experienced systems administrators a new way to do things.</p>
<p>The guide: <a href="/redundant-cloud-hosting-configuration-guide/">Redundant Cloud Hosting Guide</a></p>
<p>As always, if you find anything in the guide that needs improvement, I'm all ears. <img src='http://rackerhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/">A simple guide to redundant cloud hosting</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding comments to iptables rules</title>
		<link>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/</link>
		<comments>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 15:00:52 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1619</guid>
		<description><![CDATA[After I wrote a recent post on best practices for iptables, I noticed that I forgot to mention comments for iptables rules. They can be extremely handy if you have some obscure rules for odd situations. To make an iptables rule with a comment, simply add on the following arguments to the rule: -m comment [...]<p><a href="http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/">Adding comments to iptables rules</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>After I wrote a recent post on <a href="http://rackerhacker.com/2010/04/12/best-practices-iptables/">best practices for iptables</a>, I noticed that I forgot to mention comments for iptables rules.  They can be extremely handy if you have some obscure rules for odd situations.</p>
<p>To make an iptables rule with a comment, simply add on the following arguments to the rule:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">-m comment --comment &quot;limit ssh access&quot;</pre></div></div>

<p>Depending on your distribution, you may need to load the <code>ipt_comment</code> or <code>xt_comment</code> modules into your running kernel first.</p>
<p>A full iptables rule to limit ssh access would look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -j DROP -p tcp --dport 22 -m comment --comment &quot;limit ssh access&quot;</pre></div></div>

<p><a href="http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/">Adding comments to iptables rules</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rackspace Cloud Tech Podcast Episode 2</title>
		<link>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/</link>
		<comments>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:51:39 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1295</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=QC4KxSbWKEQ I participated in a podcast for the Rackspace Cloud with Robert Collazo last week. We covered some important topics including network security and convenient deployment tools. Rackspace Cloud Tech Podcast Episode 2 is a post from: Major Hayden's Racker Hacker blog. Thanks for following the blog via the RSS feed. Please don't copy my [...]<p><a href="http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/">Rackspace Cloud Tech Podcast Episode 2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=QC4KxSbWKEQ&#038;fmt=18">http://www.youtube.com/watch?v=QC4KxSbWKEQ</a></p>
<p>I participated in a <a href="http://www.rackspacecloud.com/blog/2010/03/05/tech-cloud-cast-episode-2/">podcast</a> for the <a href="http://rackspacecloud.com/">Rackspace Cloud</a> with <a href="http://twitter.com/rcollazo">Robert Collazo</a> last week.  We covered some important topics including network security and convenient deployment tools.</p>
<p><a href="http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/">Rackspace Cloud Tech Podcast Episode 2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Private network interfaces: the forgotten security hole</title>
		<link>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/</link>
		<comments>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:55:07 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tcpwrappers]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1263</guid>
		<description><![CDATA[Regardless of the type of hosting you're using - dedicated or cloud - it's important to take network interface security seriously. Most often, threats from the internet are the only ones mentioned. However, if you share a private network with other customers, you have just as much risk on that interface. Many cloud providers allow [...]<p><a href="http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/">Private network interfaces: the forgotten security hole</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Regardless of the type of hosting you're using - dedicated or cloud - it's important to take network interface security seriously.  Most often, threats from the internet are the only ones mentioned.  However, if you share a private network with other customers, you have just as much risk on that interface.</p>
<p>Many cloud providers allow you access to a private network environment where you can exchange data with other instances or other services offered by the provider.  The convenience of this access comes with a price: other instances can access your instance on the private network just as easily as they could on the public interface.</p>
<p>Here are some security tips for your private interfaces:</p>
<p><strong>Disable the private interface</strong><br />
This one is pretty simple.  If you have only one instance or server, and you don't need to communicate privately with any other instances, just disable the interface.  Remember to configure your networking scripts to leave the interface disabled after reboots.</p>
<p><strong>Use packet filtering</strong><br />
The actual mechanism will vary based on your operating system, but filtering packets is the one of the simplest ways to secure your private interface.  You can take some different approaches with them, but I find the easiest method is to allow access from your other instances and reject all other traffic.</p>
<p>For additional security, you can limit access based on ports as well as source IP addresses.  This could prevent an attacker from having easy access to your other instances if they're able to break into one of them.</p>
<p><strong>Configure your daemons to listen on the appropriate interfaces</strong><br />
If there are services that don't need to be listening on the private network, don't allow them to listen on your private interface.  For example, MySQL might need to listen on the private interface so the web server can talk to it, but apache won't need to listen on the private interface.  This reduces the profile of your instance on the private network and makes it a less likely target for attack.</p>
<p><strong>Use hosts.allow and hosts.deny</strong><br />
Many new systems administrators forget about how handy tcpwrappers can be for limiting access.  If your firewall is down in error, host.allow and hosts.deny could be an extra layer of protection.  It's important to ensure that the daemons you are attempting to control are build with tcpwrappers support.  Daemons like sshd support it, but apache and MySQL do not.</p>
<p><strong>Encrypt all traffic on the private network</strong><br />
Just because it's called a "private" network doesn't mean that your traffic can traverse the network privately.  You should always err on the side of caution and encrypt all traffic traversing the private network.  You can use ssh tunnels, stunnel, or the built-in SSL features found in most daemons.</p>
<p>This also brings up an important point: <strong>you should know how your provider's private network works</strong>.  Are there safeguards to prevent sniffing?  Could someone else possibly ARP spoof your instance's private IP addresses?  Is your private network's subnet shared among many customers?</p>
<p>With all of that said, it's also very important to have proper change control policies so that administrators working after you are fully aware of the security measures in place and why they are important.  This will ensure that all of the administrators on your instances will understand the security of the system and they should be able to make sensible adjustments later for future functionality.</p>
<p><a href="http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/">Private network interfaces: the forgotten security hole</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgraded to WordPress 2.9</title>
		<link>http://rackerhacker.com/2009/12/21/upgraded-to-wordpress-2-9/</link>
		<comments>http://rackerhacker.com/2009/12/21/upgraded-to-wordpress-2-9/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:47:04 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1074</guid>
		<description><![CDATA[If you haven't upgraded your WordPress installation to version 2.9 yet, you might want to consider doing that soon. There are quite a few improvements, bug fixes and security features available in the new version. The automatic upgrade via the admin interface actually worked just fine for me. Of course, I backed up my database [...]<p><a href="http://rackerhacker.com/2009/12/21/upgraded-to-wordpress-2-9/">Upgraded to WordPress 2.9</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you haven't <a href="http://codex.wordpress.org/Upgrading_WordPress">upgraded</a> your <a href="http://wordpress.org/">WordPress</a> installation to version 2.9 yet, you might want to consider doing that soon.  There are quite a few <a href="http://core.trac.wordpress.org/query?status=closed&#038;milestone=2.9">improvements, bug fixes and security features</a> available in the new version.</p>
<p>The automatic upgrade via the admin interface actually worked just fine for me.  Of course, I backed up my database and files first, just to be sure.</p>
<p><a href="http://rackerhacker.com/2009/12/21/upgraded-to-wordpress-2-9/">Upgraded to WordPress 2.9</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/12/21/upgraded-to-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatically loading iptables rules on Debian/Ubuntu</title>
		<link>http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/</link>
		<comments>http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:39:52 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1039</guid>
		<description><![CDATA[If you want your iptables rules automatically loaded every time your networking comes up on your Debian or Ubuntu server, you can follow these easy steps. First, get your iptables rules set up the way you like them. Once you've verified that everything works, save the rules: iptables-save &#62; /etc/firewall.conf Next, open up /etc/network/if-up.d/iptables in [...]<p><a href="http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/">Automatically loading iptables rules on Debian/Ubuntu</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you want your iptables rules automatically loaded every time your networking comes up on your Debian or Ubuntu server, you can follow these easy steps.</p>
<p>First, get your iptables rules set up the way you like them.  Once you've verified that everything works, save the rules:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables-save &gt; /etc/firewall.conf</pre></div></div>

<p>Next, open up <code>/etc/network/if-up.d/iptables</code> in your favorite text editor and add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
iptables-restore <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>firewall.conf</pre></div></div>

</pre>
<p>Once you save it, make it executable:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">chmod +x /etc/network/if-up.d/iptables</pre></div></div>

<p>Now, the rules will be restored each time your networking scripts start (or restart).  If you need to save changes to your rules in the future, you can manually edit <code>/etc/firewall.conf</code> or you can adjust your rules live and run:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables-save &gt; /etc/firewall.conf</pre></div></div>

<p><em>Thanks to <a href="http://twitter.com/ajmesserli">Ant</a> for this handy tip.</em></p>
<p><a href="http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/">Automatically loading iptables rules on Debian/Ubuntu</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Upgraded to WordPress 2.8.6 with some theme changes</title>
		<link>http://rackerhacker.com/2009/11/16/upgraded-to-wordpress-2-8-6-with-some-theme-changes/</link>
		<comments>http://rackerhacker.com/2009/11/16/upgraded-to-wordpress-2-8-6-with-some-theme-changes/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:32:22 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1035</guid>
		<description><![CDATA[I've upgraded the blog to WordPress 2.8.6 after I read about the registered user exploits. Also, I've dropped the Adsimple theme I was using, and I'm now using a slightly modified Dojo theme. It's a little easier on the eyes, but it's still lightweight enough to be fast on mobile broadband connections. Let me know [...]<p><a href="http://rackerhacker.com/2009/11/16/upgraded-to-wordpress-2-8-6-with-some-theme-changes/">Upgraded to WordPress 2.8.6 with some theme changes</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I've upgraded the blog to WordPress 2.8.6 after I read about the <a href="http://wordpress.org/development/2009/11/wordpress-2-8-6-security-release/">registered user exploits</a>.</p>
<p>Also, I've dropped the <a href="http://wordpress.org/extend/themes/adsimple">Adsimple</a> theme I was using, and I'm now using a slightly modified <a href="http://spaceninja.com/dojo/">Dojo</a> theme.  It's a little easier on the eyes, but it's still lightweight enough to be fast on mobile broadband connections.</p>
<p>Let me know what you think!</p>
<p><a href="http://rackerhacker.com/2009/11/16/upgraded-to-wordpress-2-8-6-with-some-theme-changes/">Upgraded to WordPress 2.8.6 with some theme changes</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/11/16/upgraded-to-wordpress-2-8-6-with-some-theme-changes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Requiring SSL encryption for WordPress administration</title>
		<link>http://rackerhacker.com/2009/07/31/requiring-ssl-encryption-for-wordpress-administration/</link>
		<comments>http://rackerhacker.com/2009/07/31/requiring-ssl-encryption-for-wordpress-administration/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 13:13:26 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=955</guid>
		<description><![CDATA[I was digging around for WordPress plugins last night that would allow me to secure the administrative login page for my WordPress installations. Most of the plugins are only compatible with WordPress 2.7.x or earlier, so I was a little concerned about them working with WordPress 2.8.2. Then I stumbled upon the WordPress documentation that [...]<p><a href="http://rackerhacker.com/2009/07/31/requiring-ssl-encryption-for-wordpress-administration/">Requiring SSL encryption for WordPress administration</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I was digging around for <a href="http://wordpress.org/">WordPress</a> plugins last night that would allow me to secure the administrative login page for my WordPress installations.  Most of the plugins are only compatible with WordPress 2.7.x or earlier, so I was a little concerned about them working with WordPress 2.8.2.</p>
<p>Then I stumbled upon the <a href="http://codex.wordpress.org/Administration_Over_SSL">WordPress documentation</a> that shows you how to require SSL with no plugins at all.  If you're using WordPress 2.6+, you can use these super-simple instructions:</p>
<p>Require encryption just for the /wp-admin/ login, but leave the rest of the administrative area on HTTP:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Add this line to wp-config.php
</span><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FORCE_SSL_LOGIN'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To encrypt the login and the entire administrative area:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Add this line to wp-config.php
</span><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FORCE_SSL_ADMIN'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Of course, for this to work, you'll need virtual hosts on ports 80 and 443 for your blog.  Also, you'll need an SSL certificate for your blog.  You can snag one from a <a href="https://ssl.trustwave.com/solutions-overview.php">reputable provider</a> or <a href="http://rackerhacker.com/2007/08/02/generate-self-signed-certificate-and-key-in-one-line/">make your own</a>.</p>
<p><a href="http://rackerhacker.com/2009/07/31/requiring-ssl-encryption-for-wordpress-administration/">Requiring SSL encryption for WordPress administration</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/07/31/requiring-ssl-encryption-for-wordpress-administration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgraded WordPress to 2.8.2</title>
		<link>http://rackerhacker.com/2009/07/29/upgraded-wordpress-to-2-8-2/</link>
		<comments>http://rackerhacker.com/2009/07/29/upgraded-wordpress-to-2-8-2/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 22:22:13 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=951</guid>
		<description><![CDATA[I finally made it around to upgrading WordPress to 2.8.2 and it seems to be working like a charm. It looks like there were some bug fixes and a XSS vulnerability was patched. Upgraded WordPress to 2.8.2 is a post from: Major Hayden's Racker Hacker blog. Thanks for following the blog via the RSS feed. [...]<p><a href="http://rackerhacker.com/2009/07/29/upgraded-wordpress-to-2-8-2/">Upgraded WordPress to 2.8.2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I finally made it around to upgrading WordPress to 2.8.2 and it seems to be working like a charm.  It looks like there were some bug fixes and a <a href="http://wordpress.org/development/2009/07/wordpress-2-8-2/">XSS vulnerability was patched</a>.</p>
<p><a href="http://rackerhacker.com/2009/07/29/upgraded-wordpress-to-2-8-2/">Upgraded WordPress to 2.8.2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/07/29/upgraded-wordpress-to-2-8-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple SOCKS proxy using SSH</title>
		<link>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/</link>
		<comments>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/#comments</comments>
		<pubDate>Tue, 26 May 2009 19:29:55 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=880</guid>
		<description><![CDATA[Sometimes we find ourselves in places where we don't trust the network that we're using. I've found myself in quite a few situations where I know my data is being encrypted, but I want an additional layer of protection. Luckily, that protection is built into SSH if you'd like to use it. Create a simple [...]<p><a href="http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/">Simple SOCKS proxy using SSH</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Sometimes we find ourselves in places where we don't trust the network that we're using.  I've found myself in quite a few situations where I know my data is being encrypted, but I want an additional layer of protection.  Luckily, that protection is built into SSH if you'd like to use it.</p>
<p>Create a simple SOCKS proxy with SSH by using the <code>-D</code> flag:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ssh -D 2400 username@some.host.com</pre></div></div>

<p>That command will open up a SOCKS proxy on your workstation on port 2400.  If you configure your application to use the local SOCKS proxy, any traffic using the proxy will be sent through an encrypted SSH connection to your remote server and out to the internet. Inbound traffic through the proxy is encrypted through the same connection.</p>
<p>You can pair that with autossh to keep your proxy connected at all times:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">autossh -f -M 20000 -D 2400 username@some.host.com -N</pre></div></div>

<p><a href="http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/">Simple SOCKS proxy using SSH</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Linux security advisory Twitter bots</title>
		<link>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/</link>
		<comments>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:00:03 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=762</guid>
		<description><![CDATA[Thanks to the simplicity of ruby as well as the twitter and httparty gems, I've whipped up some Twitter bots today. The three bots will alert you when there are Red Hat, Ubuntu, or Debian security advisories. I'd set one up for Fedora, but their feed is broken today. @redhaterrata - Red Hat Errata Updates [...]<p><a href="http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/">New Linux security advisory Twitter bots</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Thanks to the simplicity of <a href="http://ruby-lang.org/">ruby</a> as well as the <a href="http://twitter.rubyforge.org/">twitter</a> and <a href="http://github.com/jnunemaker/httparty/tree/master">httparty</a> gems, I've whipped up some Twitter bots today.  The three bots will alert you when there are Red Hat, Ubuntu, or Debian security advisories.  I'd set one up for Fedora, but their feed is broken today.</p>
<p><strong><a href="http://twitter.com/redhaterrata/">@redhaterrata</a></strong> - Red Hat Errata Updates<br />
<strong><a href="http://twitter.com/ubuntusecurity/">@ubuntusecurity</a></strong> - Ubuntu Security Notifications<br />
<strong><a href="http://twitter.com/debiansecurity/">@debiansecurity</a></strong> - Debian Security Advisories</p>
<p>As always, you can <a href="http://twitter.com/rackerhacker/">let me know</a> if you have any suggestions for improvements, or other bots you'd like to see.</p>
<p><a href="http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/">New Linux security advisory Twitter bots</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/02/05/new-linux-security-advisory-twitter-bots/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgraded to WordPress 2.6.2</title>
		<link>http://rackerhacker.com/2008/09/09/upgraded-to-wordpres-262/</link>
		<comments>http://rackerhacker.com/2008/09/09/upgraded-to-wordpres-262/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 03:16:53 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=460</guid>
		<description><![CDATA[I've updated the blog to WordPress 2.6.2 tonight. There are some relatively serious security concerns with some of the code in WordPress 2.6.1, so I'd recommend upgrading at your earliest convenience. Slide on over to the WordPress site and download it now. Upgraded to WordPress 2.6.2 is a post from: Major Hayden's Racker Hacker blog. [...]<p><a href="http://rackerhacker.com/2008/09/09/upgraded-to-wordpres-262/">Upgraded to WordPress 2.6.2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I've updated the blog to WordPress 2.6.2 tonight.  There are some <a href="http://codex.wordpress.org/Changelog/2.6.2">relatively serious security concerns</a> with some of the code in WordPress 2.6.1, so I'd recommend upgrading at your earliest convenience.</p>
<p>Slide on over to the <a href="http://wordpress.org/">WordPress</a> site and <a href="http://wordpress.org/download/">download it now</a>.</p>
<p><a href="http://rackerhacker.com/2008/09/09/upgraded-to-wordpres-262/">Upgraded to WordPress 2.6.2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/09/09/upgraded-to-wordpres-262/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypted filesystems and partitions on RHEL 5</title>
		<link>http://rackerhacker.com/2008/09/01/encrypted-filesystems-and-partitions-on-rhel-5/</link>
		<comments>http://rackerhacker.com/2008/09/01/encrypted-filesystems-and-partitions-on-rhel-5/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 01:55:36 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=395</guid>
		<description><![CDATA[I spoke with a customer last week who was curious about enabling encrypted partitions on a DAS connected to their server.  I wasn't entirely sure if it was possible in RHEL 5 since I couldn't remember if it was available in Fedora 6.  According to Red Hat's release notes, it is possible.  Here's an excerpt [...]<p><a href="http://rackerhacker.com/2008/09/01/encrypted-filesystems-and-partitions-on-rhel-5/">Encrypted filesystems and partitions on RHEL 5</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I spoke with a customer last week who was curious about enabling encrypted partitions on a DAS connected to their server.  I wasn't entirely sure if it was possible in RHEL 5 since I couldn't remember if it was available in Fedora 6.  According to <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/release-notes/RELEASE-NOTES-x86-en.html">Red Hat's release notes</a>, it is possible.  Here's an excerpt from their release notes: </p>
<blockquote><p>Encrypted Swap Partitions and Non-root File Systems<br />
Red Hat Enterprise Linux 5 now provides basic support for encrypted swap partitions and non-root file systems. To use these features, add the appropriate entries to /etc/crypttab and reference the created devices in /etc/fstab.</p>
<p>Below is a sample /etc/crypttab entry:</p>
<p>my_swap /dev/hdb1 /dev/urandom swap,cipher=aes-cbc-essiv:sha256<br />
This creates the encrypted block device /dev/mapper/my_swap, which can be referenced in /etc/fstab.</p>
<p>Below is a sample /etc/crypttab entry for a file system volume:</p>
<p>my_volume /dev/hda5 /etc/volume_key cipher=aes-cbc-essiv:sha256<br />
The /etc/volume_key file contains a plaintext encryption key. You can also specify none as the key file name; this configures the system to ask for the encryption key during boot instead.</p>
<p>It is recommended to use LUKS (Linux Unified Key Setup) for setting up file system volumes. To do this, follow these steps:</p>
<p>Create the encrypted volume using cryptsetup luksFormat.</p>
<p>Add the necessary entry to /etc/crypttab.</p>
<p>Set up the volume manually using cryptsetup luksOpen (or reboot).</p>
<p>Create a file system on the encrypted volume.</p>
<p>Add the necessary entry to /etc/fstab.</p></blockquote>
<p>After scouring the Red Hat Enterprise Linux manuals and knowledge base, I couldn't find specific instructions to set it up.  However, there was an <a href="http://www.redhatmagazine.com/2007/01/18/disk-encryption-in-fedora-past-present-and-future/">article in the Red Hat Magazine</a> that may help.</p>
<p><a href="http://rackerhacker.com/2008/09/01/encrypted-filesystems-and-partitions-on-rhel-5/">Encrypted filesystems and partitions on RHEL 5</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/09/01/encrypted-filesystems-and-partitions-on-rhel-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

