<?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>Evan Hoffman&#039;s silly writings. &#187; firewall</title>
	<atom:link href="http://www.evanhoffman.com/evan/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evanhoffman.com/evan</link>
	<description>When 3-nines uptime is just way too much.</description>
	<lastBuildDate>Mon, 06 Sep 2010 00:36:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iptables rules for rate-limiting SSH connections</title>
		<link>http://www.evanhoffman.com/evan/2009/05/11/iptables-rules-for-rate-limiting-ssh-connections/</link>
		<comments>http://www.evanhoffman.com/evan/2009/05/11/iptables-rules-for-rate-limiting-ssh-connections/#comments</comments>
		<pubDate>Mon, 11 May 2009 20:39:22 +0000</pubDate>
		<dc:creator>evan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=101</guid>
		<description><![CDATA[This is what I use on my CentOS boxes/VMs, it rate-limits the connections and also rate-limits the log messages (to prevent attacks that attempt to fill up the server&#8217;s disk). iptables -F iptables -X iptables -N LOGDROP #Create the LOGDROP chain iptables -A LOGDROP -m limit --limit 1/s -j LOG --log-prefix "LOGDROP: " # Rate-limit [...]]]></description>
			<content:encoded><![CDATA[<p>This is what I use on my CentOS boxes/VMs, it rate-limits the connections and also rate-limits the log messages (to prevent attacks that attempt to fill up the server&#8217;s disk).</p>
<p><code>iptables -F<br />
iptables -X<br />
iptables -N LOGDROP #Create the LOGDROP chain<br />
iptables -A LOGDROP -m limit --limit 1/s -j LOG --log-prefix "LOGDROP: " # Rate-limit the logging so the logs don't fill up the server<br />
iptables -A LOGDROP -j DROP<br />
iptables -I INPUT -p tcp --dport 22 -s 10.0.0.0/16 -j ACCEPT # Allow everything from the internal network<br />
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set # create the "bucket"<br />
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j LOGDROP  # if there are more than 4 connection attempts in 60 seconds from a given address, log-drop it.<br />
</code></p>
<p>After issuing these commands I run <code>/etc/init.d/iptables save</code>, that persists the rules to &#8230; somewhere.  Alternatively I sometimes put all the above commands in some bash script and just call it from /etc/rc.local.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2009/05/11/iptables-rules-for-rate-limiting-ssh-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
