<?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>Security Advancements at the Monastery &#187; Request Tracker</title>
	<atom:link href="http://blog.securitymonks.com/category/request-tracker/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.securitymonks.com</link>
	<description>Information about developments at the Monastery</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:41:44 +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>Interfacing with Request Tracker</title>
		<link>http://blog.securitymonks.com/2009/04/10/interfacing-with-request-tracker/</link>
		<comments>http://blog.securitymonks.com/2009/04/10/interfacing-with-request-tracker/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 23:52:22 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Request Tracker]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=996</guid>
		<description><![CDATA[Building on my previous posts, &#8220;Request Tracker Installation (Part 1 of 2)&#8221; and &#8220;Request Tracker Installation (Part 2 of 2),&#8221; today we are going to discuss how to get programs interacting with Best Practical&#8217;s Request tracker (RT).  In later posts, we will build upon this to start having our security processes log information to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bestpractical.com/images/clip_logofade.gif" align="left" width=50 />Building on my previous posts, &#8220;<a href="http://blog.securitymonks.com/2007/12/26/request-tracker-installation-part-1-of-2/">Request Tracker Installation (Part 1 of 2)</a>&#8221; and &#8220;<a href="http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/">Request Tracker Installation (Part 2 of 2)</a>,&#8221; today we are going to discuss how to get programs interacting with Best Practical&#8217;s Request tracker (<a href="http://www.bestpractical.com/rt/">RT</a>).  In later posts, we will build upon this to start having our security processes log information to RT.  Keep in mind, tickets do not need to only be done as part of a manual process.  Tickets can be generated by processes running on the system.  The tickets can also be updated by other processes.  </p>
<p><h3>The Database</h3>
<p>A few diagrams of the RT&#8217;s database schema are available:</p>
<ul>
<li><a href="http://web.mit.edu/sturner/www/rt/rtmodel.gif">Steve Turner&#8217;s Model</a></li>
<li><a href="http://bestpractical.com/rt/3.4-schema.png">The official RT 3.4 schema</a></li>
<li><a href="http://bestpractical.com/tutorial-demos/04_schema2_singleside.pdf">Jesse Vincent&#8217;s model</a> (pdf)</li>
</ul>
<p>If you are unfamiliar with some of the keys and conventions used in Visio graphs, the below table provides some helpful information. Mandatory (not null) columns are displayed in bold.
</p>
<p><table border=1>
<tr>
<td>PK</td>
<td>Primary key</td>
<td>&ndash;&ndash;&ndash;0+</td>
<td>0 or 1</td>
</tr>
<tr>
<td>FK</td>
<td>Foreign key</td>
<td>&ndash;&ndash;&ndash;0&lt;&ndash;</td>
<td>0 or more</td>
</tr>
<tr>
<td>U</td>
<td>Unique column</td>
<td>&ndash;&ndash;&ndash;++</td>
<td>Exactly 1</td>
</tr>
<tr>
<td>I</td>
<td>Indexed column</td>
<td>&ndash;&ndash;&ndash;+&lt;&ndash;</td>
<td>1 or more</td>
</tr>
<tr>
<td>O</td>
<td>Optimal columns</td>
<td></td>
<td></td>
</tr>
</table>
<p>
Further clarification can be found in chapter 8 titled &#8220;Architect&#8221; of the &#8220;<a href="http://oreilly.com/catalog/9780596006686/">RT Essentials</a>&#8221; book from O&#8217;Reilly.  Look for the section &#8220;Logical and Object Model&#8221; which takes a tour of RT&#8217;s logical and object models.
</p>
<h3>Perl Module</h3>
<p>Referring once more the the &#8220;<a href="http://oreilly.com/catalog/9780596006686/">RT Essentials</a>&#8221; book&#8217;s chapter 8 on architecture, the below diagram maps the layers involved with RT.<br />
<img src="http://my.safaribooksonline.com/getfile?item=Ni82czAvZG0wL3JnY2d0cDllL2lzODNmMGE1aXI2Lm5fZ3RpOGVsZXMxczB0aWEwc2Y-" alt="" width=500 /><br />
A quick overview of what the provide:
<ol>
<li>Allowing a database independent interface to Perl is the <a href="http://search.cpan.org/perldoc?DBI">DBI</a> module.</li>
<li><a href="http://search.cpan.org/perldoc?DBIx::SearchBuilder">DBIx::SearchBuilder</a> encapsulate SQL queries and rows in simple perl objects allowing object-oriented applications like RT to talk to a table-oriented relational database.</li>
<li>The RT application platform libraries provide database connectivity, logginng infrastructures, users, groups, access control, links, etc.  Basically it is the guts of RT.</li>
<li>The RT ticketing system libraries uses the RT application platform.</li>
<li>The Mason handler run on top of the RT core libraries and provides a wrapper around the Mason templating system.  The Mason templates consists of the user interface templates, which designed for end users to interact with their browsers, and the REST templates, which are designed to be easy for other software to interact with RT.</li>
</ol>
<p>Creating, querying, and editing tickets in an RT instance could be done by using <a href="http://wiki.bestpractical.com/view/CLI">RT Command Line Interface (CLI)</a> calls embedded in programs.  Or, one could directly plug into the RT libraries.  To maintain compatibility with future releases of RT, we will be using RT&#8217;s built in <a href="http://en.wikipedia.org/wiki/REST">REST</a> interface.</p>
<p>
Fortunately, <a href="http://search.cpan.org/~dmitri/">Dmitri Tikhonov</a> has created the <a href="http://search.cpan.org/dist/RT-Client-REST/">RT::Client::REST</a>.  If Ruby is your preferred language, Tom Lahti has cared a <a href="http://rubyforge.org/projects/rt-client">Ruby library</a> to interface with RT.
</p>
<p>
Jesse Vincent posted recently on the Best Practical blog, &#8220;<a href="http://blog.bestpractical.com/2009/03/it-should-come-as-no-suprise-to-folks-that-weve-been-hard-at-work-on--what-will-become-rt-40----weve-been-working-hard-to-o.html">RT 4 &#8211; status report</a>.&#8221;   While it will be awhile before RT4 is out, Jesse has written that &#8220;RT4 is based on Jifty and serves up both the legacy /REST/1.0 interface and Jifty&#8217;s much more <a href="http://cpansearch.perl.org/src/SARTAK/Jifty-0.80408/lib/Jifty/Plugin/REST/Dispatcher.pm">modern REST interface</a>.&#8221;  End result is  that compatibility will be maintained.
</p>
<p><h3>Perl Modules Installation</h3>
<p>Make sure to follow the instructions from &#8220;<a href="http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/">Request Tracker Installation (Part 2 of 2)</a>.&#8221;  The Perl foundation defines <a href="http://www.perlfoundation.org/perl5/index.cgi?kwalitee">kwalitee</a> as &#8220;a set of formalities that tend to coincide with quality, according to consensus.  It is of course much less useful than quality, but at least it can be measured.&#8221;  Install the Perl module <a href="http://search.cpan.org/dist/Module-CPANTS-Analyse/">Module::CPANTS::Analyse</a> and  <a href="http://search.cpan.org/dist/Test-Kwalitee/">Test::Kwalitee</a>, along with supporting modules, for quality testing.
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src root# perl -MCPAN -e 'install Module::CPANTS::Analyse'
 /usr/local/src root# perl -MCPAN -e 'install Test::Kwalitee'
</pre>
</td>
</table>
<p>
If you have read any of <a href="http://www.terrygoodkind.com/">Terry Goodkind&#8217;s</a> Sword of Truth series of books, you maybe familiar with his character Zedd saying, &#8220;<strong>If the road is easy, you&#8217;re likely going the wrong way</strong>.&#8221;  No where is this more true than in IT.  Life is made a bit easier if you check active bugs when setting up software.  Fortunately, RT-Client-REST does have an <a href="http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Client-REST">active bug listing</a>.
</p>
<p>
There is a bug involving <a href="http://rt.cpan.org/Public/Bug/Display.html?id=39868">CustomFields change in RT 3.8</a> and how RT matched on the # symbol.  RT incorrectly matched when using the REST interface because RT::Client::REST had a CustomField with a # at the end.  Jerrad Pierce has just posted that the necessary changes were mote extensive and the code should be pulled down from SVN.  We will pull the code from there. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src root# svn checkout \
     http://rt-client-rest.googlecode.com/svn/trunk/ rt-client-rest-read-only
/usr/local/src root# cd  rt-client-rest-read-only/rt-client-rest
/usr/local/src/rt-client-rest-read-only/rt-client-rest root# perl Makefile.PL
/usr/local/src/rt-client-rest-read-only/rt-client-rest root# make
/usr/local/src/rt-client-rest-read-only/rt-client-rest root# make test
/usr/local/src/rt-client-rest-read-only/rt-client-rest root# make install
</pre>
</td>
</table>
<p>
</p>
<p>
Connecting up through SSL requires a few additional steps.  make sure to install the Perl module Crypt::SSLeay.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src root# perl -MCPAN -e 'install Crypt::SSLeay'
</pre>
</td>
</table>
<p>
</p>
<p><h3>Ruby</h3>
<p>If you need to install Ruby please see my earlier post &#8220;<a href="http://blog.securitymonks.com/2008/09/29/implementing-puppet-act-one/">Implementing Puppet: Act One</a>.&#8221;  Ruby 1.9.x is a fairly significant change.  See Josh Haberman post &#8220;<a href="http://blog.reverberate.org/2009/01/31/ruby-191-released/">Ruby 1.9.1 released</a>,&#8221;  Markus Prinz post &#8220;<a href="http://blog.nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed">Ruby 1.9 &#8211; What&#8217;s new? What&#8217;s changed?</a>&#8220;, and Peter Cooper&#8217;s post &#8220;<a href="http://www.rubyinside.com/23-useful-ruby-19-links-and-resources-1498.html">23 Useful Ruby 1.9 Links and Resources</a>.&#8221;  If you are working with Ruby, you need <a href="http://pragdave.pragprog.com/">Dave Thomas</a>&#8216; book &#8220;<a href="http://www.pragprog.com/titles/ruby3/programming-ruby-1-9">Programming Ruby 1.9: The Pragmatic Programmers&#8217; Guide</a>,&#8221; which is about to be released and is available in electronic format.
</p>
<p>
When you issue the &#8220;gem install rt-client,&#8221; errors involving the TMail file <strong>tmailscanner.c</strong> will occur.  First, it was looking for header files in directory /usr/local/include/ruby-1.9.1 instead of /usr/local/include/ruby-1.9.1/ruby and complaining about &#8220;<strong>re.h: No such file or directory</strong>&#8220;.  As Zedd would say, &#8220;<strong>Nothing is ever easy</strong>.&#8221;  If you fix that problem, TMail will complain about &#8220;struct RString.&#8221;  This is a show stopper if you want to use Ruby 1.9.x.  When this gets fixed, I will try and come back and update this post.
</p>
<p><h3>Connecting Securely</h3>
<p>Modify the RT_SiteConfig.pm to use port 443.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
Before (Without SSL): Set($WebBaseURL , " http://<strong>rt.yourdomain.com</strong>");
After (With SSL): Set($WebBaseURL , " https://<strong>rt.yourdomain.com</strong>:443");
</pre>
</td>
</table>
<p>
</p>
<p>
Please change <strong>rt.yourdomain.com</strong> to the appropriate host value for your organization.
</p>
<p>
<strong>The REST Interface does not support HTTP-Authentication</strong>.  If your web server requires users to log in, you will end up with authentication problems.  As of this writing, there are <a href="http://rt.cpan.org/Public/Bug/Display.html?id=26873">problems</a> when when both authentication mechanisms are used together.  A work around, if your program is running on the same machine as the web server, is to setup a virtual host for 127.0.0.1 that does not use HTTP-Authentication.  Make sure to connections are allowed from client 127.0.0.1 only.  The outside world interface can continue to be forced to use HTTPS and HTTP-Authentication.
</p>
<p><h3>Sample Program</h3>
<p>With the supporting software in place, we can now write a program.  Below is a simple program that connects up to OpenSSL&#8217;s RT site, pulls out all new and open tickets belonging to the OpenSSL-Bugs queue, and prints out the id, subject, owner, status, and when the ticket was created.  </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
#!/usr/local/bin/perl -w

  use strict;
  use Error qw(:try);
  use RT::Client::REST;
  use Data::Dumper;

  my %Config = (
      server      => 'http://rt.openssl.org/',
      username    => 'guest',
      password    => 'guest',
      queue       => 'OpenSSL-Bugs'
  );
  my $rt = RT::Client::REST->new(
    server => $Config{server},
    timeout => 30,
  );

  try {
    $rt->login(username => $Config{username}, password => $Config{password} );
  }
  catch Exception::Class::Base with {
    die "problem logging in: ", shift->message;
  };

  my @ids;
  try {
    @ids = $rt->search(
        type    => 'ticket',
        query   => qq[
            (Status = 'new' or Status = 'open')
            and
            Queue = '$Config{queue}'
        ],
    );
  }
  catch Exception::Class::Base with {
    die "search failed", shift->message;
  };
  for my $id (@ids) {
    my $ticket = $rt->show(type => 'ticket', id => $id);
    print "ID: $id\n";
    print Dumper($ticket);
   }
</pre>
</td>
</table>
<p>
</p>
<p><h3>Final Thoughts</h3>
</p>
<p>One of the more difficult aspect of connecting several different open source projects is what to do with various versions of the software.  While it is unfortunate that we will have to wait for software to get updated on the Ruby side, we are now ready to start working with Perl.  In the next post, we will go through the steps to take a program that monitors activity and informs administrators via email, to a system that uses RT to perform this function.  By doing so, we gain operational tracking capability.  We are about to start having some fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/04/10/interfacing-with-request-tracker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RTIR:  Adding Incident Response Capabilities to RT</title>
		<link>http://blog.securitymonks.com/2008/08/07/rtir-adding-incident-response-capabilities-to-rt/</link>
		<comments>http://blog.securitymonks.com/2008/08/07/rtir-adding-incident-response-capabilities-to-rt/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 21:11:37 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[RTIR]]></category>
		<category><![CDATA[Request Tracker]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=257</guid>
		<description><![CDATA[In our last post, &#8220;Request Tracker Installation (Part 2 of 2),&#8221; we implemented Request Track (RT) on an Apache web server.  As a reminder, RT is an enterprise-grade ticketing system which allows for the checking of the status of various tasks including when the tasks were requested, who requested the tasks and why, when [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.securitymonks.com/images/IMMM.jpg"><img src="/images/IMMM_small.jpg" alt="Incident Management Mind Map Image" align="left" width=250/></a>In our last post, &#8220;<a href="http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/">Request Tracker Installation (Part 2 of 2)</a>,&#8221; we implemented <a href="http://bestpractical.com/rt/">Request Track (<strong>RT</strong>)</a> on an <a href="http://www.apache.org/">Apache</a> web server.  As a reminder, RT is an enterprise-grade ticketing system which allows for the checking of the status of various tasks including when the tasks were requested, who requested the tasks and why, when the tasks were completed, prioritizing, etc.  It was developed by the folks over at <a href="http://www.bestpractical.com">Best Practical</a>, and is the leading open-source issue tracking system.  Best Practical has also created RT for Incident Response (<strong>RTIR</strong>), which is &#8220;<em>an Open Source incident handling system designed with the needs of CERT teams and other incident-response teams in mind</em>.&#8221;  The posting &#8220;<a href="http://bestpractical.com/rtir/comparison.html">RTIR: RT for Incident Response</a>&#8221; outlines the added features of RTIR.  Today&#8217;s post will build upon the implementation of RT and will walk through the steps to implement RTIR.  </p>
<p>
Before going any further, I did want to give credit to the Doctor, who has been good enough to post over on his <a href="http://itservicemngmt.blogspot.com/2007/05/incident-management-mind-map.html">ITIL Service Management blog</a> a <a href="http://blog.securitymonks.com/2008/03/23/mind-mapping/">mind mapping</a> of the incident management process under <a href="http://en.wikipedia.org/wiki/ITIL_v3">ITIL</a>.  That mind map is the image used in today&#8217;s blog.  While it has nothing directly to do with RTIR, it is interesting in terms of incident management and I wanted to give proper credit.
</p>
<p><h3>Installation</h3>
</p>
<p>
Below are the basic steps involved with installing RTIR.  </p>
<h4><strong>1. Download and install required Perl modules.</strong></h4>
</p>
<p>
There are several Perl packages, which are dependent on other packages, and so the cycle goes.  You can install there packages using cpan, with commands like:
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src root# perl -MCPAN -e 'install Business::Hours'
 /usr/local/src root# perl -MCPAN -e 'install Net::Whois::RIPE'
</pre>
</td>
</table>
<p>
</p>
<p>
Sometimes you can run into problems installing modules in that manner.  Another alternative is to pull down the package, untar, configure, compile, and install in a manner similar to:
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://search.cpan.org/CPAN/authors/\
id/M/MR/MRSAM/Net-CIDR-0.11.tar.gz
 /usr/local/src root# tar xzf Net-CIDR-0.11.tar.gz
 /usr/local/src root# cd Net-CIDR-0.11
 /usr/local/src/Net-CIDR-0.11 root# perl Makefile.PL
 /usr/local/src/Net-CIDR-0.11root# make test
 /usr/local/src/Net-CIDR-0.11 root# make install
</pre>
</td>
</table>
<p>
</p>
<p>
To make installation of RTIR as easy as possibly, you may want to make sure the following packages are installed.
</p>
<table border=1 width="90%">
<tr>
<th width=100 align=left>Package</th>
<th width=300 align=left>File</th>
</tr>
<tr>
<td>Business::Hours</td>
<td>http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/\<br />
Business-Hours-0.07.tar.gz</td>
</tr>
<tr>
<td>Net::Whois::RIPE</td>
<td>http://search.cpan.org/CPAN/authors/id/P/PA/PAULG/<br />
Net-Whois-RIPE-1.23.tar.gz</td>
</tr>
<tr>
<td>Net::CIDR</td>
<td>http://search.cpan.org/CPAN/authors/id/M/MR/MRSAM/\<br />
Net-CIDR-0.11.tar.gz</td>
</tr>
<tr>
<td>Business::SLA</td>
<td>http://search.cpan.org/CPAN/authors/id/R/RU/RUZ/\<br />
Business-SLA-0.05.tar.gz</td>
</tr>
<tr>
<td>Regexp::Common::net::CIDR</td>
<td>http://search.cpan.org/CPAN/authors/id/R/RU/RUZ/\<br />
Regexp-Common-net-CIDR-0.02.tar.gz</td>
</tr>
<tr>
<td>Devel::Cycle</td>
<td>http://search.cpan.org/CPAN/authors/id/L/LD/LDS/\<br />
Devel-Cycle-1.10.tar.gz</td>
</tr>
<tr>
<td>PadWalker</td>
<td>http://search.cpan.org/CPAN/authors/id/R/RO/ROBIN/\<br />
PadWalker-1.7.tar.gz</td>
</tr>
<tr>
<td>Devel::Symdump</td>
<td>http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/\<br />
Devel-Symdump-2.08.tar.gz</td>
</tr>
<tr>
<td>Pod::Coverage</td>
<td>http://search.cpan.org/CPAN/authors/id/R/RC/RCLAMP/\<br />
Pod-Coverage-0.19.tar.gz</td>
</tr>
<tr>
<td>Test::Pod::Coverage</td>
<td>http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/\<br />
Test-Pod-Coverage-1.08.tar.gz</td>
</tr>
<tr>
<td>Test::Memory::Cycle</td>
<td>http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/\<br />
Test-Memory-Cycle-1.04.tar.gz</td>
</tr>
<tr>
<td>Test::Taint</td>
<td>http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/\<br />
Test-Taint-1.04.tar.gz</td>
</tr>
<tr>
<td>WWW::Mechanize</td>
<td>http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/\<br />
WWW-Mechanize-1.34.tar.gz</td>
</tr>
<tr>
<td>Test::HTTP::Server::Simple</td>
<td>http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/\<br />
Test-HTTP-Server-Simple-0.09.tar.gz</td>
</tr>
</table>
<p><h4><strong>2. Download, configure, and install RTFM.</strong></h4>
</p>
<p>
The stable RTIR package was released back to 2004, way before the most recent RT 3 release.  Pull down the most recently updated for RT 3 release of the <a href="http://www.bestpractical.com/rtfm/">RT FAQ Manager (RTFM)</a>.  To quote from the FAQ, &#8220;<em>RTFM lets you open, categorize and search for &#8216;articles.&#8217; Like RT, RTFM lets your users contribute additional information to existing articles and makes sure that each article&#8217;s full history is preserved for future inspection. RTFM makes it easy to quickly search the knowledge base and find critical information</em>.&#8221;
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://download.bestpractical.com/pub/rt/devel/\
RTIR_M3/RTFM-2.2.2.tar.gz
 /usr/local/src root# tar xzf RTFM-2.2.2.tar.gz
 /usr/local/src root# cd RTFM-2.2.2
 /usr/local/src/RTFM-2.2.2 root# perl Makefile.PL
 /usr/local/src/RTFM-2.2.2 root# make
 /usr/local/src/RTFM-2.2.2 root# make install
 /usr/local/src/RTFM-2.2.2 root# make initdb
 /usr/local/src/RTFM-2.2.2 root# cd ..
 /usr/local/src root# wget http://download.bestpractical.com/pub/rt/devel/\
RTIR_M3/RTFM-Extension-ArticleTemplates-0.01.tar.gz
 /usr/local/src root# tar xzf RTFM-Extension-ArticleTemplates-0.01.tar.gz
 /usr/local/src root# cd RTFM-Extension-ArticleTemplates-0.01
 /usr/local/src/RTFM-Extension-ArticleTemplates-0.01root# perl Makefile.PL
 /usr/local/src/RTFM-Extension-ArticleTemplates-0.01root# make
 /usr/local/src/RTFM-Extension-ArticleTemplates-0.01root# make install
 /usr/local/src/RTFM-Extension-ArticleTemplates-0.01root# cd ..
</pre>
</td>
</table>
<p>
</p>
<p><h4><strong>3. Download, configure, and install RTIR.</strong></h4>
</p>
<p>
Pull down the most recently updated for RT 3 release of RTIR.
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://download.bestpractical.com/pub/rt/devel/\
RTIR_M3/RT-IR-2.3.17.tar.gz
 /usr/local/src root# tar xzf RT-IR-2.3.17.tar.gz
 /usr/local/src root# cd RT-IR-2.3.17
 /usr/local/src/RT-IR-2.3.17 root# perl Makefile.PL
 /usr/local/src/RT-IR-2.3.17 root# make install
 </pre>
</td>
</table>
<p>
</p>
<p><h4><strong>4. Edit RT configuration file.</strong></h4>
</p>
<p>
Edit the RT configuration file /opt/rt3/etc/RT_SiteConfig.pm adding the RTIR configuration file /opt/rt3/local/plugins/RT-IR/etc/RTIR_Config.pm.
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/RT-IR-2.3.17 root#  vi /opt/rt3/etc/RT_SiteConfig.pm
</pre>
</td>
</table>
<p>
</p>
<p>
Add the lines:
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# The RTIR config file
$RTIR_CONFIG_FILE = "/opt/rt3/local/plugins/RT-IR/etc/RTIR_Config.pm";
require $RTIR_CONFIG_FILE || die ("Couldn't load RTIR config file '$RTIR_CONFIG_FILE'\n$@");
Set(@Plugins, 'RT::FM', 'RT::IR');
</pre>
</td>
</table>
<p>
</p>
<p><h4><strong>5. Initialize the database.</strong></h4>
</p>
<p>
Update the RT database.
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/RT-IR-2.3.17 root# make initdb
</pre>
</td>
</table>
<p>
</p>
<p><h4><strong>6. Stop and restart the Apache server.</strong></h4>
</p>
<p>
For good measure, restart the Apache server.
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/RT-IR-2.3.17 root# /usr/local/apache/bin/apachectl stop
 /usr/local/src/RT-IR-2.3.17 root# /usr/local/apache/bin/apachectl start
</pre>
</td>
</table>
<p>
</p>
<p><h4><strong>7. Configure RTIR.</strong></h4>
</p>
<p>
Configuration of RT and RTIR is a topic for another post; maybe even a book.  I will include below basic instructions from RTIR readme.  Please see the next section for additional documentation.</p>
<blockquote><p>
1) Using RT&#8217;s configuration interface, add the email address<br />
   of the Network Operations Team (the people who will handle<br />
   activating and removing Blocks) as AdminCC on the Blocks queue.<br />
   RT -&gt; Configuration -&gt; Queues -&gt; Blocks -&gt; Watchers</p>
<p>2) You may want to modify the email messages that are automatically<br />
   sent on the creation of Investigations and Blocks.<br />
   RT -&gt; Queues -&gt; &lt;select RTIR&#8217;s Queue&gt; -&gt; Templates.<br />
   RT -&gt; Global -&gt; Templates.</p>
<p>3) By default, RT ships with a number of global Scrips.  You should use<br />
   RT&#8217;s configuration interface to look through them, and disable any<br />
   that aren&#8217;t apropriate in your environment.<br />
   RT -&gt; Queues -&gt; &lt;/select&gt;&lt;select RTIR&#8217;s Queue&gt; -&gt; Scrips.<br />
   RT -&gt; Global -&gt; Scrips.</p>
<p>4) Add staff members who handle incidents to the DutyTeam group.<br />
   RT -&gt; Configuration -&gt; Groups -&gt; DutyTeam -&gt; Members.</p>
<p>5) You can override values in the RTIR_Config.pm in your<br />
   RT_SiteConfig.pm file. Just add your customizations after the &#8220;require&#8221;<br />
   line mentioned above.
</p></blockquote>
<h3>Additional Information</h3>
</p>
<p>
RT has a nice user interface.  In order to figure out and use the program, you need to read the documentation.  We may come back and do a post on configuration.  How you configure RTIR software depends on the environment and your plans for using the software.  Below is a listing of several information sources.</p>
<ul>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/DocIndex.pod">DocIndex.pod</a> &#8211; Can also view DocIndex.pod with the command:<br />
<strong>perldoc lib/RT/IR/DocIndex.pod</strong></li>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/AdministrationTutorial.pod">AdministrationTutorial.pod</a>  &#8211; Can also view AdministrationTutorial.pod with the command:<br />
<strong>perldoc lib/RT/IR/AdministrationTutorial.pod</strong></li>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/Config.pm">Config.pm</a> &#8211; Can also view Constituencies.pod with the command:<br />
<strong>perldoc lib/RT/IR/Config.pm</strong></li>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/Constituencies.pod">Constituencies.pod</a>  &#8211; Can also view Constituencies.pod with the command:<br />
<strong>perldoc lib/RT/IR/Constituencies.pod</strong></li>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/Ticket.pm">Ticket.pm</a> &#8211; Can also view Ticket.pm with the command:<br />
<strong>perldoc lib/RT/IR/Tutorial.pod</strong></li>
<li><a href="http://svn.bestpractical.com/cgi-bin/index.cgi/bps/view/rtir/branches/2.3-EXPERIMENTAL/lib/RT/IR/Tutorial.pod">Tutorial.pod </a> &#8211; Can also view Tutorial.pod with the command:<br />
<strong>perldoc lib/RT/IR/Tutorial.pod</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/08/07/rtir-adding-incident-response-capabilities-to-rt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Request Tracker Installation  (Part 2 of 2)</title>
		<link>http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/</link>
		<comments>http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 02:33:46 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NIST]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Request Tracker]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=211</guid>
		<description><![CDATA[Awhile back, I posted &#8220;Request Tracker Installation  (Part 1 of 2),&#8221; which provided information and additional links concerning Request Tracker (RT).  As a reminder, RT is an enterprise-grade ticketing system which allows for the checking of the status of various tasks including when the tasks were requested, who requested the tasks and why, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/opensource.jpg" alt="Open Source Installation" align="left"/>Awhile back, I posted &#8220;<a href="http://blog.securitymonks.com/category/request-tracker">Request Tracker Installation  (Part 1 of 2)</a>,&#8221; which provided information and additional links concerning <a href="http://bestpractical.com/rt/">Request Tracker (RT)</a>.  As a reminder, RT is an enterprise-grade ticketing system which allows for the checking of the status of various tasks including when the tasks were requested, who requested the tasks and why, when the tasks were completed, prioritizing, etc.  I delayed the second part of the post, which was to step through installation of RT, until I could add some background information.  I wanted to walk through implementing secure open source software such as <a href="http://www.apache.org/">Apache</a>, <a href="http://www.php.net">PHP</a>, <a href="http://www.mysql.com">MySQL</a>, <a href="http://www.openssl.org">OpenSSL</a>, and <a href="http://www.modsecurity.org">ModSecurity</a>.  No small task.  It is all about integration both in terms of security and the power that a software package like RT can provide your organization.  That is why I selected the image on the left of all these various open source software symbols for this post on RT.</p>
<p>
If you are going to be using RT, you need to get the &#8220;<a href="http://rtbook.bestpractical.com/">RT Essentials</a>&#8221; book written by Jesse Vincent, Robert Spier, Dave Rolsky, Darren Chamberlain, and Richard Foley.  It is a good reference and a quick read.  For up-to-date information, see the <a href="http://wiki.bestpractical.com/view/HomePage">RT Wiki</a> and the <a href="http://blog.bestpractical.com/">Best Practical Solutions blog site</a>.
</p>
<p><h3>Prerequisites</h3>
<p>To start, please review the following posts:</p>
<ol>
<li><a href="http://blog.securitymonks.com/2008/04/14/an-apache-implementation/">An Apache Implementation</a>
	</li>
<li><a href="http://blog.securitymonks.com/2008/04/24/apache-and-openssl/">Apache and OpenSSL</a></li>
<li><a href="http://blog.securitymonks.com/2008/04/21/php-implementation/">PHP Implementation</a></li>
<ul>
<li><a href="http://blog.securitymonks.com/2008/04/21/php-as-a-module/">PHP as a Module</a></li>
<li><a href="http://blog.securitymonks.com/2008/04/21/php-as-a-cgi/">PHP as a CGI</a></li>
<li><a href="http://blog.securitymonks.com/2008/04/21/php-configuration-modifications/">PHP Configuration Modifications</a></li>
</ul>
<li><a href="http://blog.securitymonks.com/2008/04/07/introduction-to-mysql/">Introduction to MySQL</a></li>
<li><a href="http://blog.securitymonks.com/2008/02/28/setting-up-and-securing-mysql-references/">Setting Up and Securing MySQL: References</a></li>
<li><a href="http://blog.securitymonks.com/2008/07/31/implementing-a-web-application-firewall-with-modsecurity/">Implementing a Web Application Firewall with ModSecurity</a></li>
</ol>
<h3>Install Software</h3>
<p>With Apache, MySQL, PHP, OpenSSL, and ModSecurity installed, we are now ready to focus on software packages required by RT.</p>
<h4><strong>1.  Installing <a href="http://expat.sourceforge.net/">expat</a>.</strong></h4>
<p>Different operating systems will vary on whether <a href="http://expat.sourceforge.net/">expat</a>, the XML parser, is installed.  Expat is needed to complete the cpan install for <a href="http://perl-rss.sourceforge.net/">XML::RSS</a>.  Check your particular operating system.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://downloads.sourceforge.net/expat/expat-2.0.1.tar.gz
 /usr/local/src root# tar xzf expat-2.0.1.tar.gz
 /usr/local/src root# cd expat-2.0.1
 /usr/local/src/expat-2.0.1 root# ./configure
 /usr/local/src/expat-2.0.1 root# make
 /usr/local/src/expat-2.0.1 root# make check
 /usr/local/src/expat-2.0.1 root# make install
</pre>
</td>
</table>
<p></p>
<h4><strong>2.  Install FastCGI</strong></h4>
<p>For RT, you can install <a href="http://perl.apache.org/">mod_perl</a> or <a href="http://www.fastcgi.com/">mod_fastcgi</a>.  In this posting, we are going to walks through the installation of FastCGI.  Information concerning mod_perl will be provided below so the reader can chose what fits best in their environment.  FastCGI is much simpler to install and allows the core Apache process to stay small in size.  With FastCGI, RT runs as a separate process from Apache allowing RT to be stopped and restarted without affecting the Apache server.  In general, FastCGI programs are easier to manage.
</p>
<p>
The Apache module mod_fastcgi allows a web server to run CGI scripts via a separate, persistent program.  PHP comes with FastCGI support compiled in by default, so nothing needs to be done to the PHP installation.
</p>
<p>
You can have the Apache program call FastCGI, and have it run as the same user as the Apache server or use suexec to have FastCGI switch to a different user.  Under some operating systems, suexec may not get compiled and installed when installing Apache.  Check if suexec is installed, and if not go back to the Apache source, compile it, and install it.  Initially, we are not going to use the suexec program.  Instead we will create the group &#8220;rt&#8221;, add user httpd to group rt, and set permissions that way.  You may choose later to use suexec.  </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# ls -la /usr/local/apache/bin/suexec
ls: /usr/local/apache/bin/suexec: No such file or directory
 root# cd /usr/local/src/httpd-2.2.8
 /usr/local/src/httpd-2.2.8 root# make suexec
 /usr/local/src/httpd-2.2.8 root# cp ./support/suexec /usr/local/apache/bin/suexec
</pre>
</td>
</table>
<p>
Now, we are ready to get mod_fastcgi installed.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
 /usr/local/src root# tar xzf mod_fastcgi-2.4.6.tar.gz
 /usr/local/src root# cd mod_fastcgi-2.4.6
 /usr/local/src/mod_fastcgi-2.4.6 root# cp Makefile.AP2 Makefile
 /usr/local/src/mod_fastcgi-2.4.6 root# make top_dir=/usr/local/apache
 /usr/local/src/mod_fastcgi-2.4.6 root# make top_dir=/usr/local/apache install
 /usr/local/src/mod_fastcgi-2.4.6 root# /usr/local/apache/bin/apachectl stop
 /usr/local/src/mod_fastcgi-2.4.6 root# vi /usr/local/apache/conf/httpd.conf
</pre>
</td>
</table>
<p>
Add the following lines to the Apache httpd.conf file:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# Load the mod_fastcgi module.
LoadModule fastcgi_module modules/mod_fastcgi.so
</pre>
</td>
</table>
<p>
Check if installation and configuration is working.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/mod_fastcgi-2.4.6 root# /usr/local/apache/bin/apachectl configtest
Syntax OK
 /usr/local/src/mod_fastcgi-2.4.6 root# /usr/local/apache/bin/apachectl start
 /usr/local/src/mod_fastcgi-2.4.6 root# cat /var/www/logs/error_log | grep -i fastcgi
[Fri Aug 01 12:17:22 2008] [notice] FastCGI: process manager initialized (pid 15221)
[Fri Aug 01 12:17:22 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8
OpenSSL/0.9.7a mod_fastcgi/2.4.6 configured -- resuming normal operations
</pre>
</td>
</table>
<p>
For in depth coverage of mod_perl, <a href="http://stason.org/">Stas Bekman</a> and <a href="http://www.oreillynet.com/pub/au/999">Eric Cholet</a> have written the book, &#8220;<a href="http://modperlbook.org/">Practical mod_perl</a>.&#8221;  They have made the complete book available online in both <a href="http://modperlbook.org/html/index.html">HTML</a> and <a href="http://modperlbook.org/pdf/index.html">PDF</a> format under the <a href="http://creativecommons.org/">Creative Commons</a> Attributes Share-Alike License.  <a href="http://stason.org/">Stas Bekman</a> and <a href="http://www.onyxneon.com/people/jim_brandt.html">Jim Brandt</a> have also written the &#8220;<a href="http://www.amazon.com/gp/product/0977920119?ie=UTF8&#038;tag=theultimatlearna&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0977920119">mod_perl2 User&#8217;s Guide Book</a>&#8221; where 50% of the book&#8217;s proceeds go to <a href="http://www.perlfoundation.org/">The Perl Foundation</a>.
</p>
<p>
If you are installing under Mac OS X, mod_perl may complain about Perl 5.8.8 being built without threads and you will get a message about building perl with -Duserthreads.  If you are determined to use mod_perl, consider dropping back to Apache 1.3.x and using mod_perl 1.x.  While Apache 1.3.x is legacy code, and I tend to want to use the code that is being actively developed, there is an argument for using Apache 1.3.x.  One major feature of Apache 2.x is threading. On Windows, where most basic libraries are and must be threadsafe, Apache 2 is really the only choice.  <a href="http://search.cpan.org/~nwclark/perl-5.8.8/README.macosx">Earlier Mac OS X</a> releases did not include a completely thread-safe libc, so threading is still not fully supported in Perl.  This is why the Perl version that comes with Mac OS X is not compiled to use threads.  To use  Apache2.x, Perl will need to be configured to use threads.  The code is available from the <a href="http://www.perl.com/download.csp">Perl web site</a>.
</p>
<p>
Rather than getting bogged down in compiling Perl to use thread, we will move ahead and use FastCGI.  By the time this post, I will have worked on getting RT installed under Linux, Mac OS X, and FreeBSD.  Figuring out what software works best in a multi OS environment can be challenging.  </p>
<h4><strong>3. Configure RT</strong></h4>
<p>Let us start by adding the group RT.  Under many operating systems, this would be done with the simple command &#8220;<strong>groupadd rt</strong>.&#8221;  Things are always more interesting under Mac OS X, where you would have to first look at what group ids (gid), choose an unused gid, and then create the rt group using that gid.  Under Mac OS X Leopard, group rt would be created with the commands:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# dscl . list /groups PrimaryGroupID | sort -k 2,2 -n
 root# dscl . create /groups/rt gid gid-of-rt
 root# dscl . create /groups/rt passwd '*'
 root# dscl . read /groups/rt
AppleMetaNodeLocation: /Local/Default
Password: *
PrimaryGroupID: gid-of-rt
RecordName: rt
RecordType: dsRecTypeNative:groups
</pre>
</td>
</table>
<p>
RT&#8217;s primary maintenance and documentation site is <a href="http://www.bestpractical.com">http://www.bestpractical.com</a>.   Documentation can be found at the Best Practical Solutions RT Wiki located at <a href="http://wiki.bestpractical.com/view/HomePage">http://wiki.bestpractical.com/</a>. The latest TAR/GZ is located at <a href="http://download.bestpractical.com/pub/rt/release/rt.tar.gz">http://download.bestpractical.com/pub/rt/release/rt.tar.gz</a>. The lack of any version numbers means the version can be updated at any time. The latest version, as of this writing, is 3.8.0.
</p>
<p>
The following are the steps for downloading and configuring RT:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
 /usr/local/src root# wget http://download.bestpractical.com/pub/rt/release/rt.tar.gz
 /usr/local/src root# tar xzf rt.tar.gz
 /usr/local/src root# cd rt-3.8.0
 /usr/local/src/rt-3.6.5 root# ./configure \
  --with-web-user="httpd" \
  --with-web-group="httpd" \
  --with-rt-user="httpd" \
  --with-rt-group="rt"
</pre>
</td>
</table>
<p></p>
<h4><strong>4.  Install Apache::TEST</strong></h4>
<p>Perl module Apache::TEST will not allow you to run the test check as root. You can download the module separately as a non root user and after configuring, compiling, and testing the program, you install it as root.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# su - goofy
 ~$ cd src
 ~/src goofy$ wget http://search.cpan.org/CPAN/authors/id/P/PH/PHRED/Apache-Test-1.30.tar.gz
 ~/src goofy$ tar xzf Apache-Test-1.30.tar.gz
 ~/src goofy$ cd Apache-Test-1.30
 ~/src goofy$ perl Makefile.PL
 ~/src goofy$ make
 ~/src goofy$ make test
 ~/src goofy$ sudo su root
 root# make instal
</pre>
</td>
</table>
<p></p>
<h4><strong>5.  Run fixdeps Command and Install Perl Modules</strong></h4>
<p>Now you are ready to utilize the <strong>fixedeps</strong> utility that comes with RT to install required Perl modules.  There is also the <strong>testdeps</strong> utility to test if all dependencies are installed and RT is ready to be installed.  You may need to run fixdeps multiple times before testdeps reports that you have all required software packages.  The first time through, it can take awhile (depending on your installation).  Be aware that some perl modules may need to be installed manually.  It various depending on OS and your environment.  You will be able to tell which modules need manual installation by the final message provided by the fixdeps program.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src/rt-3.8.0
 /usr/local/src/rt-3.8.0 root# make fixdeps
 /usr/local/src/rt-3.8.0 root# make fixdeps
 /usr/local/src/rt-3.8.0 root# make testdeps
</pre>
</td>
</table>
<p></p>
<h4><strong>6.  Install RT</strong></h4>
</p>
<p>
The final installation of RT is the easy part.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# make install
</pre>
</td>
</table>
<p></p>
<h4><strong>7.  Configure RT_SiteConfig.pm</strong></h4>
<p>We now will configure /opt/rt3/etc/RT_SiteConfig.pm.  In the next step a database user and a database will be setup.  We are only adding those values to the configuration file in this step.  I am going to set up a hostname (rt.securitymonks.com) for my current machine.  Please do not copy blindly.  Change this to your environment.  We will create the hostname so it only exists locally by adding an entry into the machines /etc/hosts file.  Right now, I am only going to access the Apache server from this machine.  In other words, the client and server will be on the same box.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# vi /etc/hosts
</pre>
</td>
</table>
<p>
Add the following line, adapting it to your organization:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# vi /etc/hosts
##
127.0.0.1       localhost
10.1.218.202   rt.securitymonks.com
</pre>
</td>
</table>
<p>
We are now ready to modify the RT_SiteConfig.pm file.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# vi /opt/rt3/etc/RT_SiteConfig.pm
</pre>
</td>
</table>
<p>
At minimum, add the following linesto /opt/rt3/etc/RT_SiteConfig.pm:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
Set($rtname, 'BRORT');
Set($Organization, 'securitymonks');

Set($CorrespondAddress , 'john@securitymonks.com');
Set($CommentAddress , 'john@securitymonks.com');

Set($Timezone , 'US/Eastern'); # obviously choose what suits you

# THE DATABASE:

Set($DatabaseType, 'mysql'); # e.g. Pg or mysql

# These are the settings we used above when creating the RT database,
# you MUST set these to what you chose in the section above.

Set($DatabaseUser , 'rtuser');
Set($DatabasePassword , 'secret');
Set($DatabaseName , 'rtdb');

# THE WEBSERVER:

Set($WebPath , '');
Set($WebBaseURL , 'https://rt.securitymonks.com');

# Logging
Set($LogToSyslog, '');
Set($LogToFile, 'debug');
Set($LogDir, '/opt/rt3/var/log');
Set($LogToFileNamed, "rt.log");
</pre>
</td>
</table>
<p></p>
<h4><strong>8.  Initialize the Database</strong></h4>
<p>RT needs to create the rtdb database, the rt db users, and initialize some tables.  This can be done with the command <strong>initialize-database</strong>, which should be run only once.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# make initialize-database
 /usr/local/bin/perl sbin/rt-setup-database --action init --dba root --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your mysql
instance on localhost as root.  Please specify that user's database password below. If the
user has no database

password, just press return.

Password:
Working with:
Type:   mysql
Host:   localhost
Name:   rtdb
User:   rtuser
DBA:    root
Now creating a mysql database rtdb for RT.
Done.
Now populating database schema.
Done.
Now inserting database ACLs
Granting access to rtuser@'localhost' on rtdb.
Done.
Now inserting RT core system objects
Done.
Now inserting data
Done inserting data
Done.
</pre>
</td>
</table>
<p>
Check the MySQL database out.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# mysql -u rtuser -p
mysql> use rtdb;
</pre>
</td>
</table>
<p>
</p>
<h4><strong>9.  Modify Apache Configuration File</strong> </h4>
<p>Edit the /usr/local/apache/conf/httpd.conf file.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# /usr/local/apache/bin/apachectl stop
 /usr/local/src/rt-3.8.0 root# vi /usr/local/apache/conf/httpd.conf
</pre>
</td>
</table>
<p>
We are going to have the RT server run under our secure web server.  Find the &#8220;<strong>&#60virtualhost _default_:443&#62</strong>&#8221; line, change it to &#8220;<strong>&#60virtualhost 10.1.218.202:443&#62</strong>&#8220;.  Add the following lines to that section (adjusting to your environment):</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
   ServerName rt.securitymonks.com
   DocumentRoot /opt/rt3/share/html
   ErrorLog /usr/local/apache/logs/rt.error
   LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
   CustomLog /usr/local/apache/logs/rt.access_log combined
   AddHandler fastcgi-script fcgi
   ScriptAlias / /opt/rt3/bin/mason_handler.fcgi/
</pre>
</td>
</table>
<p>
Add the user the Apache server runs as (httpd by default), to the RT group.  For non Mac OS X, modify group membership by editing the file /etc/group (<strong>vi /etc/group</strong>).  Mac OS X users need to user the dscl command.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# dscl . append /groups/rt GroupMembership httpd
 root# dscl . read /groups/rt
</pre>
</td>
</table>
<p>
Change the group and permission on the log area if you have told RT to log to /opt/rt3/var/log. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# chgrp rt /opt/rt3/var/log
 root# chmod g+w /opt/rt3/var/log
</pre>
</td>
</table>
<p>
Test the configuration of the file, and if everything checks out start up Apache. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/src/rt-3.8.0 root# /usr/local/apache/bin/apachectl configtest
Syntax OK
 /usr/local/src/rt-3.8.0 root# /usr/local/apache/bin/apachectl start
</pre>
</td>
</table>
<p>
 Remember there are now three files to check for problems with RT.
<ul>
<li>/opt/rt3/var/log/rt.log</li>
<li>/usr/local/apache/logs/rt.error</li>
<li>/usr/local/apache/logs/rt.access_log</li>
</ul>
<p>There are many configuration operations.  The options chosen in this post represents only the minimal to get RT running.  Please see the <a href="http://wiki.bestpractical.com/view/FastCGIConfiguration">RT Wiki&#8217;s FastCGIConfiguration</a> page for additional information.</p>
<h4><strong>10.  Access RT and Change the Default Password</strong> </h4>
<p><a href="http://blog.securitymonks.com/images/RT_login.jpg"><img align="left" width="150" title="ModifyUserImage" src="/images/RT_login.jpg"/></a>Now it is time to log in and change the default password.  Using the entry we made in our /etc/hosts file, we can now access the site by going to <strong>https://rt.securitymonks.com</strong>.  This URL should be different for your site.  You will see a login screen similar to the image on the left.</p>
<p>
Log in using the username &#8220;<strong>root</strong>&#8221; and password &#8220;<strong>password</strong>&#8220;.  Once logged in, you will see the screen similar to the image below (click on the image if you need to enlarge):<br />
<a href="http://blog.securitymonks.com/images/RT_ataglance.jpg"><img width="400" title="RT_at_a_glance" src="/images/RT_ataglance.jpg"/></a><br />
Over on the left menu bar, select &#8220;<strong>Configuration</strong>.&#8221;  That will bring you to the &#8220;RT Administration&#8221; screen:<br />
<a href="http://blog.securitymonks.com/images/RT_Administration.jpg"><img width="200" title="RT_administration" src="/images/RT_Administration.jpg"/></a><br />
Select, &#8220;<strong>Users</strong>.&#8221;  That will bring you to the &#8220;Select a user&#8221; screen:<br />
<a href="http://blog.securitymonks.com/images/RT_selectauser.jpg"><img width="300" title="RT_Select_a_User" src="/images/RT_selectauser.jpg"/></a><br />
Select the user &#8220;<strong>root</strong>,&#8221; which will bring you to the &#8220;Modify the user root&#8221; screen.  If you look at the lower left of the screen, there is a &#8220;Access Control area.&#8221;  There is a place to enter &#8220;New Password.&#8221;  Do so.  The screen looks like:<br />
<a href="http://blog.securitymonks.com/images/RT_modifyauser.png"><img width="200"  title="RT_Modify" src="/images/RT_modifyauser.png"/></a><br />
Make sure to hit the &#8220;Save Changes&#8221; button at the bottom of the screen.  With a working copy of RT, you are not ready to start adjusting configurations and working with the program.  For additional information, Please check out the “<a href="http://rtbook.bestpractical.com/">RT Essentials</a>” and the <a href="http://wiki.bestpractical.com/view/HomePage">RT Wiki</a> and the Best Practical Solutions <a href="http://blog.bestpractical.com/">blog site</a>.  Look for future posts to build upon the RT installation and database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/08/03/request-tracker-installation-part-2-of-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Request Tracker Installation  (Part 1 of 2)</title>
		<link>http://blog.securitymonks.com/2007/12/26/request-tracker-installation-part-1-of-2/</link>
		<comments>http://blog.securitymonks.com/2007/12/26/request-tracker-installation-part-1-of-2/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 04:06:25 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Request Tracker]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2007/12/26/request-tracker-installation-part-1-of-2/</guid>
		<description><![CDATA[&#8220;The only reason for time is so that everything doesn&#8217;t happen at once.&#8221;
&#8211; Albert Einstein

I wanted to write some notes on the installation of Request Tracker (RT); one man&#8217;s experience.  So everything does not happen at once, I am splitting the posting between need to know links before starting and step-by-step installation instructions.

Let me [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<em><a href="http://www.quotedb.com/quotes/2309">The only reason for time is so that everything doesn&#8217;t happen at once</a></em>.&#8221;<br />
&#8211; <a href="http://www.quotedb.com/authors/albert-einstein">Albert Einstein</a></p>
<p>
<img src="/images/opensource.jpg" alt="Open Source Installation" align="left"/>I wanted to write some notes on the installation of <a href="http://www.bestpractical.com/rt/">Request Tracker (RT)</a>; one man&#8217;s experience.  So everything does not happen at once, I am splitting the posting between need to know links before starting and step-by-step installation instructions.
</p>
<p>Let me start off by address what is RT?  RT is an enterprise-grade ticketing system which allows for the checking of the status of various tasks.  This includes when the tasks were requested, who requested the tasks and why, when the tasks were completed, prioritizing, assigning, notification, etc.  RT is an open source ticketing system enabling a group of people to manage tasks, issues, and requests submitted by a community of users.  RT has interfaces for command-line, e-mail, IRC and the Web.  RT audits all of its operations in a database, making it portable and expandable should the project management tasks grow beyond the capacity of the initial installation machine.  Being an issue tracking system at the core, RT is a flexible tool capable of performing tasks unrelated to project management.  It can be used as a public task list, an administrative task manager and journal, or a help desk tool (many companies use RT just for help desk issues).
</p>
<p>
Best Practical has two additional open source packages that may be of interest for integration with RT:</p>
<ul>
<li><a href="http://www.bestpractical.com/rtfm/">The RT FAQ Manager (RTFM)</a> is a knowledge management tool that enables an organization to easily capture and share its employees&#8217; knowledge and wisdom. Where RT tracks issues, RTFM tracks articles.</li>
<li><a href="http://www.bestpractical.com/rtir/">RT for Incident Response (RTIR)</a> is the premiere open-source incident-handling system, designed with the needs of CERT teams and incident-response teams in mind. It makes IR tasks easier and lets you solve your problems more efficiently.</li>
</ul>
<p><h2>Sources</h2>
<p>There were a few sources very helpful with the installation process.  First, the book, &#8220;<a href="http://www.oreilly.com/catalog/rtessentials/">RT Essentials</a>&#8221; by <a href="http://www.perlfoundation.org/perl5/index.cgi?dave_rolsky">Dave Rolsky</a>; <a href="http://www.oreillynet.com/pub/au/1225">Darren Chamberlain</a>; <a href="http://www.rfi.net/">Richard Foley</a>; <a href="http://www.fsck.com/">Jesse Vincent</a>; <a href="http://blog.rbrt.com/">Robert Spier</a>.  There is also the <a href="http://wiki.bestpractical.com/view/InstallationGuides">RT Installation Guides</a> available from the <a href="http://www.bestpractical.com">Best Practical Solution website</a>.  The Wiki will provide up-to-date installation instructions for the various operating systems.  Finally the article &#8220;<a href="http://www.ibm.com/developerworks/edu/wa-dw-wareqtrack-i.html?ca=drs-">Zen and the art of installing Request Tracker 2.0.x</a>&#8221; by <a href="http://www.linkedin.com/in/jessetilly">Jesse Tilly</a>.  Unfortunately you do have to register to get the guide and it is a little dated.  Still, Jesse manages to make the installation of RT interesting.  Plus, any article with &#8220;Zen&#8221; in the title always requires a look.
</p>
<p><h2>Requirements and Resources</h2>
<p>Below are a few publicly accessible resources, courtesy of Jesse Tilly.  Any mistakes are on me, since I am editing, updating, and combing information:</p>
<ul>
<li>
                <b>RT: </b> RT&#8217;s latest release is available at <a href="http://www.bestpractical.com/rt/download.html">http://www.bestpractical.com/rt/download.html</a>. </p>
<ul>
<li>RT&#8217;s Wiki. <a href="http://wiki.bestpractical.com/view/HomePage">http://wiki.bestpractical.com/view/HomePage</a>
                    </li>
<li>RT-devel mailing list (good place to check on in-progress features and fixes, especially to check on WinRT). <a href="http://lists.bestpractical.com/pipermail/rt-devel/">http://lists.bestpractical.com/pipermail/rt-devel/</a>
                    </li>
<li>RT-user mailing list (good for help with special installation instructions and user issues). <a href="http://lists.bestpractical.com/pipermail/rt-users/">http://lists.bestpractical.com/pipermail/rt-users/</a>
                    </li>
</ul>
<p></li>
<li>
                <b>Perl, Perl Modules and CPAN: </b> RT is intrinsically tied to the Perl platform, so it could help your understanding of RT to understand Perl a bit better.  For RT 3.0.0 and greater you need <strong>Perl 5.8.3 or newer</strong>.</p>
<ul>
<li>Perl&#8217;s home (which uses RT for issue tracking). <a href="http://www.perl.org/">http://www.perl.org/</a>
                    </li>
<li><a href="http://cpan.org/">The Comprehensive Perl Archive Network (CPAN)</a> is a core part of Perl programming. A tool is included with RT which takes care of the installation of most of the Perl modules automatically.  The tool supplied with RT uses Perl&#8217;s CPAN system to install modules.
                    </li>
<li>A good introduction on modules, found at the CPAN site. <a href="http://cpan.org/modules/00modlist.long.html#Introduction">http://cpan.org/modules/00modlist.long.html#Introduction</a>
</li>
</ul>
<p></li>
<li>
                <b>Web Server: </b> Apache sits at the core of many Web-driven applications. With regards to RT, Apache&#8217;s primary application is its Perl modules, giving RT a Web-based front end.  You can chhose to user another webserver, but it must have <a href="http://wiki.bestpractical.com/view/FastCGI">FastCGI</a> support.</p>
<ul>
<li>Apache&#8217;s home. <a href="http://www.apache.org">http://www.apache.org</a></li>
<li>mod_perl&#8217;s home. <a href="http://perl.apache.org/">http://perl.apache.org/</a>  The mod_perl project has two major stable releases: mod_perl 1.x and mod_perl 2.x.
<ul>
<li>mod_perl 1.x is supported release, but this mean you <strong>must use Apache 1.3.x</strong>, because mod_perl 1.x works only with Apache 1.3.x. mod_perl 1.x must be built with <code>EVERYTHING=1</code> option (most distribution packages have this option on). For an excerpt, see <a href="./ManualApache">ManualApache</a>.
</li>
<li>RT development team <strong>does not recommend</strong> using development 1.9x versions, because of development status. Also mod_perl 2.x was released and it&#8217;s stable branch of the 1.9x development versions, so you wouldn&#8217;t get much support from mod_perl users and developers if you use mod_perl 1.9x. RT-3.4.4 and greater <strong>doesn&#8217;t work</strong> with development 1.9x releases.
</li>
<li>mod_perl 2.0 has been released with major API-changes in mod_perl 2.0-RC3 which lead to incompatibities that also affect RT, see this <a href="http://lists.bestpractical.com/pipermail/rt-users/2005-April/030477.html">mailing-list message</a>.  So RT-3.4.3 or any prior versions is <strong>totally unsupported</strong> on mod_perl 2.x.</li>
<li>mod_perl 2.x has been <strong>marked as supported</strong> in RT 3.4.4. There is no mentioning of incomplete support in any way. See this <a href="http://www.gossamer-threads.com/lists/rt/announce/48184">mailing list message</a>.  If you experience issues getting mod_perl 2.x+apache 2.x up and running, consider using apache 1.3.x + mod_perl 1.x or <a href="./FastCGI">FastCGI</a> instead.</li>
</ul>
</li>
</ul>
<p></li>
<li>
                <b>Database backend: </b>RT stores data in a database.  Generally, the locations I have worked at use MySQL, though there is interest in evaluating PostgreSQL.  </p>
<ul>
<li><a href="http://www.mysql.com/">MySQL 4.0.18</a> or later with support for <a href="http://wiki.bestpractical.com/view/InnoDB">InnoDB</a>.</li>
<li><a href="http://www.postgresql.org/">PostgreSQL</a> 7.4 or later.
                    </li>
</ul>
<p></li>
<li>
<p>                <b>Sendmail and sendmail configuration and administration: </b> The key here is to realize that RT uses mail aliases on its host&#8217;s configured mail server to route commands through e-mail. As long as your MTA supports these type of aliases, you are fine. </p>
<ul>
<li>sendmail&#8217;s home. <a href="http://www.sendmail.org">http://www.sendmail.org</a>
                </li>
</ul>
<p></li>
<li>
                <b>Configuration management: </b> These articles, books and tools can help you build your own CM process.</p>
<ul>
<li>&#8220;Software Release Methodology&#8221; by Michael E. Bays, ISBN: 0136365647</li>
<li>&#8220;Automating the Build Process&#8221; by Aspi Havewala, Dr. Dobb&#8217;s Journal, issue: August 2000</li>
<li>CVS, Revision Control System <a href="http://cvshome.org">http://cvshome.org</a>
                    </li>
<li>Aegis Configuration Management Tool (like cvs) <a href="http://aegis.sourceforge.net/">http://aegis.sourceforge.net/</a>
                    </li>
<li>Subversion, yet another CVS replacement <a href="http://subversion.tigris.org/">http://subversion.tigris.org/</a>
                    </li>
<li>Scarab, an issue tracking system, like RT (it is useful to compare) <a href="http://scarab.tigris.org/">http://scarab.tigris.org/</a>
                    </li>
<li>GNU Make, <b>the</b> build engine of the open source world <a href="http://www.gnu.org/software/make/make.html">http://www.gnu.org/software/make/make.html</a>
                    </li>
<li>Jakarta Ant, <b>the</b> build engine of the <i>Java</i> open source world <a href="http://jakarta.apache.org/ant">http://jakarta.apache.org/ant</a>
                    </li>
<li>Add more automation to your project with the code generation tool, <a href="http://swang.sourceforge.net">Swang</a> (http://swang.sourceforge.net).</li>
</ul>
<p></li>
</ul>
<p>
I am going to end here and leave the installation instruction for a follow up post.  Installation under FreeBSD is fairly straight forward.  I ran into a snag with the installation under Mac OS X.  Under Mac OS X, when you try to configure mod_perl 2.0.3, it will complain about Perl 5.8.8 being built without threads and tell you to build Perl with -Duserthreads.  One solution is dropping back to Apache 1.3.x and mod_perl 1.x.  While Apache 1.3.x is legacy code, and I tend to want to use the code that is being actively developed, there is an argument for using Apache 1.3.x.  A major feature of Apache 2.x is threading. On Windows, where most basic libraries are and must be threadsafe, Apache 2 is really the only choice.  <a href="http://search.cpan.org/~nwclark/perl-5.8.8/README.macosx">Earlier Mac OS X</a> releases did not include a completely thread-safe libc, so threading is still not fully supported in Perl.  This is why the Perl version that comes with Mac OS X is not compiled to use threads.  Before posting the second half of this blog, I want to split the post between installation instructions for FreeBSD and Mac OS X.  I also plan on revisiting the installation of RT under Mac OS X. In case the above explanation and links can be of assistance to anyone interested in installing Request Tracker, I wanted to publish the first half of this posting.  Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2007/12/26/request-tracker-installation-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

