<?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>AdmiNirvana &#187; Tlf</title>
	<atom:link href="http://www.briandowney.net/blog/category/tlf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.briandowney.net/blog</link>
	<description>Technical musings of an entrepreneur.</description>
	<lastBuildDate>Thu, 20 Aug 2009 17:53:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Firewalling brute force attempts with IPTables</title>
		<link>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/</link>
		<comments>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:53:14 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[brute]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[force]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=124</guid>
		<description><![CDATA[Almost 24 hours per day, The Linux Fix is inundated with FTP and SSH brute force attempts to our server farm.   This has compromised a few our our customer&#8217;s accounts from time to time, and I decided it was time to come up with a solution.
The problem is tricky&#8211;we must leave FTP and SSH open [...]]]></description>
			<content:encoded><![CDATA[<p>Almost 24 hours per day, The Linux Fix is inundated with FTP and SSH brute force attempts to our server farm.   This has compromised a few our our customer&#8217;s accounts from time to time, and I decided it was time to come up with a solution.</p>
<p>The problem is tricky&#8211;we must leave FTP and SSH open to the entire world, but at the same time be selective on what we black list.   How do you make that determination?  Strictly on bad login credentials?</p>
<p>We could, but that would mean that we&#8217;d inadvertently lock out real users.  A better solution we found has to do with timing connection attempts.   With IPTables, we can keep a counter based upon source IP&#8211;and track how many new socket attempts are made within a certain span of time.     For instance, if we detect the IP address 1.2.3.4 making 5 connection attempts within 60 seconds, there is a darn good chance it isn&#8217;t someone mistyping a password.</p>
<p>Here is how we did it, based upon another script we found out in the Internets:</p>
<pre>#!/bin/bash
/sbin/iptables -N SSH
/sbin/iptables -N SSH_BLACKLIST
/sbin/iptables -A SSH_BLACKLIST -m recent --name SSH_COUNTER --set -j LOG --log-level warn --log-prefix "Blocked: "
/sbin/iptables -A SSH_BLACKLIST -j REJECT
/sbin/iptables -A SSH -m recent --name SSH_COUNTER --update --seconds 300 -j REJECT
/sbin/iptables -A SSH -m recent --name SSH --rcheck --seconds 60 --hitcount 5 -j SSH_BLACKLIST
/sbin/iptables -A SSH -m recent --name SSH --rcheck --seconds 2 -j LOG --log-level warn --log-prefix "Added: "
/sbin/iptables -A SSH -m recent --name SSH --update --seconds 2 -j REJECT
/sbin/iptables -A SSH -m recent --name SSH_COUNTER --remove -j LOG --log-level warn --log-prefix "Removed: "
/sbin/iptables -A SSH -m recent --name SSH --set -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -p tcp -m tcp --dport 22 -j SSH</pre>
<p>This creates two new tables, SSH and SSH_BLACKLIST.   Upon the intial connection attempt, the IP is added to the SSH_COUNTER counter.   If the same IP address is seen again within 60 seconds, it is duly noted&#8211;however no action is taken until the hitcount reaches 5.   In that case, the rules jump to the SSH_BLACKLIST table, it is logged, and subsequent connections from that IP are dropped for 5 minutes until things calm down.   In order to do this for FTP, just rename the targets as appropriate and change the target port to 21 on the last line.</p>
<p>The nice thing about this set up is that it is auto-cleaning.  After 5 minutes of no activity, the counter forgets about the IP address and things return to normal.   We&#8217;ve found that this is just enough protection to drastically reduce bruteforce attempts, yet not get in the way of normal usage by our customers.  Over time, this has become our favorite technique and we&#8217;ve begun to implement it on any Internet-facing machine with open SSH ports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2009/08/20/firewalling-brute-force-attempts-with-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trixbox, VPNs, NAT, and the 20 second dropping issue</title>
		<link>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/</link>
		<comments>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 16:30:14 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[Trixbox]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=116</guid>
		<description><![CDATA[I usually don&#8217;t like to cross-post between blogs, but this problem seems prevalent enough that it needs more exposure.   We&#8217;ve solved it at TLF, and here&#8217;s how:
http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/
]]></description>
			<content:encoded><![CDATA[<p>I usually don&#8217;t like to cross-post between blogs, but this problem seems prevalent enough that it needs more exposure.   We&#8217;ve solved it at TLF, and here&#8217;s how:</p>
<p><a href="http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/">http://www.thelinuxfix.com/blog/2008/10/24/trixbox-vpns-and-the-20-second-issue/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/10/24/trixbox-vpns-nat-and-the-20-second-dropping-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back from Detroit</title>
		<link>http://www.briandowney.net/blog/2008/02/27/back-from-detroit/</link>
		<comments>http://www.briandowney.net/blog/2008/02/27/back-from-detroit/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 00:21:10 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Tlf]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2008/02/27/back-from-detroit/</guid>
		<description><![CDATA[Just got back on Sunday night from Detroit for the TLF rack upgrade.
Unfortunately  our new rack didn&#8217;t make it there as fast as I did, so I ended up staging the equipment for deployment by the collocation facility.
While I was there however, I ended up racking equipment for three new customers&#8211;and now the existing [...]]]></description>
			<content:encoded><![CDATA[<p>Just got back on Sunday night from Detroit for the TLF rack upgrade.</p>
<p>Unfortunately  our new rack <em>didn&#8217;t</em> make it there as fast as I did, so I ended up staging the equipment for deployment by the collocation facility.</p>
<p>While I was there however, I ended up racking equipment for three new customers&#8211;and now the existing TLF rack is completely full.  We still have about 4U left, but are using 79% of both 30 amp circuits&#8211;which is too close for comfort (nominal states 80% maxiumum).</p>
<p>Bottom line though is that the time was right for a new rack purchase&#8230; now the goal is to fill that one up!</p>
<p><a href="http://www.briandowney.net/blog/wp-content/uploads/2008/02/img_0132.JPG" title="tlf rack">Here&#8217;s the picture</a> I took right before I left on Saturday night.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/02/27/back-from-detroit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More VMware Server in Production</title>
		<link>http://www.briandowney.net/blog/2008/01/31/more-vmware-server-in-production/</link>
		<comments>http://www.briandowney.net/blog/2008/01/31/more-vmware-server-in-production/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 00:08:15 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Clustering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2008/01/31/more-vmware-server-in-production/</guid>
		<description><![CDATA[I happened to run across this fella today, who also runs a very large VMware Server farm in a production environment.   He makes a few mentions of his architecture which is slightly different than our approach, however it could prove handy to someone else building out such a thing.
]]></description>
			<content:encoded><![CDATA[<p>I happened to run across <a href="http://blog.benruset.com/2008/01/16/my-large-vmware-server-farm/">this fella</a> today, who also runs a very large VMware Server farm in a production environment.   He makes a few mentions of his architecture which is slightly different than our approach, however it could prove handy to someone else building out such a thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/01/31/more-vmware-server-in-production/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New hosting stuff</title>
		<link>http://www.briandowney.net/blog/2007/10/16/new-hosting-stuff/</link>
		<comments>http://www.briandowney.net/blog/2007/10/16/new-hosting-stuff/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 18:59:08 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[The Interweb]]></category>
		<category><![CDATA[Tlf]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2007/10/16/new-hosting-stuff/</guid>
		<description><![CDATA[Whew&#8230; after a few months of solid work on TLF stuff, we finally hit a big milestone&#8211;the opening of www.tlfhosting.com, which will eventually become the main jump for all things hosting related at the &#8216;Fix.Right now it&#8217;s pretty skeletal, but it&#8217;s a start.
A big component of this is the shared server hosting stuff which is [...]]]></description>
			<content:encoded><![CDATA[<p><em>Whew</em>&#8230; after a few months of solid work on TLF stuff, we finally hit a big milestone&#8211;the opening of <a href="http://www.tlfhosting.com" title="TLFHosting.com">www.tlfhosting.com</a>, which will eventually become the main jump for all things hosting related at the &#8216;Fix.Right now it&#8217;s pretty skeletal, but it&#8217;s a start.</p>
<p>A big component of this is the shared server hosting stuff which is now all handled under <a href="http://www.psoft.net" title="Positive Software">H-Sphere&#8211;</a>an all encompassing control panel, distribution, and load-management system.  The super cool thing is that it reduces management in a huge way allowing TLF to sell really nice shared sever hosting for super-cheap, like <a href="https://cp.linuxfix.com:8443/psoft/servlet/psoft.hsphere.CP?action=plan_compare&amp;compare_way=group&amp;template_name=submit/misc/compare_plans.sbm&amp;gr_id=0" title="TLF Hosting Plans">$4.50/mo.</a>  Go sign up!</p>
<p>TLF also been enlisted as an official domain registrar, as well as a reseller for Comodo&#8211;meaning TLF is now a one-stop shop.  You just visit that control panel and you&#8217;re off and running.</p>
<p>The next phase is to get our VPS stuff finished up and migrate the rest of the internal TLF stuff to the new VMware server, freeing up the old one for customer VM&#8217;s.I can almost see the light at the end of the tunnel!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2007/10/16/new-hosting-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Server on NFS &amp; RedHat Cluster Suite</title>
		<link>http://www.briandowney.net/blog/2007/08/08/vmware-server-on-nfs-redhat-cluster-suite/</link>
		<comments>http://www.briandowney.net/blog/2007/08/08/vmware-server-on-nfs-redhat-cluster-suite/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 18:31:18 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tlf]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2007/08/08/vmware-server-on-nfs-redhat-cluster-suite/</guid>
		<description><![CDATA[Over the past few weeks I&#8217;ve managed to get a pretty darn stable NFS / VMWare Server setup running.
The basic specs are as follows:

VMWare Host: Dell PowerEdge 1950 (dual quad core, 8 gigs RAM)
NFS Cluster: Two Dell PowerEdge 860s (single quad core, 4 gigs RAM each)
Networking:  Dell PowerConnect 5324
Centralized storage:  EonStor A24F-R2224
Internal DRAC [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks I&#8217;ve managed to get a pretty darn stable NFS / VMWare Server setup running.</p>
<p>The basic specs are as follows:</p>
<ul>
<li>VMWare Host: Dell PowerEdge 1950 (dual quad core, 8 gigs RAM)</li>
<li>NFS Cluster: Two Dell PowerEdge 860s (single quad core, 4 gigs RAM each)</li>
<li>Networking:  Dell PowerConnect 5324</li>
<li>Centralized storage:  <a href="http://briandowney.net/blog/2007/07/16/disks-lots-of-disks/">EonStor A24F-R2224</a></li>
<li>Internal DRAC on each node for cluster fencing (not ideal, read below).</li>
<li>All the VMDKs are stored on an NFS mount from the cluster.</li>
</ul>
<p>Through quite a bit of experimentation and trial and error, I have it running pretty solid.   Some of the key points:</p>
<ol>
<li>Used RedHat EL 5 all the way around, with the related GFS/RHCS packages</li>
<li>Mounted GFS on the NFS nodes with noatime,noquota for some minor speed improvements.</li>
<li>NFS4 and TCP for everything.  Makes failover to the other node more reliable.</li>
<li> Use &#8216;hard&#8217; mounts on the VMWare server, use timeo=600,retrans=2 in your options.  This allows TCP to handle transmission delays during a failover versus NFS.</li>
<li>On the export side, craft your /etc/exports so that each has a matching &#8216;fsid=&#8217; for every export.  This gets around stale handles.</li>
<li>Use the GFS/shared storage/floating IP technique as documented in the <a href="http://sources.redhat.com/cluster/doc/nfscookbook.pdf">Cluster NFS Cookbook</a> versus managed NFS (read why below).</li>
<li>Bonded the  NICs on the  NFS nodes for  higher throughput (in our case they will be exporting to more than one server when in production, so this was necessary).</li>
<li>Spanning tree algorithm delays on the PowerConnect can get you in trouble with a <a href="http://sources.redhat.com/cluster/faq.html#two_node_correct">fencing loop</a> in a two-node setup.  During a reboot situation one of the nodes, the NICs come up quicker during Linux sysinit than they do on the switch.  Thus, Linux thinks the interface should be reachable (when it&#8217;s not) and when fenced attempts to initalize, it cannot reach the other node and consequently fences that one.  Solution is to either add &#8220;LINKDELAY&#8221; to /etc/sysconfig/network or just disable spanning tree on the switch.</li>
</ol>
<p>I intially tried the managed NFS setup in Cluster Suite (check the cookbook), however there are two major problems.   At this time, managed NFS appears to be set up to use NFSv2 and v3 only, as there is no opportunity to modify the export options via Cluster Suite.   Also, there are timing delays with how Cluster Suite manages the NFS daemons&#8230;</p>
<p>Of course, during a failover speed is of the essence.  So, when I had this rig configured for managed NFS failover, I was experiencing 12+ second delays in failover.   Why?</p>
<p>Well, it turns out RedHat has a sleep command in /usr/share/cluster/ip.sh (the virtual IP management script) that adds 10 seconds to the failver so NFSD can  clear its cache (!?).   Pretty hackish, and results in an unacceptable delay during a failovers.   Unfortunately if you&#8217;re running managed NFS, there&#8217;s no real way around this unless you want to risk corruption of NFSD going down without flushing its cache to disk.</p>
<p>I found this in the <a href="http://sources.redhat.com/cluster/faq.html#rgm_failovertime">Cluster Project FAQ</a>.  With the &#8217;sleep 10&#8242; command gone, failover is much, much quicker.  As long as you&#8217;re doing the GFS thing versus the managed NFS setup this works quite nicely and fast enough that VMWare doesn&#8217;t seem to know the better of what is going on.</p>
<p>Performance-wise, it&#8217;s pretty darn good.   I have a dedicated PowerConnect 5324 for use as an &#8220;ethernet SAN&#8221; to interconnect the NFS nodes, and VMWare Server.   That being said, 20 concurrent lightly loaded VMs results in nothing abnormal in terms of performance or reliability.   In fact, it&#8217;s hard to tell the difference from local disk&#8211;even during a failover.  The NIC being used for &#8220;front-end&#8221; access to the VMWare Server Console even seems to experience more traffic than the NFS one according to the PowerConnect&#8217;s interface reports,  though that leaves me a bit skeptical.</p>
<p>I would have been  interesting to see if the TOE (TCP Offload Engine) equipped on the 1950&#8217;s NetExtremeII NICs would have made a performance improvment, but it works in Windows 2003 only.  Bummer.</p>
<p>Another &#8220;gotcha&#8221; to watch for is using RAC cards on the servers for fencing purposes.  In most cases it works fine however when power is lost to the entire server, the DRAC goes down with it and becomes unreachable.   This leaves the surviving node stuck trying to fence the dead one, and failover never occurs.   A better option would be to use a managable PDU (which we&#8217;ll do ultimately).</p>
<p>Bottom line it seems to work very well in almost all failure situations I&#8217;ve tested it in.   The only time I was able to make it fail (badly) was to yank the power cord out of one of the cluster nodes, and have the entire cluster crunch to a halt, due to the problem I mentioned above.    I did this while installing X Windows on 50% of the VMs to simulate a lot of NFS write activity.</p>
<p>After bringing the entire cluster back up manually, the only damage was a corrupt RPM DB on one of the VMs.  The others came back up fine after a fsck on boot.  Not bad!</p>
<p>After my testing,  I&#8217;m confident this set up will work in a production environment.  If you wish to do try the same, ensure your testing plan includes every possible outage situation you can fathom.  Weird/odd stuff can come up (for example the spanning tree thing) and of course it is far better to nail those down in R&amp;D than in production!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2007/08/08/vmware-server-on-nfs-redhat-cluster-suite/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dell OMSA 5.2 and /opt</title>
		<link>http://www.briandowney.net/blog/2007/07/18/dell-omsa-52-and-opt/</link>
		<comments>http://www.briandowney.net/blog/2007/07/18/dell-omsa-52-and-opt/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 21:45:30 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tlf]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/2007/07/18/dell-omsa-52-and-opt/</guid>
		<description><![CDATA[Ran into somewhat of a bug, more of an oversight on Dell&#8217;s part today.
I&#8217;m loading up a PowerEdge 860 running CentOS5 with Dell&#8217;s OpenManage Server Agents (OMSA).  On reboot, I receive a udev error about &#8216;dataeng.hotplug&#8217; not being able to exec early in the system init.
After scratching my head for a few&#8211;it hit me: [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into somewhat of a bug, more of an oversight on Dell&#8217;s part today.</p>
<p>I&#8217;m loading up a PowerEdge 860 running CentOS5 with Dell&#8217;s OpenManage Server Agents (OMSA).  On reboot, I receive a udev error about &#8216;dataeng.hotplug&#8217; not being able to exec early in the system init.</p>
<p>After scratching my head for a few&#8211;it hit me:  it&#8217;s because  I have /opt on a separate filesystem as root (/), which isn&#8217;t available while udev is initializing.  Sure enough, in /etc/udev/rules.d, there&#8217;s an entry for Dell&#8217;s openmange stuff pointing to a shell script in /opt/dell.</p>
<p>Anyway, if you run into that just place the OMSA install on the root filesystem versus a submounted one and your problem wil disappear.  You could also just copy that script out and place it somewhere more appropriate&#8211;like /sbin&#8211;and modify that udev rules entry.</p>
<p>With great flexibility comes weirdness at times!  Dell probably shouldn&#8217;t have a sysinit level script running from a filesystem that is probably submounted by sysadmins 50% of the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2007/07/18/dell-omsa-52-and-opt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
