<?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>SupportSages &#187; Howtos</title>
	<atom:link href="http://www.supportsages.com/blog/tag/howtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Monitoring with Nagios and NRPE</title>
		<link>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/</link>
		<comments>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/#comments</comments>
		<pubDate>Fri, 01 May 2009 20:47:50 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[NRPE]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=131</guid>
		<description><![CDATA[<strong>Nagios</strong>

Nagios is a versatile and functional network management tool with a GUI (graphicuser interface) comparable to other commercial tools. It is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios was originally designed to run under Linux, but now it also runs well on other Unix variants.

<strong>Nagios Installation Guides</strong>:

This blog is intended to provide you with simple instructions on how to install Nagios from source (code) in Fedora.

<strong>Prerequisites</strong>:

Before installing Nagios,you need to install the following packages:
Apache
GCC compiler
GD development libraries

You can use yum to ...]]></description>
			<content:encoded><![CDATA[<p><strong>Nagios</strong></p>
<p>Nagios is a versatile and functional network management tool with a GUI (graphicuser interface) comparable to other commercial tools. It is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios was originally designed to run under Linux, but now it also runs well on other Unix variants.</p>
<p><strong>Nagios Installation Guides</strong>:</p>
<p>This blog is intended to provide you with simple instructions on how to install Nagios from source (code) in Fedora.</p>
<p><strong>Prerequisites</strong>:</p>
<p>Before installing Nagios,you need to install the following packages:<br />
Apache<br />
GCC compiler<br />
GD development libraries</p>
<p>You can use yum to install these packages by running the following commands (as root):</p>
<blockquote><p>yum install  httpd<br />
yum install  gcc<br />
yum install  glibc glibc-common<br />
yum install  gd gd-devel</p></blockquote>
<p>1) <em>Create Account Information</em></p>
<p>Create a new nagios user account.</p>
<blockquote><p>/usr/sbin/useradd -m nagios</p></blockquote>
<p>Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.</p>
<blockquote><p>/usr/sbin/groupadd nagcmd<br />
/usr/sbin/usermod -a -G nagcmd nagios<br />
/usr/sbin/usermod -a -G nagcmd apache</p></blockquote>
<p>2) <em>Download Nagios</em>:</p>
<p>Create a directory for storing the downloads.</p>
<blockquote><p>mkdir ~/ssages<br />
cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz</p></blockquote>
<p>3) <em>Compile and Install Nagios</em></p>
<p>Extract the Nagios source code tarball.</p>
<blockquote><p>tar xzf nagios-3.0.6.tar.gz<em><br />
</em>cd nagios-3.0.6<br />
./configure &#8211;with-command-group=nagcmd<br />
make install<br />
make install-init<br />
make install-config<br />
make install-commandmode<br />
nagios-3.0.6</p></blockquote>
<p>4) <em>Configure the Web Interface<br />
</em><br />
Install the Nagios web config file in the Apache conf.d directory.</p>
<blockquote><p>make install-webconf</p></blockquote>
<p>Create a nagiosadmin account for logging into the Nagios web interface.</p>
<blockquote><p>htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin</p></blockquote>
<p>Edit the file<em> /usr/local/apache/conf/includes/pre_virtualhost_global.conf</em> and append the following lines to the virtual host directories.</p>
<blockquote><p>AuthName &#8220;Nagios&#8221;<br />
AuthType Basic<br />
AuthUserFile /usr/local/nagios/etc/htpasswd.users<br />
Require valid-user</p></blockquote>
<p>Restart Apache to make the new settings take effect.</p>
<blockquote><p>service httpd restart</p></blockquote>
<p>5)<strong> </strong><em>Compile and Install the Nagios Plugins</em></p>
<blockquote><p>wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz</p>
<p>cd ~/ssages</p>
<p>tar xzf nagios-plugins-1.4.11.tar.gz<br />
cd nagios-plugins-1.4.11</p></blockquote>
<p>Compile and install the plugins.</p>
<blockquote><p>./configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<br />
make<br />
make install<em><br />
</em></p></blockquote>
<p>6) Start Nagios</p>
<p>Add Nagios to the list of system services and have it automatically start when the system boots.<br />
<em></em></p>
<blockquote><p>chkconfig &#8211;add nagios<br />
chkconfig nagios on</p></blockquote>
<p>Verify the sample Nagios configuration files.</p>
<blockquote><p>/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>If there are no errors, start Nagios.</p>
<blockquote><p>service nagios start</p></blockquote>
<p>you can check the Nagios in your browser typing the following url:</p>
<blockquote><p><em>http://localhost/nagios</em></p></blockquote>
<p>You should now be able to access the Nagios web interface at the URL below. You&#8217;ll be prompted for the username (nagiosadmin) and password you specified earlier.</p>
<p><em><strong>NRPE Installation and Configuration</strong></em></p>
<p>The NRPE addon is designed to allow you to execute Nagios plugins on remote Linux/Unix machines. The main reason for doing this is to allow Nagios to monitor &#8220;local&#8221; resources (like CPU load, memory usage, etc.) on remote machines. Since these public resources are not usually exposed to external machines, an agent like NRPE must be installed on the remote Linux/Unix machines.</p>
<p><em>The NRPE addon consists of two pieces</em>:</p>
<p>The check_nrpe plugin, which resides on the local monitoring machine.<br />
The NRPE daemon, which runs on the remote Linux/Unix machine.</p>
<p><em>When Nagios needs to monitor a resource of service from a remote Linux/Unix machine</em>:<br />
Nagios will execute the check_nrpe plugin and tell it what service needs to bechecked.<br />
The check_nrpe plugin contacts the NRPE daemon on the remote host over an (optionally) SSL-protected connection.<br />
The NRPE daemon runs the appropriate Nagios plugin to check the service or resource.<br />
The results from the service check are passed from the NRPE daemon back to thecheck_nrpe plugin, which then returns the check results to the Nagios process.</p>
<p><strong>INSTALLATION</strong></p>
<p><em>Remote Host Setup</em>:</p>
<p>Create a new nagios user account.</p>
<blockquote><p>/usr/sbin/useradd nagios</p></blockquote>
<p>Create a directory for storing the downloads.</p>
<blockquote><p>mkdir ~/ssages<br />
cd ~/ssages</p>
<p>wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz</p></blockquote>
<p>Extract the Nagios plugins source code tarball.</p>
<blockquote><p>tar xzf nagios-plugins-1.4.11.tar.gz<br />
cd nagios-plugins-1.4.11</p></blockquote>
<p>Compile and install the plugins.</p>
<blockquote><p>./configure<br />
make<br />
make install</p></blockquote>
<p>The permissions on the plugin directory and the plugins will need to be fixed at this point, for this run the following commands.</p>
<blockquote><p>chown nagios.nagios /usr/local/nagios<br />
chown -R nagios.nagios /usr/local/nagios/libexec</p></blockquote>
<p><strong>I</strong><em><strong>nstall the NRPE daemon</strong></em>:</p>
<blockquote><p>cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nrpe-2.8.tar.gz</p>
<p>tar xzf nrpe-2.8.tar.gz<br />
cd nrpe-2.8<br />
Compile the NRPE addon.<br />
./configure<br />
make all</p></blockquote>
<p><em>Install the NRPE plugin (for testing), daemon, and sample daemon config file</em>.</p>
<blockquote><p>make install-plugin</p>
<p>make install-daemon</p>
<p>make install-daemon-config</p></blockquote>
<p>Add the following entry for the NRPE daemon to the /etc/services file.</p>
<blockquote><p>nrpe            5666/tcp# NRPE</p></blockquote>
<p>Next we add an init script for nrpe. For this,</p>
<blockquote><p>cd nrp-2.12/<br />
cp ./src/nrpe /usr/sbin/<br />
cp ./sample-config/nrpe.cfg /etc /<br />
cat init-script.in &gt; /etc/init.d/nrpe<br />
mod a+x /etc/init.d/nrpe<br />
open  the /etc/init.d/nrpe and edit<br />
NrpeBin=/usr/sbin/nrpe<br />
NrpeCfg=/usr/local/nagios/etc/nrpe.conf</p></blockquote>
<p>Then restart nrpe services</p>
<blockquote><p>/etc/init.d/nrpe restart</p></blockquote>
<p>Then edit the nrpe configuration file and allow the monitoring hoast ipaddress.</p>
<blockquote><p>allowed_hosts=ipaddress of monitoring host</p></blockquote>
<p>Next to open nrpe port in the firewall.</p>
<blockquote><p>vi  /etc/apf/conf.apf</p></blockquote>
<p>edit the follwing section and add the port number 5666</p>
<blockquote><p>IG_tcp_cports=&#8221;5666,20&#8230;&#8230;&#8230;..etc&#8221;</p></blockquote>
<p>Restart the services</p>
<blockquote><p>/etc/init.d/apf restart</p></blockquote>
<p>Make sure the nrpe daemon is running under xinetd.</p>
<blockquote><p>netstat -at | grep nrpe</p></blockquote>
<p>The output out this command should show something like this:</p>
<blockquote><p>tcp         0           0 *:nrpe    *:*          LISTEN</p></blockquote>
<p><em>Monitoring Host Setup</em></p>
<p>For monitoring remote host, you need to install nrpe plugin to the monitoring host. For this,</p>
<blockquote><p>cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nrpe-2.8.tar.gz</p>
<p>tar xzf nrpe-2.8.tar.gz<br />
cd nrpe-2.8/</p></blockquote>
<p><em>Compile the NRPE addon.</em></p>
<blockquote><p>./configure<br />
make all</p></blockquote>
<p>Install the NRPE plugin.</p>
<blockquote><p>make install-plugin</p></blockquote>
<p>Create a command definition</p>
<blockquote><p>vi /usr/local/nagios/etc/commands.cfg</p></blockquote>
<p>and add the following definition to the file:</p>
<blockquote><p>define command{<br />
command_name         check_nrpe<br />
command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br />
}</p></blockquote>
<p>You can insert each remote system services in one file. For that you have to edit the configuration file</p>
<blockquote><p>vi /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>and append the following line.</p>
<blockquote><p>cfg_file=/usr/local/nagios/etc/objects/remotehost.cfg</p></blockquote>
<p><em>Create host and service definitions</em></p>
<p>First create a new template for each different type of host you&#8217;ll be monitoring. Let&#8217;s create a new template for linux boxes.<br />
edit <em>/usr/local/nagios/etc/objects/templates.cfg</em> and add the following lines,</p>
<blockquote><p>define host{<br />
name                  linux-box             ; Name of this template<br />
use                   generic-host          ; Inherit default values<br />
check_period          24&#215;7<br />
check_interval        5<br />
retry_interval        1<br />
max_check_attempts    10<br />
check_command         check-host-alive<br />
notification_period   24&#215;7<br />
notification_interval 30<br />
notification_options  d,r<br />
contact_groups        admins<br />
register              0 ; DONT REGISTER THIS &#8211; ITS A TEMPLATE<br />
}</p></blockquote>
<p>Notice that the linux-box template definition is inheriting default values from the generic-host template, which is defined in the localhost.cfg file.</p>
<p>Next, define a new host for the remote Linux/Unix box that references the newly created linux-box host template.<br />
For this edit<em> /usr/local/nagios/etc/objects/remotehost.cfg</em></p>
<blockquote><p>define host{<br />
use       linux-box  ; Inherit default values from a template<br />
host_name remotehost  ; The name we&#8217;re giving to this server<br />
address   192.168.0.1  ; IP address of the server<br />
check_command check-host-alive<br />
}</p></blockquote>
<p>Then define contact name and contact goup name in same file</p>
<blockquote><p>define contact{<br />
contact_name clientcontact<br />
host_name remote_host<br />
use generic-contact<br />
alias Nagios client<br />
email remotehost@gmail.com<br />
}<br />
define contactgroup{<br />
contactgroup_name groupname<br />
host_name remote_host<br />
alias Nagios group<br />
members clientcontact,membersof remote_host<br />
}</p></blockquote>
<p>Now define some services to monitor the remote Linux/Unix box. These service definitions will use the commands that have been defined in the nrpe.cfg file in the remote host.</p>
<p>The following service will monitor the CPU load in the remote host. The &#8220;check_load&#8221; argument that is passed to the check_nrpe command definition tells the NRPE daemon to run the &#8220;check_load&#8221; command as defined in the nrpe.cfg file.</p>
<blockquote><p>define service{<br />
use                 generic-service<br />
host_name           remotehost<br />
service_description CPU Load<br />
check_command       check_nrpe!check_load<br />
}</p></blockquote>
<p>The following service will monitor the the number of currently logged-in users in the remote host.</p>
<blockquote><p>define service{<br />
use                         generic-service<br />
host_name                   remotehost<br />
service_description         Current Users<br />
check_command               check_nrpe!check_users<br />
}</p></blockquote>
<p>The following service will monitor the free drive space on /dev/hda1 in the remote host.</p>
<blockquote><p>define service{<br />
use                         generic-service<br />
host_name                   remotehost<br />
service_description         /dev/hda1 Free Space<br />
check_command               check_nrpe!check_hda1<br />
}</p></blockquote>
<p>The following service will monitor the total number of processes in the remote host.</p>
<blockquote><p>define service{<br />
use                        generic-service<br />
host_name                  remotehost<br />
service_description        Total Processes<br />
check_command              check_nrpe!check_total_procs<br />
}</p></blockquote>
<blockquote><p>The following service will monitor the number of zombie processes in the remote host.</p>
<p>define service{<br />
use                        generic-service<br />
host_name                  remotehost<br />
service_description        Zombie Processes<br />
check_command              check_nrpe!check_zombie_procs<br />
}</p></blockquote>
<p>The following service will monitor http status in the remote host.</p>
<blockquote><p>define service{<br />
use generic-service<br />
host_name remote_host<br />
service_description HyperVM<br />
check_command check_nrpe!check_http<br />
}</p></blockquote>
<p><em>Restarting Nagios</em>:</p>
<p>Verify your Nagios configuration files.</p>
<blockquote><p>/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>If there are errors, fix them. If everything is fine, restart Nagios.</p>
<blockquote><p>service nagios restart</p></blockquote>
<p><em>Remote Host Configuration</em>:</p>
<p>Edit the nrpe configuration file and add the folowing lines:</p>
<blockquote><p>vi /usr/local/nagios/etc/nrpe.cfg<br />
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10<br />
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20<br />
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1<br />
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z<br />
command[check_http]=/usr/local/nagios/libexec/check_http -H 127.0.0.1 -w 5 -c 10</p></blockquote>
<p><em>Restart the nrpe: </em></p>
<blockquote><p>/etc/init.d/nrpe restart</p></blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Monitoring+with+Nagios+and+NRPE+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F131" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Monitoring+with+Nagios+and+NRPE+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F131" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AIDE to aid your server security needs</title>
		<link>http://www.supportsages.com/blog/2009/04/securing-your-server-with-aide/</link>
		<comments>http://www.supportsages.com/blog/2009/04/securing-your-server-with-aide/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 13:51:16 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[AIDE]]></category>
		<category><![CDATA[Howtos]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=61</guid>
		<description><![CDATA[<strong>A note on Intrusion Detection System
</strong>An Intrusion detection system (or IDS) is a software or hardware designed to detect unwanted attempts at accessing, manipulating, and/or disabling of computer systems through a network. Some of the best IDS applications know are Snort, Untangle, Tripwire, AIDE etc. Among the simplest to configure and use is AIDE.

<strong>What is AIDE
</strong>AIDE (Advanced Intrusion Detection Environment) is an intrusion detection program. It is a free replacement for Tripwire. AIDE constructs a database of the files specified in AIDE's configuration file. The AIDE database stores various file attributes like permissions, inode number, user, group, file size, mtime ...]]></description>
			<content:encoded><![CDATA[<p><strong>A note on Intrusion Detection System<br />
</strong>An Intrusion detection system (or IDS) is a software or hardware designed to detect unwanted attempts at accessing, manipulating, and/or disabling of computer systems through a network. Some of the best IDS applications know are Snort, Untangle, Tripwire, AIDE etc. Among the simplest to configure and use is AIDE.</p>
<p><strong>What is AIDE<br />
</strong>AIDE (Advanced Intrusion Detection Environment) is an intrusion detection program. It is a free replacement for Tripwire. AIDE constructs a database of the files specified in AIDE&#8217;s configuration file. The AIDE database stores various file attributes like permissions, inode number, user, group, file size, mtime and ctime, atime, growing size, number of links and link name. AIDE also creates a cryptographic checksum or hash of each file using message digest algorithms like sha, md5, rmd160, tiger etc. Also acl, xattr and selinux can be used if enabled during compile time.</p>
<p>Initially the administrator has to create an AIDE database on a new server before it is setup for networking or business (eg hosting). This AIDE database is a summary of the system in it&#8217;s normal state.It will hold information about system binaries, libraries, header files etc that are expected to remain the same over time.</p>
<p>Suppose someone has broken-into the system, though it is easier to manipulate file dates, sizes etc, it will be quite difficult for him to manipulate cryptographic checksum like md5. Thus by rerunning AIDE after a break-in, the administrator can quickly identify changes to files with high degree of accuracy.</p>
<p><strong>AIDE Compilation</strong><br />
Some of the prerequisites (packages) for AIDE are:</p>
<ul>
<li> GCC compiler for C (gcc)</li>
<li> GNU Flex (flex)</li>
<li> GNU Bison (bison)</li>
<li> GNU Make (make)</li>
<li> Mhash library (libmhash2 and libmhash-dev)</li>
<li> PostgreSQL Development Library (postgresql-server-dev)</li>
</ul>
<p><strong>Simple instructions using Ubuntu<br />
</strong>Firstly become root by using the given command and then supplying your password:<br />
<em>sudo su -</em></p>
<p>For each prerequisite (say package gcc) search if it is installed or not by:<br />
<em>dpkg &#8211;get-selections|grep gcc</em></p>
<p>If you get:<br />
<em>gcc-4.3        install</em><br />
then gcc is installed otherwise if you get no output then it means that gcc is not installed.</p>
<p>If the package gcc is not installed then use:<br />
<em>sudo apt-get install gcc </em></p>
<p>Once all the packages are installed then download aide from sourceforge.net/projects/aide. It will be a gzipped tar archive.</p>
<p>create a folder packages and extract the tar achieve in this folder using the command:<br />
<em>tar -xzvf aide-x.xx.x.tar.gz</em> (replace x with version number)<br />
now a folder by name aide-x.xx.x will be created</p>
<p>go inside that folder by:<br />
<em>cd aide-x.xx.x</em></p>
<p>now execute:<br />
<em>./configure<br />
make<br />
make install<br />
make clean</em></p>
<p>open the aide config file and determine where the aide database is stored. Go to that location</p>
<p>To initialise the database perform:<br />
<em>aide -i</em><br />
<em>mv aide.db.new aide.db</em><br />
then to check if aide works execute:<br />
<em>aide </em></p>
<p><strong>Configuration of AIDE</strong><br />
AIDE has its config file located inside (if installed via package management software like synaptic, config file is /etc/aide/aide.conf) /usr/local/etc/aide.conf .<br />
And it&#8217;s default executable is located inside /usr/local/bin/aide.</p>
<p><strong>Explanation of the aide.conf file</strong></p>
<p><em> database=file:/var/lib/aide/aide.db<br />
</em>location of the database to be read (This is the database taken as benchmark)</p>
<p><em> database_new=file:/var/lib/aide/aide.db.comp<br />
</em>location of the database for &#8211;compare is read (This is not present by default and is used only when we have to compare two distinct databases.)</p>
<p><em> database_out=file:/var/lib/aide/aide.db.new<br />
</em>location of the database to be written</p>
<p>AIDE uses a set of rules to determine what to check for within a particular file or directory. This is found inside aide.conf. These rules are also called groups.</p>
<p>#p:      permissions<br />
#i:      inode<br />
#n:      number of links<br />
#l:      link name<br />
#u:      user<br />
#g:      group<br />
#s:      size<br />
#b:      block count<br />
#m:      mtime<br />
#a:      atime<br />
#c:      ctime<br />
#S:      check for growing size<br />
#I:      ignore changed filename<br />
#md5:    md5 checksum<br />
#sha1:   sha1 checksum<br />
#sha256: sha256 checksum<br />
#sha512: sha512 checksum<br />
#rmd160: rmd160 checksum<br />
#tiger:  tiger checksum<br />
#haval:  haval checksum<br />
#crc32:  crc32 checksum<br />
#E:        Empty group<br />
#&gt;:      Growing logfile p+l+u+g+i+n+S</p>
<p>These basic rules are then grouped to custom rules which define the collection of rules they comply to for example &#8216;pug: p+u+g&#8217; means pug supports permissions, user and group rules together. You can alse create custom rules</p>
<p>#R:      p+i+l+n+u+g+s+m+c+acl+selinux+xattrs+md5<br />
#L:      p+i+l+n+u+g+acl+selinux+xattrs<br />
#MyRule: p+i+l+n+u+g</p>
<p>The following are available if you have mhash support enabled:</p>
<p>#gost:   gost checksum<br />
#whirlpool: whirlpool checksum</p>
<p>The following are available when explicitly enabled using configure:</p>
<p>#acl:    access control list<br />
#selinux SELinux security context<br />
#xattr:  extended file attributes</p>
<p><strong>AIDE has three types of selection lines</strong></p>
<ul>
<li>Regular selection lines, beginning with &#8220;/&#8221;. This line is a file/dirctory path with or without regular expressions followed by a rule to be used here.</li>
<li>Equals selection lines, beginning with &#8220;=&#8221;. This line is followed by a path to directory/file and tells aide not to proceed the rule into any subdirectory or file.</li>
<li>Negative selection lines, beginning with &#8220;!&#8221;. This line is followed by a path to directory/file and tells aide what files/directories to ignore in database.</li>
</ul>
<p>Next we have to decide what directories/files you want in the database</p>
<p>/etc p+i+u+g     #check only permissions, inode, user and group for etc<br />
/bin MyRule      # apply the custom rule to the files in bin<br />
/sbin MyRule     # apply the same custom rule to the files in sbin<br />
/var MyRule<br />
!/var/log/.*     # ignore the log dir it changes too often<br />
!/var/spool/.*   # ignore spool dirs as they change too often<br />
!/var/adm/utmp$  # ignore the file /var/adm/utmp</p>
<p><strong>URLS that can be used</strong><br />
we have URLs in the database and database_out portion of aide.conf. These Urls can be any of the following. Input urls cannot be used as outputs and vice versa.</p>
<p>stdout</p>
<p>stderr Output is sent to stdout,stderr respectively.</p>
<p>stdin  Input is read from stdin.</p>
<p>file://filename<br />
Input is read from filename or output is written to filename.</p>
<p>fd:number<br />
Input is read from file-descriptor number or output is written to<br />
number.</p>
<p><strong>Useful Commands</strong><br />
<em>aide -C</em> : Performs a check on the filesystem ? (also same as: aide)<br />
<em>aide -i</em> : Initialises or creates the benchmark database supplied by database_out directive (here it is aide.db.new)<br />
<em>aide -u -c /etc/aide.conf</em> : update the database and use the specified config file</p>
<p><strong>Usage</strong><br />
Before putting one&#8217;s server into the network, the admin will have to save a secure configuration of the system by:<br />
<em><br />
aide -i</em></p>
<p><em>mv aide.db.new aide.db<br />
</em><br />
The second command transfers the server&#8217;s earlier state(aide.db database) with the new one(aide.db.new). So be careful when you do this. It is advisable to keep a backup of the earlier database.</p>
<p>Next time in-order to check for any break-in perform<br />
<em>aide </em><br />
or<br />
<em>aide -C</em></p>
<p>To compare the current database with some earlier backed-up database, give the path of the backed-up database to database_new option in aide.conf and perform:<br />
<em>aide &#8211;compare</em></p>
<p>The task of saving the old database and comparing with a new one has to be done periodically (preferably daily with the help of a cron task).</p>
<p><strong>Reference Links</strong></p>
<p>http://www.cs.tut.fi/~rammer/aide.html (Home Page)</p>
<p>http://sourceforge.net/projects/aide (Sourceforge Project Page)</p>
<p>http://www.cs.tut.fi/~rammer/aide/manual.html (Manual Page)</p>
<p>http://www.securityfocus.com/infocus/1424 (Reference)</p>
<p>http://www.penguin-soft.com/penguin/man/5/aide.conf.html (Reference)</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=AIDE+to+aid+your+server+security+needs+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F61" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=AIDE+to+aid+your+server+security+needs+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F61" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/securing-your-server-with-aide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

