<?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>zarzax the blog &#187; sysadmin</title>
	<atom:link href="http://www.zarzax.com/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zarzax.com</link>
	<description>the rantings of mark young :: random thoughts and interesting snippets</description>
	<lastBuildDate>Thu, 09 Jul 2009 14:33:00 +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>chmod recursively on directories or files using find</title>
		<link>http://www.zarzax.com/chmod-recursively-on-directories-using-find/</link>
		<comments>http://www.zarzax.com/chmod-recursively-on-directories-using-find/#comments</comments>
		<pubDate>Wed, 06 May 2009 18:00:28 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.zarzax.com/?p=325</guid>
		<description><![CDATA[Sometimes its the little things that annoy us so much on the Unix command line.  One big question for me was&#8230;  How to do you differentiate between directories and files when recursively chmod-ing?
The answer is simple.  But of course there are different ways to do the same thing.
Using the find command
find -name '*' -type [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes its the little things that annoy us so much on the Unix command line.  One big question for me was&#8230;  How to do you differentiate between directories and files when recursively chmod-ing?</p>
<p>The answer is simple.  But of course there are different ways to do the same thing.</p>
<h5>Using the <em>find</em> command</h5>
<pre lang="Text">find -name '*' -type d -exec chmod 0755 {} \;</pre>
<p><em>NOTE: the -name &#8216;*&#8217; parameter is used to keep from modifying the present working directory or &#8216;.&#8217; directory.</em></p>
<pre lang="Text">find . -type f -exec chmod 0644 {} \;</pre>
<h5><span id="more-325"></span></h5>
<h5>Using <em>chmod</em> with capital <strong>X</strong></h5>
<p>The capital X will cause directories and files that are executable (for user and group) to be set as executable.  Other files will not be set as executable.</p>
<pre lang="Text">chmod -R ug+rX .</pre>
<h5>Other uses of the <em>find</em> command</h5>
<p>Modifying specific file types:</p>
<pre lang="Text">find -name '*.pdf' -exec chmod 0755 {} \;</pre>
<p><em>NOTE: you can insert any command in after the -exec but before the {} (chmod 0775) such as &#8216;chown&#8217;.</em></p>
<h5>My common usage</h5>
<p>I often setup new Wordpress installations.  I like to get ownership and permission sorted out quickly.  I&#8217;ll use this as my example.</p>
<p>In your Wordpress root directory:</p>
<pre lang="Text">chown your-username.www-data * -R
find -name '*' -type d -exec chmod 2750 {} \;
find . -type f -exec chmod 2640 {} \;</pre>
<p><em>NOTE: the 2750 and 2640 sets a bit so that all directories that are created by the www-data user in my case will have the same permissions and ownership as the the other files.  Otherwise the www-data user may create files that are owned by itself and the your-username may not be able to modify them easily.<br />
</em></p>
<p>Now change so that the wp-content/{uploads,plugins,themes} directories are writable to the www-data group.  This is so that the web server can upload photos and auto-update plugins/themes.</p>
<pre lang="Text">cd wp-content
mkdir uploads
chown your-username.www-data uploads
find -name '*' -type d -exec chmod 2770 {} \;
find . -type f -exec chmod 2660 {} \;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/chmod-recursively-on-directories-using-find/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DenyHosts smart defense for your SSH server</title>
		<link>http://www.zarzax.com/denyhosts-smart-defense-for-your-ssh-server/</link>
		<comments>http://www.zarzax.com/denyhosts-smart-defense-for-your-ssh-server/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 19:03:39 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[denyhosts]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.zarzax.com/?p=100</guid>
		<description><![CDATA[DenyHosts smart SSH Server Protection
DenyHosts is a python script that is run on any Linux or BSD based system to help block SSH based attacks.  It works to prevent both &#8220;dictionary based&#8221; and &#8220;brute force&#8221; attacks.  Also provided is a system to synchronize block lists between other users of DenyHosts.
Continue reading for the [...]]]></description>
			<content:encoded><![CDATA[<h3>DenyHosts smart SSH Server Protection</h3>
<div id="attachment_138" class="wp-caption aligncenter" style="width: 357px"><a title="DenyHosts smart defense for your SSH server" href="http://denyhosts.sourceforge.net/" target="_blank"><img class="size-full wp-image-138" title="denyhosts" src="http://www.zarzax.com/wp-content/uploads/2009/03/denyhosts.png" alt="DenyHosts is a Python based security tool for SSH servers." width="347" height="73" /></a><p class="wp-caption-text">DenyHosts is a Python based security tool for SSH servers.</p></div>
<p><a href="http://denyhosts.sourceforge.net/" target="_blank">DenyHosts</a> is a python script that is run on any Linux or BSD based system to help block SSH based attacks.  It works to prevent both &#8220;dictionary based&#8221; and &#8220;brute force&#8221; attacks.  Also provided is a system to synchronize block lists between other users of DenyHosts.</p>
<p>Continue reading for the complete guide&#8230;</p>
<p><span id="more-100"></span></p>
<p>It works by scanning the SSHD log files (/var/log/auth.log or /var/log/secure) and discovering failed login attempts.  Attacks are triggered by number of failed attempts or invalid username login attempts.  After it discovers an attack it inserts the IP address into the /etc/hosts.deny file which will block that IP from connecting to your system in the future.  Check out the <a title="DenyHosts Features" href="http://denyhosts.sourceforge.net/features.html">features page</a> for a full set of features.</p>
<p>I started using DenyHosts after I noticed a surprising number of failed login attempts in my sshd logs.  After I installed DenyHosts it discovered over 50 IPs that were attempting to gain access to my system and started blocking them.  I quickly discovered the synchronization features and have not looked back.  Now I maintain a blocklist near 9000 IPs long.</p>
<h3>Base System</h3>
<p>I am going to describe how to setup a basic server firewall with this base system as the example:</p>
<ul>
<li>Ubuntu Server 8.04 LTS (hardy)</li>
<li>basic apt sources. (hardy main, hardy-updates main, hardy-security main)</li>
</ul>
<h3>Installation</h3>
<pre lang="Text">sudo apt-get install denyhosts</pre>
<h3>Configuration</h3>
<p>Modify the configuration file /etc/denyhosts.conf to include these settings.</p>
<pre lang="Text">SECURE_LOG = /var/log/auth.log
HOSTS_DENY = /etc/hosts.deny
PURGE_DENY = 			# When set to blank system will never purge block list.
BLOCK_SERVICE  = sshd		# When set to SSHD the ssh server will be blocked,
				# when set to ALL the IP will be blocked for all services.
DENY_THRESHOLD_INVALID = 5
DENY_THRESHOLD_VALID = 10
DENY_THRESHOLD_ROOT = 5
DENY_THRESHOLD_RESTRICTED = 5
WORK_DIR = /var/lib/denyhosts
SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS=YES
HOSTNAME_LOOKUP=YES		# This will do a hostname lookup.  Set to NO for improved performance.
LOCK_FILE = /var/run/denyhosts.pid

       ############ THESE SETTINGS ARE OPTIONAL ############
ADMIN_EMAIL = 			# Leave Blank or use your email address for reports on blocked IPs.
SMTP_HOST = localhost           # localhost if you are running your own email server or set to an external server
SMTP_PORT = 25
SMTP_FROM = DenyHosts
SMTP_SUBJECT = DenyHosts Report
SMTP_DATE_FORMAT = %a, %d %b %Y %H:%M:%S %z
AGE_RESET_VALID=5d
AGE_RESET_ROOT=25d
AGE_RESET_RESTRICTED=25d
AGE_RESET_INVALID=10d

   ######### THESE SETTINGS ARE SPECIFIC TO DAEMON MODE  ##########
DAEMON_LOG = /var/log/denyhosts
DAEMON_SLEEP = 30s
DAEMON_PURGE = 1h

   #########   THESE SETTINGS ARE SPECIFIC TO     ##########
   #########       DAEMON SYNCHRONIZATION         ##########
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911
SYNC_INTERVAL = 1h
SYNC_UPLOAD = yes
SYNC_DOWNLOAD = yes
SYNC_DOWNLOAD_THRESHOLD = 3</pre>
<p><em>Sync Server setup is optional.  If you only want to block attempts on your server comment out the &#8216;SYNC_SERVER&#8217; line.</em></p>
<h3>Start the Service</h3>
<pre>sudo /etc/init.d/denyhosts restart</pre>
<h4>Other Resources</h4>
<ul>
<li><a title="DenyHosts Homepage" href="http://denyhosts.sourceforge.net/index.html" target="_blank">DenyHosts Homepage</a></li>
<li><a title="Preventing SSH Attacks using DenyHosts" href="http://www.howtoforge.com/preventing_ssh_dictionary_attacks_with_denyhosts" target="_blank">HowToForge Article on DenyHosts Configuration</a></li>
<li><a title="Fail2ban Automated IP Banning" href="http://www.fail2ban.org" target="_blank">Fail2ban</a> &#8211; Similar to DenyHosts except that it scans other logs such as Apache, Postfix, SSHD and creates its ban lists using iptables or netfilter&#8217;s deny.hosts file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/denyhosts-smart-defense-for-your-ssh-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX Resources for OSX</title>
		<link>http://www.zarzax.com/latex-resources-for-osx/</link>
		<comments>http://www.zarzax.com/latex-resources-for-osx/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 04:03:04 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.zarzax.com/?p=108</guid>
		<description><![CDATA[LaTeX &#8211; A Document Preparation System
I started using LaTeX for its ease of writing mathematical equations and expression.  Anyone who has tried fooling with Microsoft Word&#8217;s equation editor realizes that it is time consuming, looks terrible, and will agree that there must be an easier way.  That way is LaTeX.
LaTeX is a typesetting [...]]]></description>
			<content:encoded><![CDATA[<h3>LaTeX &#8211; A Document Preparation System</h3>
<p>I started using LaTeX for its ease of writing mathematical equations and expression.  Anyone who has tried fooling with Microsoft Word&#8217;s equation editor realizes that it is time consuming, looks terrible, and will agree that there must be an easier way.  That way is LaTeX.</p>
<p>LaTeX is a typesetting tool that excels with many types of documents such as academic journals, books, and complex mathematical formulas.  One thing that it is great with is keeping track of references and bibliographies.</p>
<p><span id="more-108"></span></p>
<p>One thing to understand is that LaTeX is not for everyone.  It will be confusing and complex to most users.  There are tools that make it easier, but at its base you will be writing in a type of markdown language that is part of the barrier to entry.</p>
<p><a title="Broken"><img src="http://farm4.static.flickr.com/3543/3320787406_ebd03a54ed_m.jpg" border="0" alt="Broken" /></a><br />
<small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://www.zarzax.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="basheertome" href="http://www.flickr.com/photos/10019047@N05/3320787406/" target="_blank">basheertome</a></small></p>
<h4>What is LaTeX?</h4>
<blockquote><p>LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as <a href="http://www.latex-project.org/lppl/">free software</a>.  &#8211; <cite><a title="LaTeX Project" href="http://www.latex-project.org/" target="_blank">http://www.latex-project.org/</a> </cite></p></blockquote>
<h4>LaTeX Features</h4>
<blockquote>
<ul>
<li>Typesetting journal articles, technical reports, books, and slide   presentations.</li>
<li>Control over large documents containing sectioning,   cross-references, tables and figures.</li>
<li>Typesetting of complex mathematical formulas.</li>
<li>Advanced typesetting of mathematics with AMS-LaTeX.</li>
<li>Automatic generation of bibliographies and indexes.</li>
<li>Multi-lingual typesetting.</li>
<li>Inclusion of artwork, and process or spot colour.</li>
<li>Using PostScript or Metafont fonts.</li>
</ul>
<p style="padding-left: 60px;">&#8211; <a title="LaTeX Project" href="http://www.latex-project.org/intro.html" target="_blank">LaTeX Project</a></p>
</blockquote>
<h4>What I Use</h4>
<p>I work with LaTeX on both Mac OSX and Linux systems. Most Linux distributions make it simple to install LaTeX either being included or simply from package managers.  Mac OSX is a bit different.</p>
<p>To make my life easier I use the <a title="MacTeX OSX LaTeX Distribution" href="http://www.tug.org/mactex/" target="_blank">MacTeX LaTeX Distribution</a> with <a title="Macromates TextMate" href="http://macromates.com/" target="_blank">Macromates TextMate</a> OSX text editor.  By installing the MacTeX distribution you will be given all the command line tools, fonts, and converters you will need.  TextMate will give you syntax highlighting and access to other tools that will make you life easier.  But all you really need is a text editor and the command line.</p>
<p>Good luck with your journey into the LaTeX world.</p>
<h4>LaTeX Resources</h4>
<p>Here is a list of resources so both you and I can remember them in the future! <img src='http://www.zarzax.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Enjoy!</p>
<ul>
<li><cite></cite><a title="LaTeX Project" href="http://www.latex-project.org/ " target="_blank">LaTeX Project</a></li>
<li><a title="MacTeX OSX LaTeX Distribution" href="http://www.tug.org/mactex/" target="_blank">MacTeX OSX LaTeX Distribution</a></li>
<li><a title="A Quick &amp; Dirty Guide to LaTeX" href="http://www.tug.org/mactex/" target="_blank">A Quick &amp; Dirty Guide to LaTeX</a></li>
<li><a title="LaTeX Math Symbols" href="http://web.ift.uib.no/Fysisk/Teori/KURS/WRK/TeX/symALL.html" target="_blank">LaTeX Math Symbols</a></li>
<li><a title="LaTeX Reference" href="http://www.emerson.emory.edu/services/latex/latex_toc.html">LaTeX Reference</a></li>
<li><a title="Including Graphics in a LaTeX Document" href="http://amath.colorado.edu/documentation/LaTeX/reference/figures.html" target="_blank">Including Graphics in a LaTeX Document</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/latex-resources-for-osx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IPKungFu easy iptables based server firewall</title>
		<link>http://www.zarzax.com/ipkungfu-easy-iptables-based-server-firewall/</link>
		<comments>http://www.zarzax.com/ipkungfu-easy-iptables-based-server-firewall/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 23:19:51 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.zarzax.com/?p=92</guid>
		<description><![CDATA[IPKungFu Firewall and Basic Server setup
IPKungFu is an iptables-based Linux firewall. It aims to simplify the configuration of Internet connection sharing, port forwarding, and packet filtering. &#8212; http://freshmeat.net/projects/ipkungfu/
IPKungFu better described as being a smart script that eases creation complex firewall rules.   Creating a gateway firewall, internet sharing, or simply setting up a basic [...]]]></description>
			<content:encoded><![CDATA[<h2>IPKungFu Firewall and Basic Server setup</h2>
<blockquote><p>IPKungFu is an iptables-based Linux firewall. It aims to simplify the configuration of Internet connection sharing, port forwarding, and packet filtering. &#8212; http://freshmeat.net/projects/ipkungfu/</p></blockquote>
<p>IPKungFu better described as being a smart script that eases creation complex firewall rules.   Creating a gateway firewall, internet sharing, or simply setting up a basic firewall are all simple tasks.   By default it includes advanced logging, syn-flood protection, and port scanning protection.</p>
<p style="text-align: center;"><img src="http://farm1.static.flickr.com/190/501030192_65580e69a6_m.jpg" border="0" alt="Karate" /><br />
<small><a title="Attribution-ShareAlike License" href="http://creativecommons.org/licenses/by-sa/2.0/" target="_blank"><img src="http://www.zarzax.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="masochismtango" href="http://www.flickr.com/photos/26332965@N00/501030192/" target="_blank">masochismtango</a></small></p>
<p> </p>
<p>Continue for the complete guide&#8230;</p>
<p><span id="more-92"></span></p>
<p> </p>
<p>I am going to describe how to setup a basic server firewall with this base system as the example:</p>
<ul>
<li>Ubuntu Server 8.04 LTS (hardy)</li>
<li>basic apt sources. (hardy main, hardy-updates main, hardy-security main)</li>
</ul>
<h3>Install</h3>
<pre>user@server# sudo apt-get install ipkungfu</pre>
<h3>Configure</h3>
<p>open &#8216;/etc/ipkungfu/ipkungfu.conf&#8217; and change these settings:</p>
<pre>GATEWAY=0
BLOCK_PINGS=1  #keep the ICMP port open for Nagios!!
SUSPECT="DROP"	#'DROP' is the same as Stealth on consumer routers
KNOWN_BAD="DROP"
PORT_SCAN="DROP"
GET_IP="AUTO"
DISALLOW_PRIVATE=1  #for servers to reject private IPs as spoofs
FAILSAFE=1</pre>
<p>open &#8216;/etc/ipkungfu/services.conf&#8217; and add &#8216;ACCEPT&#8217; to the services you want:</p>
<pre># The defaults.  I set SSH, HTTP, and HTTPS services to 'ACCEPT'
ftp-data:20:tcp
ftp:21:tcp
ssh:22:tcp:ACCEPT
telnet:23:tcp
smtp:25:tcp
domain:53:tcp
bootps:63:tcp
http:80:tcp:ACCEPT
pop3:110:tcp
auth:113:tcp
ntp:123:tcp
imap:143:tcp
https:443:tcp:ACCEPT
imaps:993:tcp
pop3s:995:tcp
socks:1080:tcp

# Custom Services
# form: ServiceName:ServicePort:Protocol[:ACCEPT|DROP|REJECT|or any valid target)]
splunk:8000:tcp:ACCEPT</pre>
<p><em>It will be important to enable SSH if you are working on a remote machine.  Otherwise your firewall will block you from creating new connections.</em></p>
<p>You can add custom IPTABLES rules to the &#8216;/etc/ipkungfu/custom.conf&#8217;. For example:</p>
<pre>### Custom MAC address to be Accepted for full access to machine.
$IPTABLES -A INPUT -m mac --mac-source xx:xx:xx:xx:xx:xx -j ACCEPT</pre>
<p><em>Please note that MAC addresses are not a secure.  They are trivially spoofed.  This is used as an example.</em></p>
<h3>Test Configuration</h3>
<pre>user@server# sudo ipkungfu --test</pre>
<p>Should display something similar:</p>
<pre style="padding-left: 30px; ">Checking integrity: ..	PASSED
Checking configuration...
 TTL support detected!
 MARK support detected!
Clearing old chains and tables...
Implementing custom rules...
Handling Services On The Following Ports...
-------------------------------
 Port  Protocol  Name   Target
-------------------------------
 22    tcp       ssh    ACCEPT
 80    tcp       http   ACCEPT
 443   tcp       https  ACCEPT
-------------------------------
Creating proc settings cache:	OK
Creating iptables rules cache:	OK</pre>
<p><em>This should display all the ports you want to keep open.  Did you open SSH? <img src='http://www.zarzax.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<h3>Enable On Reboot</h3>
<p>Edit &#8216;/etc/default/ipkungfu&#8217;:</p>
<pre>IPKFSTART=1</pre>
<h3>Start the Service</h3>
<pre>user@server# sudo ipkungfu</pre>
<h3>Other Resources</h3>
<ul>
<li><a href="http://www.linuxkungfu.org/" target="_blank">http://www.linuxkungfu.org/</a> &#8212; Authors Site</li>
<li><a href="http://freshmeat.net/projects/ipkungfu/" target="_blank">http://freshmeat.net/projects/ipkungfu/</a> &#8212; Freshmeat Tracker</li>
<li><a href="https://help.ubuntu.com/community/firewall/ipkungfu" target="_blank">https://help.ubuntu.com/community/firewall/ipkungfu</a> &#8212; Ubuntu Community Documentation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/ipkungfu-easy-iptables-based-server-firewall/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mediawiki Skinning</title>
		<link>http://www.zarzax.com/mediawiki-skinning/</link>
		<comments>http://www.zarzax.com/mediawiki-skinning/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 02:21:50 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[mediawiki]]></category>
		<category><![CDATA[skinning]]></category>

		<guid isPermaLink="false">6 at http://zarzax.com</guid>
		<description><![CDATA[I&#8217;ve been spending the last weeks finishing up a our redesign of the Nagios Network of sites (Nagios OSS Project, Nagios Community, Nagios Community Wiki).  The wiki has been my latest challenge.      I started our searching for a skin that was close to what I wanted and found the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending the last weeks finishing up a our redesign of the Nagios Network of sites (<a href="http://www.nagios.org">Nagios OSS Project</a>, <a href="http://community.nagios.org">Nagios Community</a>, <a href="http://community.nagios.org/wiki">Nagios Community Wiki</a>).  The wiki has been my latest challenge.      I started our searching for a skin that was close to what I wanted and found the <a href="http://ufjhoov.blogspot.com/2007/03/kindofblue-mediawiki-skin.html">kindofblue skin</a>.  In the end I have ended up rewriting most of the php and css to come up with a fixed width theme that mixes well with the rest of our current look and feel.    I will be posting our new theme soon.  In the meantime you can check out the fruits of my labor <a href="http://community.nagios.org">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/mediawiki-skinning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhanced Nagios; CGI Security and Authentication</title>
		<link>http://www.zarzax.com/enhanced-nagios-cgi-security-and-authentication/</link>
		<comments>http://www.zarzax.com/enhanced-nagios-cgi-security-and-authentication/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 04:30:03 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">3 at http://zarzax.com</guid>
		<description><![CDATA[Over the past few days we have been tackling a nasty Cross Site Request Forgery (CSRF) bug in Nagios 3.0.4.  With our bug fix I updated the Nagios documentation to include some information on Enhanced CGI Security and Authentication.  This is a much needed addition that answers some of the communities questions regarding [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few days we have been tackling a nasty Cross Site Request Forgery (CSRF) bug in Nagios 3.0.4.  With our bug fix I updated the Nagios documentation to include some information on <a href="http://nagios.sourceforge.net/docs/3_0/cgisecurity.html">Enhanced CGI Security and Authentication</a>.  This is a much needed addition that answers some of the communities questions regarding different ways to secure <a href="http://www.nagios.org">Nagios</a>.  This post will rehash much of what I wrote about in the documentation.  There are many ways to enhance the security of your monitoring server and Nagios environment. This should not be taken as the end all approach to security. Instead, think of it as an introduction to some of the techniques you can use to tighten the security of your system. As always, you should do your research and use the best techniques available. Treat your monitoring server as it were the most important server in your network and you shall be rewarded.</p>
<p><span id="more-8"></span></p>
<p>My greatest recommendation for a secure Nagios installation would be a mixture of the techniques I am describing but also to not open the Nagios server outside your internal network.  <a name="additionaltechniques"></a> <strong>Additional Techniques</strong></p>
<ul>
<li><strong>Stronger Authentication using Digest Authentication</strong>.  If you have followed the <a href="quickstart.html">quickstart guides</a>, chances are that you are using Apache&#8217;s <a href="http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html">Basic Authentication</a>.  Basic Authentication will send your username and password in &#8220;clear text&#8221; with every http request.  Consider using a more secure method of authentication such as <a href="http://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html">Digest Authentication</a> which creates a MD5 Hash of your username and password to send with each request.</li>
<li><strong>Forcing TLS/SSL for all Web Communication</strong>.  Apache provides <a href="http://en.wikipedia.org/wiki/Transport_Layer_Security">TLS/SSL</a> through the <a href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html">mod_ssl</a> module.  TLS/SSL provides a secure tunnel between the client and server that prevents eavesdropping and tampering using strong publickey/privatekey cryptography.</li>
<li><strong>Locking Down Apache Using Access Controls</strong>.  Consider locking down access to the Nagios box to your IP address, IP address range, or IP subnet.  If you require access outside your network you could use VPN or SSH Tunnels.  This is a easy and strong to limit access to HTTP/HTTPS on your system.</li>
</ul>
<p><a name="implementation-digest"></a> <strong>Implementing Digest Authentication</strong><br />
The implementation of Digest Authentication is simple.  You will have to create the new type of password file using the <a href="http://httpd.apache.org/docs/2.2/programs/htdigest.html">&#8216;htdigest&#8217;</a> tool, then modify the Apache configuration for nagios (typically /etc/httpd/conf.d/nagios.conf).<br />
Create a new passwords file using the <a href="http://httpd.apache.org/docs/2.2/programs/htdigest.html">&#8216;htdigest&#8217;</a> tool.  The difference that you will notice if you are familiar with <a href="http://httpd.apache.org/docs/2.2/programs/htpasswd.html">&#8216;htpasswd&#8217;</a> tools is the requirement to supply a &#8216;realm&#8217; argument.  Where &#8216;realm&#8217; in this case refers to the value of the &#8216;AuthName&#8217; directive in the Apache configuration.</p>
<pre>
htdigest -c /usr/local/nagios/etc/.digest_pw "Nagios Access" nagiosadmin
</pre>
<p>Next, edit the Apache configuration file for Nagios (typically /etc/httpd/conf.d/nagios.conf) using the following example.</p>
<pre LANG="Apache">
## BEGIN APACHE CONFIG SNIPPET - NAGIOS.CONF
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
     Options ExecCGI
     AllowOverride None
     Order allow,deny
     Allow from all
     AuthType Digest
     AuthName "Nagios Access"
     AuthUserFile /usr/local/nagios/etc/.digest_pw
     Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
     Options None
     AllowOverride None
     Order allow,deny
     Allow from all
     AuthType Digest
     AuthName "Nagios Access"
     AuthUserFile /usr/local/nagios/etc/.digest_pw
     Require valid-user
</Directory>
## END APACHE CONFIG SNIPPETS
</pre>
<p>Then, restart the Apache service so the new settings can take effect.</p>
<pre>
/etc/init.d/httpd restart
</pre>
<p><a name="implementation-ssl"></a> <strong>Implementing Forced TLS/SSL</strong><br />
Make sure you&#8217;ve installed Apache and OpenSSL.  By default you should have <a href="http://httpd.apache.org/docs/2.2/mod/mod_ssl.html">mod_ssl</a> support if you are still having trouble you may find help reading Apache&#8217;s <a href="http://httpd.apache.org/docs/2.0/ssl">TLS/SSL Encryption Documentation</a>.</p>
<p>Next, verify that TLS/SSL support is working by visiting your Nagios Web Interface using HTTPS (<a title="https://your.domain/nagios" href="https://your.domain/nagios">https://your.domain/nagios</a>).  If it is working you can continue on to the next steps that will force using HTTPS and block all HTTP requests for the Nagios Web Interface.  If you are having trouble visit Apache&#8217;s <a href="http://httpd.apache.org/docs/2.0/ssl">TLS/SSL Encryption Documentation</a> and <a href="http://www.google.com">Google</a> for troubleshooting your specific Apache installation.</p>
<p>Next, edit the Apache configuration file for Nagios (typically /etc/httpd/conf.d/nagios.conf) by adding the &#8216;SSLRequireSSL&#8217; directive to both the &#8217;sbin&#8217; and &#8217;share&#8217; directories.</p>
<pre LANG="Apache">
## BEGIN APACHE CONFIG SNIPPET - NAGIOS.CONF
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
     ...
     SSLRequireSSL
     ...
</Directory>

Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
     ...
     SSLRequireSSL
     ...
</Directory>
## END APACHE CONFIG SNIPPETS
</pre>
<p>Restart the Apache service so the new settings can take effect.</p>
<pre>
/etc/init.d/httpd restart
</pre>
<p><a name="implementation-lockdown"></a> <strong>Implementing IP subnet lockdown</strong><br />
The following example will show how to lock down Nagios CGIs to a specific IP address, IP address range, or IP subnet using Apache&#8217;s <a href="http://httpd.apache.org/docs/2.2/howto/access.html">access controls</a>.<br />
Edit the Apache configuration file for Nagios (typically /etc/httpd/conf.d/nagios.conf) by using the &#8216;Allow&#8217;, &#8216;Deny&#8217;, and &#8216;Order&#8217; directives using the following as an example.</p>
<pre LANG="Apache">
## BEGIN APACHE CONFIG SNIPPET - NAGIOS.CONF
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
     ...
     AllowOverride None
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1 10.0.0.25		# Allow single IP addresses
     Allow from 10.0.0.0/255.255.255.0		# Allow network/netmask pair
     Allow from 10.0.0.0/24			# Allow network/nnn CIDR spec
     ...
</Directory>

Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
     ...
     AllowOverride None
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1 10.0.0.25		# Allow single IP addresses
     Allow from 10.0.0.0/255.255.255.0		# Allow network/netmask pair
     Allow from 10.0.0.0/24			# Allow network/nnn CIDR spec
     ...
</Directory>
## END APACHE CONFIG SNIPPET
</pre>
<p><a name="importantnotes"></a> <strong>Important Notes</strong></p>
<ul>
<li><strong>Digest Authentication sends data in the clear but not your username and password</strong>.</li>
<li><strong>Digest Authentication is not as universally supported as Basic Authentication</strong>.</li>
<li><strong>TLS/SSL has potential for &#8220;<a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack">man-in-the-middle attacks</a>&#8220;</strong>.  MITM attacks are vulnerable if an attacker is able to insert itself between the server and client such as in a Phishing attack, ISP monitoring, or corporate LAN firewall certificate resigning.  So read up on certificate verification!</li>
<li><strong>Apache access controls only protect the HTTP/HTTPS protocols</strong>.  Look into <a href="http://www.netfilter.org/projects/iptables/index.html">IPtables</a> for strong system wide firewall control.</li>
<li><strong>Most importantly, Security is a moving target so stay informed and do research</strong>!  Perhaps by listening to a Podcast such as &#8220;<a href="http://www.grc.com/securitynow.htm">Security Now!</a>&#8220;.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/enhanced-nagios-cgi-security-and-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NETWAYS Nagios Conference 2008</title>
		<link>http://www.zarzax.com/netways-nagios-conference-2008/</link>
		<comments>http://www.zarzax.com/netways-nagios-conference-2008/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 17:13:10 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Nagios]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[conferences]]></category>

		<guid isPermaLink="false">9 at http://zarzax.com</guid>
		<description><![CDATA[I just got back from this years NETWAYS Nagios Conference.  It was a huge success.  It was held again at the City Center Holiday Inn, Nuernberg.  Nuernberg is such a great city.  It really makes me sad that I did not have much time to see more of the city.
The Conference itself was really busy.  They had [...]]]></description>
			<content:encoded><![CDATA[<p><small><a title="Docklandsboy" href="http://www.flickr.com/photos/40246732@N00/3022261893/" target="_blank"></a></small>I just got back from this years <a href="http://www.netways.de/nagios_konferenz/">NETWAYS Nagios Conference</a>.  It was a huge success.  It was held again at the City Center Holiday Inn, Nuernberg.  Nuernberg is such a great city.  It really makes me sad that I did not have much time to see more of the city.</p>
<p>The Conference itself was really busy.  They had 3 to 4 tracks every session, with at least 1 track being in English.  This really means that I wake up at 8am, conference starts at 9am, ends at 5pm, with 15min breaks between sessions.  After 5pm there is dinner or bars that we then go to and stay till 2am or 3am.  I have to say that I was completely exhausted when I finally got home.</p>
<p>The best part was I finally got to meet many people that I have only communicated with by email.  I was able to hang out with some of the German community members Hendrik, Joerg, Matthias, and Michael one evening.  We had some great talks about Germany, working in Germany, the future of Nagios, with American Politics splattered in there for good measure. <img src='http://www.zarzax.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="Monitoring wall in the NOC" href="http://www.flickr.com/photos/40246732@N00/3022261893/" target="_blank"><img src="http://farm4.static.flickr.com/3010/3022261893_aff442bd9a_m.jpg" border="0" alt="Monitoring wall in the NOC" /></a><br />
<small><a title="Attribution License" href="http://creativecommons.org/licenses/by/2.0/" target="_blank"><img src="http://blog.zarzax.com/wp-content/plugins/photo-dropper/images/cc.png" border="0" alt="Creative Commons License" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a title="Docklandsboy" href="http://www.flickr.com/photos/40246732@N00/3022261893/" target="_blank">Docklandsboy</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zarzax.com/netways-nagios-conference-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
