<?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; OpenSSL</title>
	<atom:link href="http://blog.securitymonks.com/category/openssl/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>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>Scanner for Debian OpenSSL Vulnerability</title>
		<link>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/</link>
		<comments>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/#comments</comments>
		<pubDate>Thu, 22 May 2008 23:31:46 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/</guid>
		<description><![CDATA[By now, you likely have heard about the Debian OpenSSL Vulnerability, found by Luciano Bello.  It was originally announced on May 13th.  What occurred is that code was removed because it caused the Valgrind and Purify tools to produce warnings about the use of uninitialized data in code that was linked to OpenSSL. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://images.eztools.com/?c=todas&#038;q=hackers"><img src="/images/hackers.jpg" alt="Vulnerability" width=150 align="left" /></a>By now, you likely have heard about the <a href="http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-0166">Debian OpenSSL Vulnerability</a>, found by Luciano Bello.  It was originally announced on May 13th.  What occurred is that code was removed because it caused the <a href="http://valgrind.org">Valgrind</a> and Purify tools to <a href="http://rt.openssl.org/Ticket/Display.html?id=521&#038;user=guest&#038;pass=guest">produce warnings</a> about the use of uninitialized data in code that was linked to OpenSSL.  This change caused only the current process ID to be used for the initial seed, crippling the seeding process for the OpenSSL <a href="http://statmath.wu-wien.ac.at/prng/">PRNG</a>.  To quote the <a href="http://nvd.nist.gov">National Vulnerability Database (NVD)</a>:<br />
<blockquote>OpenSSL 0.9.8c-1 up to 0.9.8g-9 on Debian-based operating systems uses a random number generator that generates predictable numbers, which makes it easier for remote attackers to conduct brute force guessing attacks against cryptographic keys.</p></blockquote>
<p>
Hubert Seiwert, Internet Security Specialist at Westpoint Ltd., released <a href="http://itsecurity.net/">debian_ssh_scan.py</a> on May 16th.  The code does remote check for weak Debian sshd host keys as identified in <a href="http://www.debian.org/security/2008/dsa-1571">CVE-2008-0166</a>.  The fingerprints are taken from keys generated by HD Moore&#8217;s <a href="http://metasploit.com/users/hdm/tools/debian-openssl/">common and uncommon keys</a>.  Mr. Seiwert also used Justin Azoff&#8217;s multi-threading code.  While it is not the only scanner, Mr. Seiwert did a very nice job.
</p>
<p>
For those who might be less familiar with <a href="http://www.python.org">Python</a>, I thought I would walk through getting debian_ssh_scan.py installed.  Most distributions of Linux and Unix have Python installed and with a few additional steps you will be ready to scan your hosts for vulnerabilities.</p>
<h3>Set HTTP_PROXY</h3>
<p>If you need to access the Internet through a proxy server, the HTTP_PROXY environment variables should be set.  This will allow <a href="http://www.gnu.org/software/wget/">wget</a>, Python’s <a href="http://www.python.org/doc/1.5.2p2/lib/module-urllib.html">urllib module</a>, and other applications (yum, apt-get etc) to use this environment variable to access http/https through the proxy server. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# export HTTP_PROXY="http://&lt;proxy-server-ip>:&lt;port>"
</pre>
</td>
</table>
<p>Replace &#8220;&lt;<em>proxy-server-ip</em>>&#8221; with your proxy server name/ip and &#8220;&lt;<em>port</em>>&#8221; with the proxy&#8217;s port.</p>
<h3>Install setuptools</h3>
<p>The <a href="http://pypi.python.org/pypi/setuptools">setuptools</a> module is a way to allow developers an easy way to build and distribute Python packages in a single-file archive called an &#8220;<a href="http://peak.telecommunity.com/DevCenter/PythonEggs">egg</a>.&#8221;   The steps to get setuptools installed are:</p>
<ol>
<li>Download the appropriate egg for your version of Python (e.g. setuptools-0.6c8-py2.3.egg). Do NOT rename it.</li>
<li>Run it. Setuptools will install itself using the matching version of Python (e.g. python2.3), and will place the easy_install executable in the default location for installing Python scripts (as determined by the standard distutils configuration files, or by the Python installation).</li>
</ol>
<p>To install:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://pypi.python.org/packages/2.3/s/setuptools/setuptools-0.6c8-py2.3.egg
# sh setuptools-0.6c8-py2.3.egg
</pre>
</td>
</table>
<h3>Install paramiko</h3>
<p>The python module <a href="http://www.lag.net/paramiko/">paramiko</a> implements SSH2 protocol for secure (encrypted and authenticated) connections to remote machines.  Below, the <strong>easy_install</strong> executable is used.  The Python module easy_install is bundled with <strong>setuptools</strong> and allows for automatically download, build, install, and management of Python packages.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://www.lag.net/paramiko/download/paramiko-1.7.3.tar.gz
# tar xzf paramiko-1.7.3.tar.gz
# cd paramiko-1.7.3
# easy_install ./
</pre>
</td>
</table>
<h3>Pull Down debian_ssh_scan_v4</h3>
<p>The python script debian_ssh_scan_v4 can now be installed.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://itsecurity.net/debian_ssh_scan_v4.tar.bz2
# bzip2 -cd debian_ssh_scan_v4.tar.bz2 | tar xvf -
 # cd debian_ssh_scan_v4
</pre>
</td>
</table>
<h3>Start Scanning</h3>
<p>You are now ready to start scanning.  The below IP is used only for demonstration purposes.  Use your own site&#8217;s IPs.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
#  ./debian_ssh_scan_v4.py 127.0.0.1:22
201691 fingerprints loaded.
127.0.0.1:22 sshd fingerprint 97382c98fe3d45fa779abd34bb65fb73 VULNERABLE (RSA 2048 bit key, pid 5214)
</pre>
</td>
</table>
<p>Modify  <strong>targets.txt</strong>, if you want to create a file of IPs.  Run the file of IPs through the scan program using the command:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cat targets.txt | ./debian_ssh_scan_v4.py
</pre>
</td>
</table>
<h3>Final Words</h3>
<p>Debian has issued an update for OpenSSL. For affected systems, the software packages need to be updated and all cryptographic key material must be recreated.  Please see <a href="http://http://www.securityfocus.com/bid/29179/references">Security Focus references</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache and OpenSSL</title>
		<link>http://blog.securitymonks.com/2008/04/24/apache-and-openssl/</link>
		<comments>http://blog.securitymonks.com/2008/04/24/apache-and-openssl/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 23:05:56 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[OpenSSL]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2008/04/24/apache-and-openssl/</guid>
		<description><![CDATA[Adding to the previous post titled &#8220;An Apache Implementation&#8220;, today we will discuss implementing OpenSSL under Apache.  To quote from the OpenSSL site, OpenSSL is &#8220;a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/security_graphic.gif" alt="Apache and OpenSSL" align="left" />Adding to the previous post titled &#8220;<a href="http://blog.securitymonks.com/2008/04/14/an-apache-implementation/">An Apache Implementation</a>&#8220;, today we will discuss implementing <a href="http://www.openssl.org/">OpenSSL</a> under Apache.  To quote from the OpenSSL site, OpenSSL is &#8220;<em>a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library</em>.&#8221;  Most operating system have OpenSSL installed, so do not download and install it.  Doing so could break applications that rely on the pre-installed version of OpenSSL.  Work with what you have.  After all, there is more to life than just installation.  There is configuration and certification.</p>
<p>
If you are using Apache 2.x, which is what we installed in the previous post, Apache supports SSL already with the mod_ssl module.  If you need to check if mod_ssl is part of your Apache configuration, do so with the command:
</p>
<p>
<strong>/usr/local/apache/bin/httpd -l</strong>
</p>
<p>
Having established that mod_ssl module is installed, we will now go through the steps of generating a certificate request, approving the certificate, and add to Apache configuration file required lines to create a SSL enabled Apache server.</p>
<h3>Key Generation</h3>
<p>We start off by generating a non password protected 1024 bit server private key using the <a href="http://www.linuxjournal.com/article/6826">RSA algorithm</a>.  We will have the key stored in the file <strong>server.key</strong>.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root#  cd /usr/local/apache/conf
 /usr/local/apache/conf root# mkdir ssl
 /usr/local/apache/conf root# cd ssl
 /usr/local/apache/conf/ssl root# openssl genrsa -out <strong>server.key</strong> 1024
Generating RSA private key, 1024 bit long modulus
.....................................................................++++++
....++++++
e is 65537 (0x10001)

 /usr/local/apache/conf/ssl root# cat server.key
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDS1A7eGdTo39tnYdzYI3Ifl1/sA4ZiY7PzkDU68tZoA4WzJB9n
aSJHCbd0ESG0oPiyf/yqMyNR2ECwjLUFo1m1nrON2w3QdM5zFZZv6v7jDt40u3bT
95XwdFG4FYDw+gq6liuRAkAe2+B6WM1Qv5rN3IzhmZmPA8YjV/sbPzNmzIuNHrVw
FY0WkRzrEF6P36Z6RVJQSzgzx4pDeu5rRX88HxLdTm4Uz6maiwhLsxZv0QIDAQAB
hsqZuAY7esEvSlL9xxXHxHL9Ywl/EXnXSMcJ9ktSobs/T0favkQKulgq6ov9TzIQ
v2Z2vLEABQJBANeKaGm41GgDZp3yEIuNKUp0OjwnORpkuYf/DFA+ox1AAS2OPGjV
iua7aiHYPPF6O6Knb+6SiBRFVkjB6Pz1Fl0CQFs7mxCIHrvTjGN8EcHQ038IP/iu
AoGBAMLjcFLzghM7TDBHEMVkDs0RO4SKxaESFXkjZ3F0papFB0TQMY+AakVMwB80
7vlwjDVFhqU23IF97F7H01bA590DfIxg6c11w4PdlxHVb9Kv+K7P7mve3wbJEUV+
rYr8r+Hr25Fegzwg1tfgFLDDkDoeC3u1wbQNCmL/qksSrD6hAkEA+mc0g4S92Y6S
gDQ3JU/YLaYV4aw2Xk/v5RtNmk++73QtU++azuXSFeDbHHHsZdm2tXBOdRkCQQCv
vg68hRPLa1p0VjbfUk3kgzgoa+LHfnE4TeEAXNIqu1E6j8r5v4Pt9cnnpqSqT/vn
qzTyQmTBW621ioer5A4v2QocJ2R6XhgjDwFOmKTGs0mH
-----END RSA PRIVATE KEY-----
 /usr/local/apache/conf/ssl root# chmod 400 server.key
</pre>
</td>
</table>
<h3>Certificate Signing Request (CSR)</h3>
<p>The next step is to create a <a href="http://en.wikipedia.org/wiki/Certificate_signing_request">certificate-signing request (CSR)</a>, which is used as a message sent asking a certificate authority (CA) to sign a certificate.  If you want a field to be empty, do not hit return.  That would just select the default value.  Instead, use &#8220;.&#8221;.  Below, I have left my responses off.  Enter your own appropriate values.  The generated CSR will be the file <strong>server.csr</strong>.
</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/apache/conf/ssl root# openssl req -new -key server.key -out <strong>server.csr</strong>
You are about to be asked to enter information that will be
incorporated into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:
Organization Name (eg, company) [My Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
 /usr/local/apache/conf/ssl root#  cat server.csr
</pre>
</td>
</table>
<p>You can now send the CSR server.csr to your public CA.  The CA will generate and sign the certificate.  To make things more interesting, we are now going to sign our own CSR and generate a signed certificate <strong>server.crt</strong>.  You can use the command &#8220;openssl x509&#8243; to examine the certificate.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 /usr/local/apache/conf/ssl root# openssl x509 -req -days 365 -in server.csr \
-signkey server.key -out <strong>server.crt</strong>
Signature ok
subject=/C=US/ST=New
 Jersey/L=Princetown/O=PU/OU=RS/CN=podus.pu.edu/emailAddress=jbond@pu.edu
Getting Private key
 /usr/local/apache/conf/ssl root# openssl x509 -text -in server.crt
 /usr/local/apache/conf/ssl root# chmod 400 server.crt
</pre>
</td>
</table>
<h3>Configuration</h3>
<p>Now we are going to enable SSL on our Apache server running the server off port 443.  The  server will use the certificate generated above.  We are also going to disable SSLv2 since it has <a href="http://www.eucybervote.org/Reports/MSI-WP2-D7V1-V1.0-02.htm">some problems</a> and is disabled by default in Internet Explorer 7, Firefox 2, Opera 9, and Safari.</p>
<p>
Modify the apache configuration file:
</p>
<p>
<strong>/usr/local/apache/conf/httpd.conf</strong>
</p>
<p>
adding the lines:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
Listen 443
&lt;virtualhost _default_:443>
#   SSL Engine Switch:
SSLEngine on
# Path to the server certificcate
SSLCertificateFile "/usr/local/apache/conf/ssl/server.crt"
# Path to the server private key
SSLCertificateKeyFile "/usr/local/apache/conf/ssl/server.key"
# Allow SSLv3 only
SSLProtocol All -SSLv2
#   SSL Cipher Suite:
#   Disallow ciphers that are weak
SSLCipherSuite ALL:!EXP:!NULL:!ADH:!LOW
# Make SSL work with Internet Explorer
SetEnvIf User-Agent ".*MSIE.*" \
              nokeepalive ssl-unclean-shutdown \
              downgrade-1.0 force-response-1.0
&lt;/virtualhost>
</pre>
</td>
</table>
<p>
Depending on your requirements, you might want to run the server only over SSL.  You can do this by stopping the server from listening on port 80.  That would result in unable to connect message.  Instead, it might be better to redirect traffic coming to http over to https.  A great source of recipes for rewrite rule is the <a href="http://rewrite.drbacchus.com/">mod_rewrite Cookbook</a> site.  </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
</pre>
</td>
</table>
<p>We will also add limitations to who can access the site by limiting who access the &#8220;/&#8221; directory.  In the example below, we will limit it to 127.0.0.1.  In the httpd.conf file, after the line &#8220;&lt;Directory />&#8221; add the line:</p>
<pre class="displaycode">
SSLRequire  %{REMOTE_ADDR} =~ m/^127.0.0.1$/
</pre>
<p>Start Apache with the command:</p>
<pre>
/usr/local/apache/bin/apachectl start
</pre>
<p>You can try and access the web server with the URL:</p>
<pre class="displaycode">

http://yourhostname/
</pre>
<p>you will get the message:</p>
<pre>
Forbidden
You don't have permission to access / on this server.
</pre>
<p>Notice that the URL has changed from &#8220;http://yourhostname&#8221; to &#8220;<strong>https</strong>://yourhostname&#8221;.  Now try and access the site using:</p>
<pre class="displaycode">

http://127.0.0.1/
</pre>
<p>You will get prompted whether to accept the certificate.  Since you are accessing 127.0.0.1, it will complain about a domain name mismatch.  The host you are trying to access needs to match the entry you provided for &#8220;Common Name&#8221; in the CSR, otherwise it will complain.  If you accept the certificate, you can access the site.  </p>
<h3>Final Thoughts</h3>
<p>At this point, we have secured communication between the client and the Apache web server.  In my next post, we will discuss installing one more module, <a href="http://www.modsecurity.org">mod_security</a>.  Mod_security is a web application firewall and serves as another layer in our web defenses.  It is not meant as a replacement for implementing good security in databases, web servers, or applications.  That is why we have gone through all these additional steps first.  Remember, once, <a href="http://www.securityfocus.com/bid/5363/exploit">SSLv2</a> was thought to be secure.  Now we know otherwise.  <a href="http://www.securityfocus.com/vulnerabilities">Vulnerabilities</a> are continuously being discovered.  Good security is about building up one&#8217;s defenses.  It is a process, not a destination.  Maybe one day some company will have a security solution that will defend systems against all threats.  I know that is not today, no matter what sales folks might say.  When that day comes, you can bet before that solution makes it to market, hackers will have found a way around it.  So while we wait for the security rapture to take us to a secure promise land, implement security in layers.  It is your best defense.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/04/24/apache-and-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

