<?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>Spind.net Blog &#187; ModSecurity</title>
	<atom:link href="http://blog.spind.net/tag/modsecurity/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.spind.net</link>
	<description>Stories from the trenches of System Administration</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:21:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The mysterious case of the 501 error</title>
		<link>http://blog.spind.net/2009/05/13/the-mysterious-case-of-the-501-error/</link>
		<comments>http://blog.spind.net/2009/05/13/the-mysterious-case-of-the-501-error/#comments</comments>
		<pubDate>Wed, 13 May 2009 09:10:30 +0000</pubDate>
		<dc:creator>hc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[Paranoia]]></category>

		<guid isPermaLink="false">http://blog.spind.net/?p=137</guid>
		<description><![CDATA[I recently installed mod_security on our Apache server, and everything seemed to be working fine. Suddenly, while working on the previous post, I was presented with this error: Method Not Implemented POST to /wp/wp-admin/post.php not supported. I checked the log files, and found these hits: [Wed May 13 10:52:48 2009] [error] [client xxx.xxx.xxx.xxx] ModSecurity: Access [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed <a href="http://www.modsecurity.org/">mod_security</a> on our Apache server, and everything seemed to be working fine. Suddenly, while working on the <a href="http://blog.spind.net/2009/05/13/prioritizing-linux-services/">previous post</a>, I was presented with this error:</p>
<div class="codebox">
Method Not Implemented<br />
POST to /wp/wp-admin/post.php not supported.
</div>
<p>I checked the log files, and found these hits:</p>
<div class="codebox">
[Wed May 13 10:52:48 2009] [error] [client xxx.xxx.xxx.xxx] ModSecurity: Access denied with code 501 (phase 2). Pattern match &#8220;(?:\\b(?:\\.(?:ht(?:access|passwd|group)|www_?acl)|global\\.asa|httpd\\.conf|boot\\.ini)\\b|\\/etc\\/)&#8221; at ARGS:content. [file "/etc/httpd/modsecurity.d/modsecurity_crs_40_generic_attacks.conf"] [line "114"] [id "950005"] [msg "Remote File Access Attempt"] [data "/etc/"] [severity "CRITICAL"] [tag "WEB_ATTACK/FILE_INJECTION"] [hostname "blog.spind.net"] [uri "/wp/wp-admin/post.php"] [unique_id "xxxxxxxxxxxxx"]
</div>
<p>In short, it&#8217;s <tt>mod_security</tt> telling me that the text <tt>/etc/</tt> triggered rule 950005, which should be protecting our server against malicious attempts to access local files &#8211; like the ones in the <tt>/etc</tt> directory. The access file only showed a POST to <tt>/wp/wp-admin/post.php</tt> so I had no idea where the <tt>/etc/</tt> string was coming from. Maybe some weird hidden Javascript? Maybe something else?</p>
<p><a href="http://techpulp.com/2009/02/how-to-resolve-post-to-wp-admin-post-php-not-supported-error-in-wordpress/">This post</a> narrowed acknowledged it to be related to <tt>mod_security</tt> and suggested to disable it permanently or just turn it temporarily off while posting. I aim to do better.</p>
<p>The <a href="http://blog.spind.net/2009/05/13/prioritizing-linux-services/">previous post</a> has a wonderful nugget of enlightenment about prioritizing services on Linux, and suggested a couple of changes to the Linux configuration files &#8211; most of which are located in.. the <tt>/etc/</tt> folder. In short, I triggered <tt>mod_security</tt> rule 950005 by posting data containing <tt>/etc/</tt>.</p>
<p>If you ever plan to cover issues related to deployment and administration of operating system in the Unix family, this rule absolutely has got to go. Obviously it&#8217;s written with the best of intentions, but as it is doesn&#8217;t work and should be disabled.</p>
<p>Avoid messing with <tt>/etc/httpd/modsecurity.d/modsecurity_crs_40_generic_attacks.conf</tt> and just disable the specific rules in <tt>/etc/httpd/conf.d/mod_security.conf</tt> by adding this:</p>
<div class="codebox">
# Disable a couple of rules in modsecurity.d/modsecurity_crs_40_generic_attacks.conf<br />
# that prevents submitting text containing filenames in the Unix family.<br />
SecRuleRemoveById 950005<br />
SecRuleRemoveById 950006
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.spind.net/2009/05/13/the-mysterious-case-of-the-501-error/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

