<?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>Chesty&#039;s Blog &#187; sysadmin</title>
	<atom:link href="http://chesterton.id.au/blog/tag/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://chesterton.id.au/blog</link>
	<description>Press Belly Button to Begin</description>
	<lastBuildDate>Sat, 02 Apr 2011 01:24:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>mod_security False Positives</title>
		<link>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/</link>
		<comments>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 22:53:50 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=159</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/">mod_security False Positives</a></p>
mod_security False Positives I&#8217;ll go through a false positive example I found on my blog. False positives are inevitable, so it&#8217;s not a bad idea to run mod_security for a few weeks on detect only. Here&#8217;s the url that was raising the alarm. The trigger was in the url. http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/ Here&#8217;s what modsec_audit.log looked like [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/">mod_security False Positives</a></p>
<p>I&#8217;ll go through a false positive example I found on my blog. False positives are inevitable, so it&#8217;s not a bad idea to run mod_security for a few weeks on detect only.</p>
<p>Here&#8217;s the url that was raising the alarm. The trigger was in the url.</p>
<p><a href="http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/">http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/</a></p>
<p>Here&#8217;s what modsec_audit.log looked like<br />
<code><br />
--f8a03521-A--<br />
[21/Mar/2011:07:54:47 +1100] TYZpl0LcAZkAAHCLBPIAAAAA ::ffff:124.169.31.22 34169 127.0.0.1 81<br />
--f8a03521-B--<br />
GET /blog/2007/11/20/blue-tongue-harmonica-talk-cd/ HTTP/1.0<br />
Host: chesterton.id.au<br />
X-Real-IP: ::ffff:124.169.31.22<br />
X-Forwarded-For: ::ffff:124.169.31.22<br />
Connection: close<br />
Cache-Control: no-cache<br />
Pragma: no-cache<br />
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.26 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.709.0 Chrome/12.0.709.0 Safari/534.26<br />
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br />
Accept-Encoding: gzip,deflate,sdch<br />
Accept-Language: en-US,en;q=0.8<br />
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3</p>
<p>--f8a03521-F--<br />
HTTP/1.1 403 Forbidden<br />
Content-Length: 370<br />
Connection: close<br />
Content-Type: text/html; charset=iso-8859-1</p>
<p>--f8a03521-H--<br />
Message: Access denied with code 403 (phase 2). Pattern match "\bcd\b\W*?[\/]" at REQUEST_FILENAME. [file "/etc/apache2/modsecurity_crs/base_rules/modsecurity_crs_40_generic_attacks.conf"] [line "396"] [id "958821"] [rev "2.1.2"] [msg "System Command Injection"] [data "cd/"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [tag "WASCTC/WASC-31"] [tag "OWASP_TOP_10/A1"] [tag "PCI/6.5.2"]<br />
Action: Intercepted (phase 2)<br />
Stopwatch: 1300654487217847 3874 (2435 3436 -)<br />
Producer: ModSecurity for Apache/2.5.13 (http://www.modsecurity.org/); core ruleset/2.1.2.<br />
Server: Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.7 with Suhosin-Patch</p>
<p>--f8a03521-Z--<br />
</code></p>
<p>Section B &#8211;f8a03521-B&#8211; contains the request headers, and you can see the GET is /blog/2007/11/20/blue-tongue-harmonica-talk-cd/.</p>
<p>Section H is the audit log, why it was blocked in this case.<br />
[msg "System Command Injection"] [data "cd/"] so it didn&#8217;t like cd/, I&#8217;m not sure that cd/ (without a space between the cd and the directory) would do much on a unix system, but perhaps it does on windows, where apache also runs. </p>
<p>It also tells you the pattern that matched, the file where the rule is located and the rule id.<br />
Pattern match &#8220;\bcd\b\W*?[\/]&#8221; at REQUEST_FILENAME. [file "/etc/apache2/modsecurity_crs/base_rules/modsecurity_crs_40_generic_attacks.conf"] [line "396"] [id "958821"]</p>
<p>What we can do, is when REQUEST_FILENAME = /blog/2007/11/20/blue-tongue-harmonica-talk-cd/ remove rule id 958821.<br />
<code><br />
SecRule REQUEST_FILENAME "^/blog/2007/11/20/blue-tongue-harmonica-talk-cd/(index.php)?$" "nolog,pass,ctl:RuleRemoveById=958821"<br />
</code></p>
<p>Add this rule to your local rules, the reason we don&#8217;t modify the base_rules is they get overwritten when there&#8217;s an update to the rules.</p>
<p>&#8220;pass&#8221; above means if the rule matches, keep processing other rules, so it will still catch xss for example:</p>
<p><a href="http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/?a=%3Cscript%3Ealert(1)%3C/script%3E" rel="nofollow">http://chesterton.id.au/blog/2007/11/20/blue-tongue-harmonica-talk-cd/?a=%3Cscript%3Ealert(1)%3C/script%3E</a></p>
<p>I&#8217;d like to come back to this later and lock it down a little.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/21/mod_security-false-positives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_security SecAuditLog</title>
		<link>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/</link>
		<comments>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 22:49:00 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=156</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/">mod_security SecAuditLog</a></p>
mod_security SecAuditLog In my previous post I didn&#8217;t mention how to turn on the audit log, so without explanation, you put the following in your config. SecAuditEngine RelevantOnly SecAuditLogType serial SecAuditLogParts ABCFHZ We already set SecAuditLog to /var/log/modsecurity/SecAuditLog/modsec_audit.log in the previous post, which has to be writable by the web server user, www-data for ubuntu/debian. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/">mod_security SecAuditLog</a></p>
<p>In my previous <a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">post</a> I didn&#8217;t mention how to turn on the audit log, so without explanation, you put the following in your config.</p>
<p><code><br />
SecAuditEngine RelevantOnly<br />
SecAuditLogType serial<br />
SecAuditLogParts ABCFHZ<br />
</code></p>
<p>We already set SecAuditLog to /var/log/modsecurity/SecAuditLog/modsec_audit.log in the previous post, which has to be writable by the web server user, www-data for ubuntu/debian. So after a reload, you should start seeing entries when mod_security denies a request.</p>
<p>I&#8217;m going to modify SecAuditLogType setting in a future post so we can enable the console.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/19/mod_security-secauditlog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_security</title>
		<link>http://chesterton.id.au/blog/2011/03/17/mod_security/</link>
		<comments>http://chesterton.id.au/blog/2011/03/17/mod_security/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 06:05:58 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=139</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">mod_security</a></p>
mod_security Some time ago, I changed my setup from nginx + spawn-fcgi to nginx + apache so I could play with mod_security. Well, one of my clients got pwned by some sql injection vulnerability, so I finally got to put it in practice. In a nut shell, mod_security is an apache module that scans http(s) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2011/03/17/mod_security/">mod_security</a></p>
<p>Some time ago, I changed my setup from nginx + spawn-fcgi to nginx + apache so I could play with mod_security. Well, one of my clients got pwned by some sql injection vulnerability, so I finally got to put it in practice. </p>
<p>In a nut shell, mod_security is an apache module that scans http(s) traffic for suspicious strings. It can catch suspicious strings entering apache or leaving apache. It&#8217;s a firewall for http(s), it blocks bad traffic, and lets good traffic pass through.</p>
<p>mod_security is one of those applications that doesn&#8217;t fit the package model well. I guess it comes in two parts, the apache module and the rules. Packages don&#8217;t seem to even attempt to manage the rules, you download them separately and they come with a util to update them. Then you have your local rules that add to, disable, or override the upstream rules to fit your environment.</p>
<p>In ubuntu, the mod_security package is a little outdated, it always will be, especially on LTS, and it&#8217;s one of those packages that needs constant updates. The clever and motivated security researchers eventually find weakness in mod_security which are addressed in updates. So you either use the packages, and hope fixes are backported in a timely manner, which hasn&#8217;t appeared to of happened in ubuntu, or you install by source.</p>
<p>Installing by source increases your workload and moves the burden of keeping it up to date to yourself. But it&#8217;s a pretty straightforward process, and if you have only one or two machines to admin, it&#8217;s no issue.</p>
<p>It&#8217;s basically a matter of downloading the source, checking the signature, running apt-get build-dep libapache-mod-security, untaring, ./configure; make;make test;make install, then enable the module in apache. It&#8217;s pretty well covered in the docs and blogs found in google.</p>
<p>That takes care of the module, but it does nothing without the rules. I downloaded the core rules from <a href="http://www.owasp.org/index.php/Main_Page">OWASP</a>. There some documentation in the package, but there&#8217;s a few gotchas, so I&#8217;ll try and document step by step the process I went through.</p>
<ol>
<li>unpack the rules in your home directory</li>
<li>sudo mkdir /etc/apache2/modsecurity_crs/</li>
<li>cd modsecurity-crs_2.1.2<br />
sudo cp -a *_rules *.example  /etc/apache2/modsecurity_crs/</li>
<li>cd /etc/apache2/modsecurity_crs/<br />
 sudo mv modsecurity_crs_10_config.conf{.example,}</li>
<li>You have to edit modesecurity_crs_10_config.conf and uncomment a few lines, I think the main one being SecRuleEngine.</li>
<li>I created two files in /etc/apache2/mods-available<br />
0modsecurity.conf<br />
<code>&lt;IfModule security2_module><br />
   Include modsecurity_crs/*.conf<br />
   Include modsecurity_crs/base_rules/*.conf<br />
&lt;/IfModule></code><br />
0modsecurity.load<br />
<code>LoadFile /usr/lib/libxml2.so<br />
LoadFile /usr/lib/liblua5.1.so<br />
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so</code></li>
<li>sudo a2enmod 0modsecurity</li>
<li>create a file called /etc/apache2/modsecurity_crs/modsecurity_localconfig.conf with the following<br />
<code>SecUploadDir /var/log/modsecurity/SecUploadDir<br />
SecAuditLog /var/log/modsecurity/SecAuditLog/modsec_audit.log<br />
SecAuditLogStorageDir /var/log/modsecurity/SecAuditLogStorageDir<br />
SecDebugLog /var/log/modsecurity/SecDebugLog/modsec_debug.log<br />
SecDataDir /var/log/modsecurity/SecDataDir<br />
SecTmpDir /var/log/modsecurity/SecTmpDir<br />
</code></li>
<li>Make all the directories in /var/log/modsecurity, which have to be owned by www-data<br />
<code>sudo mkdir -p /var/log/modsecurity/{SecUploadDir,SecAuditLog,SecAuditLogStorageDir,SecDebugLog,SecDataDir,SecTmpDir}<br />
sudo chown -R www-data: /var/log/modsecurity</code>
</li>
</ol>
<p>That will do for now, I think. To modify the rules I feel it&#8217;s best to slow down and buy a book for learning, I&#8217;m not sure docs and blogs are the best way to learn this, but it&#8217;s up to your learning style. I keep updated by following @ModSecurity on twitter.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2011/03/17/mod_security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back To Apache</title>
		<link>http://chesterton.id.au/blog/2010/10/14/back-to-apache/</link>
		<comments>http://chesterton.id.au/blog/2010/10/14/back-to-apache/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:13:14 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=123</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/14/back-to-apache/">Back To Apache</a></p>
Back To Apache I&#8217;ve reinstalled apache and I&#8217;m in the process of cutting over my sites. Not completely, just for non static files, mainly php. Nginx is infront of apache serving static content and is a reverse proxy to apache which runs on 127.0.0.1:81 The reason? I want to give mod_security a spin. It&#8217;s loaded [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/14/back-to-apache/">Back To Apache</a></p>
<p>I&#8217;ve reinstalled apache and I&#8217;m in the process of cutting over my sites. Not completely, just for non static files, mainly php. Nginx is infront of apache serving static content and is a reverse proxy to apache which runs on 127.0.0.1:81</p>
<p>The reason? I want to give mod_security a spin. It&#8217;s loaded now, but it doesn&#8217;t seem to do much atm. Will read up on it in due season ;)</p>
<p>Basically, you google for nginx apache proxy wordpress wp-super-cache and you hit the right sort of pages to set it up. It wasn&#8217;t smooth sailing though, I used <a href="http://tech.nocr.at/tech/how-to-speed-up-wordpress-with-nginx-and-wp-super-cache/">http://tech.nocr.at/tech/how-to-speed-up-wordpress-with-nginx-and-wp-super-cache/</a> which has a flaw.</p>
<p>It contains the lines at the end on the nginx config sample.<br />
<code>	# all other requests go to WordPress<br />
	if (!-e $request_filename) {<br />
	rewrite . /index.php last;<br />
	}</code><br />
and funnily enough, every url opened the front page of my blog. It took me a bit of head scratching before I commented the lines out, enabled mod_rewrite in apache, and toggled a wordpress permalink setting to get .htaccess written.</p>
<p>After I got it working, I read the comments and someone had already discovered the flaw. Plus another page I read is basically the same, except it&#8217;s missing those lines (it wasn&#8217;t as good looking, so I didn&#8217;t use it).</p>
<p>So I&#8217;m pretty happy that I understand the config now, and I&#8217;ll continue to cut over the remaining sites, then turn off php5-cgi. I&#8217;m also happy apache is back, I went a bit anti apache there for a while, but it has its uses, like mod_security for example.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/14/back-to-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Test Your Server For Vulnerabilities</title>
		<link>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/</link>
		<comments>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 02:45:57 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=120</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/">How To Test Your Server For Vulnerabilities</a></p>
How To Test Your Server For Vulnerabilities Sheesh, I write one post on security, mention a security expert in it, and he tries to exploit my server. It&#8217;s not an original idea, but if you want to test your server for vulnerabilities, come out and say you&#8217;re a security expert. Anyway, I finished Cyber War, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/">How To Test Your Server For Vulnerabilities</a></p>
<p>Sheesh, I write one post on security, mention a security expert in it, and he tries to exploit my server. It&#8217;s not an original idea, but if you want to test your server for vulnerabilities, come out and say you&#8217;re a security expert.</p>
<p>Anyway, I finished Cyber War, feeling very satisfied since it&#8217;s been a long time since I had the will to read a book. Twitter&#8217;s 140 character limit has taken a toll.</p>
<p>I think the conclusion the author made was regulation, which will erode privacy, and treaties. Also a new protocol where there are no anonymous users (except for the bad guys, i guess).</p>
<p>The author has no doubt that our critical systems already have backdoors and logic bombs installed, waiting for the day. One thing that struck me is no matter how secure my own network is (which it isn&#8217;t very, no need to test), if someone else is vulnerable, it could affect me and millions of others. </p>
<p>On to the next book. This one is lower level I think.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/04/how-to-test-your-server-for-vulnerabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cyber War</title>
		<link>http://chesterton.id.au/blog/2010/10/02/cyber-war/</link>
		<comments>http://chesterton.id.au/blog/2010/10/02/cyber-war/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 03:13:55 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[OSIA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=116</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/02/cyber-war/">Cyber War</a></p>
Cyber War I&#8217;ve recently become more interested in security. I always had an interest in it, locking down linux servers and firewalls, trying to avoid common sql injection and XSS bugs while coding. But I guess that&#8217;s more of a passive interest or approach, I&#8217;m now interested in a more active way, deep packet inspection, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/10/02/cyber-war/">Cyber War</a></p>
<p>I&#8217;ve recently become more interested in security. I always had an interest in it, locking down linux servers and firewalls, trying to avoid common sql injection and XSS bugs while coding. But I guess that&#8217;s more of a passive interest or approach, I&#8217;m now interested in a more active way, deep packet inspection, etc.</p>
<p>In the past, I locked down a server and assumed it would take care of itself, be crack proof, as crack proof as anything connected to the internet can be. I wasn&#8217;t fooling myself, I knew it could still be cracked. </p>
<p>Now I&#8217;m looking at it more from position where I believe the hosts are vulnerable, and I want to examine the traffic coming in and out. Trying to secure the network rather than (or as well as) the hosts. Because, well, some hosts can&#8217;t be secured, there&#8217;s always going to be 0day exploits, old unpatched exploits, and social hacking. Not just trying to stop attacks, but trying to detect owned boxes. Some attacks happen out of band, like from infected usb sticks. Want to sneak some worm onto a target? Do it in plain sight, stand outside their premises and give away usb sticks in a fake promotion, or do it in some conference.</p>
<p>I guess I&#8217;ve got to send props to David Bl (Security Expert) for sparking the interest.</p>
<p>I&#8217;m half way through <a href="http://www.amazon.com/Cyber-War-Threat-National-Security/dp/0061962236">Cyber War</a>, the first book I&#8217;ve read in a very long time. It&#8217;s not a technical manual on security, it&#8217;s more of a look at how vulnerable the USA and other countries are from attacks coming in through the internet.  It talks about political and military tactics and strategy. It&#8217;s more about securing a nation, rather than a network.</p>
<p>It seems the only reason we don&#8217;t see a lot of countries launching attacks on other countries through the internet is the countries who have the ability to attack a potential adversary, also have an interest, be it in trade, or bonds or whatever, in the potential adversary. It&#8217;s not in their best interest to attack at the moment. Things are going to change though. </p>
<p>You don&#8217;t need to be a country to take on someone like the USA, a single person, or a small group with the right know how can do a lot of damage to the military or public infrastructure. Remotely damaging electric generators that take months to replace, crippling banks, whatever. Anything that is connected in someway to the internet is a target. Australia and USA are looking at smart grids, the electric grid is already connected to the internet and it&#8217;s going to get a lot more connected and complicated with the added bonus of more attack vectors.</p>
<p>What can be done by the government to protect its citizens in an attack? Nothing, really. Except for China, who have a big firewall they can use to shut off attacks. Anything a government might do to strengthen its internet defence is going to be an attack on citizens privacy. Who in their right mind would trust a government to do the right thing with all the power they would hold over their citizens, if they had the control they needed to defend themselves and their citizens from internet attacks?</p>
<p>Which brings me to the question of Australia&#8217;s proposed filter. Filter bad, Conroy bad, and all that, but the filter is a firewall between Australian citizens and the internet, it could be used as a defensive measure against attacks. Not necessarily the technology Conroy is proposing, but a suitable firewall could.</p>
<p>But it&#8217;s like the government being able to listen in on every phone call, every conversation. It&#8217;s not going to happen, but something needs to happen. </p>
<p>I dare say the font on the security tag on this blog is going to get large in the tag cloud. These are young thoughts, they may change and I&#8217;ll be talking about security a lot more.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/10/02/cyber-war/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Nginx Admin</title>
		<link>http://chesterton.id.au/blog/2010/08/16/wordpress-nginx-admin/</link>
		<comments>http://chesterton.id.au/blog/2010/08/16/wordpress-nginx-admin/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 11:27:31 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=108</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/16/wordpress-nginx-admin/">WordPress Nginx Admin</a></p>
WordPress Nginx Admin I won&#8217;t go into too many details, I got everything I learned from google and my customisations aren&#8217;t very ground breaking. Jdub tweeted about the wordpress apc object cache being updated. So I (re)installed that. I had it installed a while ago, but a wordpress upgrade broke it. http://wordpress.org/extend/plugins/apc/ Everyone knows about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/16/wordpress-nginx-admin/">WordPress Nginx Admin</a></p>
<p>I won&#8217;t go into too many details, I got everything I learned from google and my customisations aren&#8217;t very ground breaking.</p>
<p>Jdub tweeted about the wordpress apc object cache being updated. So I (re)installed that. I had it installed a while ago, but a wordpress upgrade broke it. <a href="http://wordpress.org/extend/plugins/apc/">http://wordpress.org/extend/plugins/apc/</a></p>
<p>Everyone knows about wp-super-cache, and there&#8217;s some good nginx recipes and discussions on the internet already about how to run the two together. </p>
<p>My blog isn&#8217;t very big, or updated very often, so I tried setting wp-super-cache to preload cache files once a day. Except after the first day, it seemed to get stuck and wouldn&#8217;t regenerate them. So now, it just generates (and compresses)  them after the first visit and I&#8217;ve configured it so spiders can generate them, which isn&#8217;t the default. The cached files are set to expire after a day.</p>
<p>I&#8217;ve noticed recently that spiders are sometimes using the short url form ?p=100 rather than the long SEO style urls. With my nginx config, it won&#8217;t serve a super-cached file using the short url form. It won&#8217;t serve a super-cached file if the url has a ? in it.</p>
<p>This was new to me, a wordpress plugin called wp-minify. It&#8217;s an awesome idea. It combines multiple css (and, separately, js) links into one, minified version, and compresses and caches the result. So the browser only has to make one css get and one js get. Just helps pages load that little bit quicker. Good for the search engines, good for the users.</p>
<p>I set nginx to gzip text output, as well as look for a pre gzipped file first. So I basically ran:</p>
<p><code>for a in `find /www -name "*.js" -o -name "*.css" -o -name "*.html"`;do cat $a |gzip -c > $a.gz ;done</code></p>
<p>wp-recaptcha is a pain the bum when it comes to page load times, it slows the page display to one second. But it does a good job of stopping boring spam comments. auxesis suggested moving the &lt;script src=&#8230;&gt; to the end to the dom, which I&#8217;ve done, and that does help with the feel, it doesn&#8217;t reduce overall load time though. It&#8217;s just that I couldn&#8217;t find a good way to do it, and I&#8217;m going to have to merge my changes with every upgrade.</p>
<p>That&#8217;s about it I think, the name of the game was to decrease page load times.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/08/16/wordpress-nginx-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Admin</title>
		<link>http://chesterton.id.au/blog/2010/08/13/mysql-admin/</link>
		<comments>http://chesterton.id.au/blog/2010/08/13/mysql-admin/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 22:28:26 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=104</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/13/mysql-admin/">MySQL Admin</a></p>
MySQL Admin Many years ago, I was a rabid (vapid?) PostgreSQL fanboi. I took the time to study how to tune postgres, it was very rewarding to see queries go from taking 30 seconds, to completing in under a second. This involved tuning knobs in the prostres config, to adding indexes. All done manually. If [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/13/mysql-admin/">MySQL Admin</a></p>
<p>Many years ago, I was a rabid (vapid?) PostgreSQL fanboi. I took the time to study how to tune postgres, it was very rewarding to see queries go from taking 30 seconds, to completing in under a second. This involved tuning knobs in the prostres config, to adding indexes. All done manually.</p>
<p>If some software would only work on mysql, I wouldn&#8217;t bother looking at it.</p>
<p>A few years ago I wanted to run WordPress on my Linode, I gave up my extremist software bias, and uninstalled postgres, and installed mysql. To tune it, I picked one of the three or four my.cnf files provided. And that was that. Although I gave up postgres for mysql, I showed it no love.</p>
<p>During my recent webserver admin gorge, I came across a shell script that would help you tune mysql&#8217;s knobs. Most knobs weren&#8217;t even mentioned in my my.cnf file, so were at the default. I found much delight in it telling me to raise this, and lower that. In the end, I ended up with mysql using about the same amount of memory, but much more efficiently, by using more memory here where required, and using less memory there where not needed. </p>
<p>The script is called <a href="http://www.day32.com/MySQL/tuning-primer.sh">tuning-primer.sh</a> and can be found at <a href="http://www.day32.com/MySQL/">http://www.day32.com/MySQL/</a>.</p>
<p>It took me many days to tune my mysql databases, run the script, adjust knobs, restart mysql, let it run for a day or two, and repeat. It turns out some knobs don&#8217;t need adjusting until other knobs are adjusted first, so you can&#8217;t get it right the first go. Plus I was quite cautious in how much I would adjust a knob.</p>
<p>There&#8217;s also another script I haven&#8217;t yet looked at called mysqltuner.pl, google will hook you up.</p>
<p>And here&#8217;s some music I&#8217;ve been enjoying lately from Sia, (an adelaide girl) her live performances are better than her albums. <a href="http://www.youtube.com/watch?v=CDDW5zwu6yE">Sia &#8211; Soon We&#8217;ll Be Found (Letterman)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/08/13/mysql-admin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web Server Admin</title>
		<link>http://chesterton.id.au/blog/2010/08/07/web-server-admin/</link>
		<comments>http://chesterton.id.au/blog/2010/08/07/web-server-admin/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 17:40:08 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lighty]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=102</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/07/web-server-admin/">Web Server Admin</a></p>
Web Server Admin I recently swapped over from lighty to nginx, and man, am I glad I did. I have no idea about the internals, which is faster, lighter, better, etc, but nginx is way more intuitive to configure. Which in the end means my server is set up better. That kick started my latest [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/08/07/web-server-admin/">Web Server Admin</a></p>
<p>I recently swapped over from lighty to nginx, and man, am I glad I did. I have no idea about the internals, which is faster, lighter, better, etc, but nginx is way more intuitive to configure. Which in the end means my server is set up better.</p>
<p>That kick started my latest obsession, speeding up web servers.</p>
<p>I might go into details in a later post, but first, a question. I&#8217;ve got my wordpress blog loading nice and quick, except for pages where you can leave a comment, the recaptcha pluggin slows down the display of the page to 1 second. Obviously this is unacceptable. 1 SECOND!!!!!</p>
<p>What I would like is a &#8220;leave a comment&#8221; link to be displayed at the end of the post or comments, and clicking it would load the comment box with the recaptcha.</p>
<p>Any ideas how I would go about it?</p>
<p>I&#8217;ve tried css tricks to hide divs, but the javascript and images still load and hold up the display of the page, even though they aren&#8217;t (immediately) displayed. Annoying.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/08/07/web-server-admin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Basic Hostname Set Up Part 2</title>
		<link>http://chesterton.id.au/blog/2010/06/04/basic-hostname-set-up-part-2/</link>
		<comments>http://chesterton.id.au/blog/2010/06/04/basic-hostname-set-up-part-2/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:16:38 +0000</pubDate>
		<dc:creator>chesty</dc:creator>
				<category><![CDATA[LA]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[ubuntu-au]]></category>
		<category><![CDATA[hostname]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://chesterton.id.au/blog/?p=85</guid>
		<description><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/06/04/basic-hostname-set-up-part-2/">Basic Hostname Set Up Part 2</a></p>
Basic Hostname Set Up Part 2 I left a few things unsaid in my previous post basic hostname set up, and after talking with some people about /etc/hosts, I thought a quick follow up is in order. Firstly, my preference is to use the ethernet&#8217;s ip address to tie the host name to the FQDN, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chesterton.id.au/blog/2010/06/04/basic-hostname-set-up-part-2/">Basic Hostname Set Up Part 2</a></p>
<p>I left a few things unsaid in my previous post <a href="http://chesterton.id.au/blog/2010/06/02/basic-hostname-set-up/">basic hostname set up</a>, and after talking with some people about <code>/etc/hosts</code>, I thought a quick follow up is in order.</p>
<p>Firstly, my preference is to use the ethernet&#8217;s ip address to tie the host name to the FQDN, but others like to use <code>127.0.1.1</code>. There&#8217;s a case where you really should use <code>127.0.1.1</code> and that&#8217;s in laptops where the ethernet interface might disappear when it&#8217;s disconnected, probably desktops with dynamic ip addresses, too. But for servers with a static ip address, take your pick, I chose to use eth0.</p>
<p>An example <code>/etc/hosts</code> for a laptop<br />
<code>127.0.0.1 localhost<br />
127.0.1.1 mymailname.com myhostname<br />
</code></p>
<p>Where myhostname is the host name configured in the kernel.</p>
<p>An example <code>/etc/hosts</code> for a server<br />
<code>127.0.0.1 localhost<br />
192.168.1.1 mymailname.com myhostname.mymailname.com someothername myhostname<br />
</code></p>
<p>When the kernel first boots, the host name is configured. How depends on the distribution. Ubuntu seems to use <code>/etc/hostname</code>. In my example <code>/etc/hostname</code> contains myhostname .</p>
<p>When you run the command <code>hostname</code> it does a <code>gethostname()</code> to get the configured host name. It doesn&#8217;t reread <code>/etc/hostname</code> every time, it&#8217;s stored in the kernel, presumably.</p>
<p>When you want the FQDN, you run <code>hostname -f</code>, it does a <code>gethostname()</code> to get the configured host name, then does a <code>getaddrinfo("myhostname",...)</code> to get the FQDN. Using the last <code>/etc/hosts</code> example, the FQDN is mymailname.com because it&#8217;s the first string after the ip address in the line where myhostname appears.</p>
<p>Short names such as the host name myhostname should go at the end of the line, what you want the FQDN to be should be the first string after the ip address, and any other names goes in the middle.</p>
<p>In my examples, I made the FQDN the mail name, because some distributions use the FQDN by default as the mail name. Ubuntu doesn&#8217;t, it appears to use <code>/etc/mailname</code>.</p>
<p>Anyway, that&#8217;s my understanding based on messing around and reading a man page. Hopefully I&#8217;ve explained how the host name and the FQDN is tied together in <code>/etc/hosts</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://chesterton.id.au/blog/2010/06/04/basic-hostname-set-up-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

