LDP/LDP/howto/docbook/Apache-WebDAV-LDAP-HOWTO.xml

1242 lines
57 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://docbook.org/xml/4.1.2/docbookx.dtd">
<article id="Apache-WebDAV-LDAP-HOWTO">
<articleinfo>
<title>Apache based WebDAV Server with LDAP and SSL </title>
<author>
<firstname>Saqib</firstname>
<surname>Ali</surname>
<affiliation>
<orgname><ulink url="http://www.xml-dev.com">Offshore XML/XHTML Development</ulink></orgname>
<address>
<email>saqib@seagate.com</email>
</address>
</affiliation>
</author>
<revhistory id="revhistory">
<revision>
<revnumber>v4.1.2</revnumber>
<date>2003-10-17</date>
<authorinitials>sa</authorinitials>
<revremark>
Added the SSL performance tuning section.
</revremark>
</revision>
<revision>
<revnumber>v4.1.1</revnumber>
<date>2003-09-29</date>
<authorinitials>sa</authorinitials>
<revremark>
Updated the SSL section based on the feedback received from readers.
</revremark>
</revision>
<revision>
<revnumber>v4.1.0</revnumber>
<date>2003-09-02</date>
<authorinitials>sa</authorinitials>
<revremark>
Updated the SSL section based on the feedback received from readers.
</revremark>
</revision>
<revision>
<revnumber>v4.0.2</revnumber>
<date>2003-08-01</date>
<authorinitials>sa</authorinitials>
<revremark>
Minor updates to the Apache configure cmd line. /dev/random referenced in the SSL section.
</revremark>
</revision>
<revision>
<revnumber>v4.0.1</revnumber>
<date>2003-07-27</date>
<authorinitials>sa</authorinitials>
<revremark>
Added more information to the SSL section.
</revremark>
</revision>
<revision>
<revnumber>v4.0</revnumber>
<date>2003-06-29</date>
<authorinitials>sa</authorinitials>
<revremark>
Updated the HOWTO for Apache 2.0. Also the source is in XML
</revremark>
</revision>
</revhistory>
<abstract>
<para>.This document is an HOWTO on installing a Apache based WebDAV server with LDAP for authentication and SSL encryption.</para>
</abstract>
</articleinfo>
<sect1 id="intro"><title>Introduction</title>
<para>The Objective of this document in to Setup a Apache + mySQL + PHP + WebDAV based Web Application Server, that uses LDAP for Authentication. The documentation will also provide details on the encrypting LDAP transactions.</para>
<note><title>Note:</title><para>If you encounter any problems installing Apache or any of the modules please feel free to contact me @ <email>saqib@seagate.com</email></para></note>
<sect2><title>About this document</title>
<para>This document was originally written in 2001. Since then many updates and new additions have been made. Thanks to all the people who submitted updates and corrections.</para>
<para>The XML source of this document is available at <ulink url="http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.xml">http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.xml</ulink>.</para>
<para>The latest version of the document is available at <ulink url="http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.html">http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.html</ulink>.</para>
</sect2>
<sect2><title>Contributions to the document</title>
<para>If you like to contribute to the HOWTO, you can d/l the XML source from <ulink url="http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.xml">http://www.xml-dev.com:8080/cocoon/mount/docbook/Apache-WebDAV-LDAP-HOWTO.xml</ulink> , and send in the updated source to saqib@seagate.com ALONG WITH YOUR NAME IN THE LIST OF AUTHORS AND REVISION HISTORY :). That makes it easier for me contact the person if there are any updates/corrections. Thanks.
</para>
</sect2>
<sect2><title>What is Apache?</title>
<para>The Apache HTTP Server is an open-source HTTP server for modern operating systems including UNIX and Windows NT. It provides HTTP services in sync with the current HTTP standards. </para>
<para>Thei Apache WebServer is available for free download from <ulink url="http://httpd.apache.org/">http://httpd.apache.org/</ulink></para>
</sect2>
<sect2><title>What is WebDAV?</title>
<para> WebDAV stands for Web enabled Distributed Authoring and Versioning. It provides a collaborative environment for users to edit/manage files on web-servers. Technically DAV is an extension to the http protocol.</para>
<para>Here is a brief description of the extensions provided by DAV:</para>
<para><emphasis role="bold">Overwrite Protection:</emphasis> Lock and Unlock mechanism to prevent the "lost update problem". DAV protocol support both shared and exclusive locks.</para>
<para><emphasis role="bold">Properties:</emphasis> Metadata (title, subject, creater, etc)</para>
<para><emphasis role="bold">Name-space management:</emphasis> Copy, Rename, Move and Deletion of files</para>
<para><emphasis role="bold">Access Control:</emphasis> Limit access to various resources. Currently DAV assumes access control is already in place, and does not provide strong authentication mechanism.</para>
<para><emphasis role="bold">Versioning:</emphasis> Revision control for the documents. Versioning is not implemented yet.</para>
</sect2>
<sect2><title>What is PHP?</title>
<para>PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.</para>
<para>PHP is available from <ulink url="http://www.php.net">http://www.php.net</ulink></para>
</sect2>
<sect2><title>What is mySQL?</title>
<para>MySQL, the most popular Open Source SQL database, is developed, distributed, and supported by MySQL AB</para>
<para>mySQL DB Engine can be downloaded from <ulink url="http://www.mysql.com/">http://www.mysql.com/</ulink></para>
</sect2>
<sect2><title>What do we need?</title>
<para>
The tools needed to achieve this objective are:</para>
<orderedlist numeration="lowerroman">
<listitem><para>C Compiler e.g. GCC</para></listitem>
<listitem><para>Apache 2 Web Server</para></listitem>
<listitem><para>LDAP Module for Apache</para></listitem>
<listitem><para>iPlanet LDAP lib files</para></listitem>
<listitem><para>SSL engine</para></listitem>
<listitem><para>PHP</para></listitem>
<listitem><para>mySQL DB Engine</para></listitem>
</orderedlist>
<note><title>Note:</title><para>All of these packages are free and are available for download on the net.</para></note>
</sect2>
<sect2><title>Assumptions</title>
<para> This document assumes that you have the following already installed on your system.</para>
<orderedlist numeration="lowerroman">
<listitem><para>gzip or gunzip - available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink></para></listitem>
<listitem><para>gcc and GNU make - available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink></para></listitem>
</orderedlist>
</sect2>
</sect1>
<sect1><title>Requirements</title>
<para>You'll have to download and compile several packages. This document will explain the compilation process, but you should be fimiliar with installing from source code.</para>
<sect2><title>Basics</title>
<para>You will need a machine running Solaris / Linux and GCC Compiler. GNU gnzip and GNU tar is also needed.</para>
</sect2>
<sect2><title>Apache 2.0.46</title>
<para>Apache is the HTTP server, it will be used to run the Web Application Server. Please download the Apache 2.0.46 source code from <ulink url="http://www.apache.org/dist/httpd/">http://www.apache.org/dist/httpd/</ulink>.</para>
</sect2>
<sect2><title>OpenSSL</title>
<para>You will need to download the OpenSSL from <ulink url="http://www.openssl.org/source/">http://www.openssl.org/source/</ulink> . Please download the latest version. OpenSSL installation will be used for SSL libraries for compiling mod_ssl with Apache, and for managing SSL certificates on the WebServer. Please download the OpenSSL source code gzipped file into /tmp/downloads</para>
</sect2>
<sect2><title>iPlanet LDAP Library</title>
<para>
Download the iPlanet LDAP SDK from <ulink url="http://wwws.sun.com/software/download/products/3ec28dbd.html">http://wwws.sun.com/software/download/products/3ec28dbd.html</ulink>. We will use iPlanet LDAP SDK, because it includes libraries for ldaps:// (LDAP over SSL)
</para>
</sect2>
<sect2><title>mod_auth_ldap</title>
<para>mod_auth_ldap will be used for compiling LDAP support into Apache. Please download mod_auth_ldap from <ulink url="http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap_apache2.html">http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap_apache2.html</ulink>
</para>
</sect2>
<sect2><title>mySQL DB Engine</title>
<para>Download the appropriate mySQL build for your platform from <ulink url="http://www.mysql.com/downloads/index.html">http://www.mysql.com/downloads/index.html</ulink></para>
</sect2>
<sect2><title>PHP</title>
<para>Download the PHP source code from <ulink url="http://www.php.net/downloads.php">http://www.php.net/downloads.php</ulink></para>
</sect2>
</sect1>
<sect1><title>Installation</title>
<para>First we hve take care of the few pre-requisites, and then we will get into the main installtion.</para>
<sect2><title>Pre-requisites</title>
<para>The application server as we plan to install, requires the SSL libraries and LDAP libraries. SSL engine is also required for managing the SSL certs for Apache 2.x</para>
<sect3><title>iPlanet LDAP SDK</title>
<para>Become root by using the su command:</para>
<screen><command>$ su -</command></screen>
<para>Create the <filename class="directory">/usr/local/iplanet-ldap-sdk.5</filename> directory. Copy the <filename>ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar.gz</filename> form <filename class="directory">/tmp/downloads</filename> to <filename class="directory">/usr/local/iplanet-ldap-sdk.5</filename> directory.</para>
<screen>
<command># mkdir /usr/local/iplanet-ldap-sdk.5</command>
<command># cp /tmp/downloads/ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar /usr/local/iplanet-ldap-sdk.5</command>
<command># cd /usr/local/iplanet-ldap-sdk.5</command>
<command># tar -xvf ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar</command>
</screen>
<para>Now you should have all the required iPlanet LDAP lib files in the correct directory</para>
</sect3>
<sect3><title>OpenSSL Engine</title>
<para>Next we need to install the OpenSSL Engine</para>
<para>OpenSSL is an open source implementation of the SSL/TLS protocol. It is required to create and manage SSL certificates on the webserver. The installion is also necessary for the lib files that will be used by the SSL module for apache.</para>
<para>Change to the directory where you placed the OpenSSL source code files</para>
<screen> <command># cd /tmp/download</command>
<command># gzip -d openssl.x.x.tar.gz</command>
<command># tar -xvf openssl.x.x.tar</command>
<command># cd openssl.x.x</command>
<command># make</command>
<command># make test</command>
<command># make install</command>
</screen>
<para>Upon successful completion of the <command>make install</command> the openssl binaries should reside in <filename class="directory">/usr/local/ssl</filename></para>
</sect3>
</sect2>
<sect2><title>mySQL</title>
<para>Installaing mySQL is quite simple. The downloaded binaries have to be place in appropriate directory.</para>
<para>We start creating a user:group for mysql daemon, and copying the files to appropriate directories.</para>
<screen> <command># groupadd mysql</command>
<command># useradd -g mysql mysql</command>
<command># cd /usr/local</command>
<command># gunzip &lt; /path/to/mysql-VERSION-OS.tar.gz | tar xvf - </command>
<command># ln -s full-path-to-mysql-VERSION-OS mysql</command>
</screen>
<para>Next run the install_db script, and change permission on the files</para>
<screen> <command># cd mysql</command>
<command># scripts/mysql_install_db</command>
<command># chown -R mysql .</command>
</screen>
<sect3><title>Starting mySQL</title>
<para>Now start the mySQL server to verify the installation</para>
<screen> <command># bin/mysqld_safe --user=mysql &amp;</command>
</screen>
<para>Verify mySQL daemon is running, by using the ps -ef command. You should see the following output:</para>
<screen><command># ps -ef | grep mysql</command>
root 3237 1 0 May29 ? 00:00:00 /bin/sh bin/safe_mysqld
mysql 3256 3237 0 May29 ? 00:06:58 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/downloa
</screen>
</sect3>
<sect3><title>Stopping mySQL</title>
<para>To stop the MySQL server, follow the instructions below</para>
<screen><command># cd /usr/local/mysql</command>
<command># ./bin/mysqladmin -u root -p shutdown</command>
</screen>
</sect3>
<sect3><title>Locating Data Directory</title>
<para>mySQL deamon stores all the information in a direcory called "Data Directory". If you followed the installation instructions above, your Data Directory should be located under <filename class="directory">/use/local/mysql/data</filename>.</para>
<para>To locate where your Data Directory is located, use the <command>mysqladmin</command> utility as follows:</para>
<screen>
<command># /usr/local/mysql/bin/mysqladmin variables -u root --password={your_password} | grep datadir</command>
</screen>
</sect3>
</sect2>
<sect2><title>Apache 2.0</title>
<para>Start by setting some FLAGS for the compiler</para>
<screen><command># export LDFLAGS="-L/usr/local/iplanet-ldap-sdk.5/lib/ -R/usr/local/iplanet-ldap-sdk.5/lib/:/usr/local/lib"</command>
<command># export CPPFLAGS="-I/usr/local/iplanet-ldap-sdk.5/include"</command>
</screen>
<para>Next UNTAR the apache 2.0 source files, and execute the <filename>configure</filename> script.</para>
<screen><command># cd /tmp/download</command>
<command># gzip -d httpd-2.0.46.tar.gz </command>
<command># tar -xvf httpd-2.0.46.tar</command>
<command># cd httpd-2.0.46</command>
<command>#./configure --enable-so --with-ssl --enable-ssl --enable-rewrite --enable-dav</command>
</screen>
<para>Next run the make command</para>
<screen><command># make</command>
<command># make install</command>
</screen>
<sect3><title>Starting Apache</title>
<screen><command># /usr/local/apache2/bin/apachectl start</command>
</screen>
</sect3>
<sect3><title>Stopping Apache</title>
<screen><command># /usr/local/apache2/bin/apachectl stop</command>
</screen>
</sect3>
</sect2>
<sect2><title>mod_auth_ldap</title>
<para>Untar modauthldap_apache2.tar.gz</para>
<screen><command>cd /tmp/download</command>
<command># gzip -d modauthldap_apache2.tar.gz</command>
<command># tar -xvf modauthldap_apache2.tar</command>
<command># cd modauthldap_apache2</command>
</screen>
<para>Now configure and install mod_auth_ldap</para>
<screen><command># ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-ldap-dir=/usr/local/iplanet-ldap-sdk.5/</command>
<command># make</command>
<command># make install</command>
</screen>
</sect2>
<sect2><title>CERT DB for LDAPS://</title>
<para>You will also need to get the cert7.db and key7.db from <ulink url="http://www.xml-dev.com/xml/key3.db">http://www.xml-dev.com/xml/key3.db</ulink> and <ulink url="http://www.xml-dev.com/xml/cert7.db">http://www.xml-dev.com/xml/cert7.db</ulink> and place it in the <filename>/usr/local/apache2/sslcert/</filename>directory.</para>
</sect2>
<sect2><title>PHP</title>
<para>Unzip the PHP Source Files</para>
<screen><command>gzip -d php-xxx.tar.gz</command>
<command>tar -xvf php-xxx.tar</command>
</screen>
<para>Configure and run the make command</para>
<screen><command>cd php-xxx</command>
<command>./configure --with-mysql --with-apxs=/usr/local/apache2/bin/apxs</command>
</screen>
<para>Compile the source code</para>
<screen><command># make </command>
<command># make install</command>
</screen>
<para>Copy the php.ini file to the appropriate directory</para>
<screen><command>cp php.ini-dist /usr/local/lib/php.ini</command>
</screen>
</sect2>
</sect1>
<sect1 id="config-webdav"><title>Configuring and Setting up the
WebDAV services</title>
<para> Now for the easy part. In this section we will WebDAV enable a
directory under Apache root. </para>
<sect2><title>Modifications to the
<filename>/usr/local/apache/conf/httpd.conf</filename></title>
<para>
Please verify that the following Apache directive appears in the
<filename>/usr/local/apache/conf/httpd.conf</filename> :</para>
<para><screen>
Addmodule mod_dav.c
</screen></para>
<para> If it does not please add it. This directive informs Apache
about DAV capability. The directive must be placed outside any
container. </para>
<para>
Next we must specify where Apache should store
the DAVLockDB file. DAVLockDB is a lock database for the WebDAV.
This directory should be writable by the httpd process.
</para>
<para>
I store the DAVLock file under <filename>/usr/local/apache/var</filename>.
I use this directory for other purposes as well. Please add the
following line to your
<filename>/usr/local/apache/conf/httpd.conf</filename> to specify
that the DAVLockDB file will be under
<filename>/usr/local/apache/var</filename> : </para>
<para><screen>
DAVLockDB /usr/local/apache/var/DAVLock
</screen></para>
<para>The directive must be placed outside any container.</para>
</sect2>
<sect2><title>Creating a directory for DAVLockDB</title>
<para> As mentioned above a directory must be created for DAVLockDB
that can be written by the web server process. Usually web server
process runs under the user '<emphasis>nobody</emphasis>' . Please
verify this for your system using the command:
<screen><command>ps -ef | grep httpd</command></screen>
Under <filename>/usr/local/apache</filename> create
the directory and set the permissions on it using the following
commands: </para>
<para><screen>
<command># cd /usr/local/apache</command>
<command># mkdir var</command>
<command># chmod -R 755 var/</command>
<command># chown -R nobody var/</command>
<command># chgrp -R nobody var/</command>
</screen></para>
</sect2>
<sect2><title>Enabling DAV</title>
<para> Enabling DAV is a trivial task. To enable DAV for a directory
under Apache root, just add the following directive in the container
for that particular directory: </para>
<para><screen>
DAV On
</screen></para>
<para> This directive will enable DAV for the directory and its
sub-directories. </para>
<para>The following is a sample configuration that will enable WebDAV
and LDAP authentication on
<filename>/usr/local/apache/htdocs/DAVtest</filename>. Place this in
the <filename>/usr/local/apache/conf/httpd.conf</filename> file.
</para>
<screen>
DavLockDB /tmp/DavLock
&lt;Directory "/usr/local/apache2/htdocs/DAVtest"&gt;
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
AuthName "SMA Development server"
AuthType Basic
LDAP_Debug On
#LDAP_Protocol_Version 3
#LDAP_Deref NEVER
#LDAP_StartTLS On
LDAP_Server you.ldap.server.com
#LDAP_Port 389
# If SSL is on, must specify the LDAP SSL port, usually 636
LDAP_Port 636
LDAP_CertDbDir /usr/local/apache2/sslcert
Base_DN "o=SDS"
UID_Attr uid
DAV On
#require valid-user
require valid-user
#require roomnumber "123 Center Building"
#require filter "(&amp;(telephonenumber=1234)(roomnumber=123))"
#require group cn=rcs,ou=Groups
&lt;/Directory&gt;
</screen>
</sect2>
<sect2><title>Create a Directory called DAVtest</title>
<para>As mentioned in a earlier section, all DAV directories have to
be writable by the WebServer process. In this example we assume
WebServer is running under username '<emphasis>nobody</emphasis>'.
This is usually the case. To check httpd is running under what user,
please use: </para>
<screen><command># ps -ef | grep httpd</command></screen>
<para>Create a test directory called '<filename>DAVtest</filename>'
under <filename>/usr/local/apache2/htdocs</filename> :</para>
<para><command># mkdir /usr/local/apache/htdocs/DAVtest</command></para>
<para>Change the permissions on the directory to make it is
read-writable by the httpd process. Assuming the httpd is running
under username '<emphasis>nobody</emphasis>', use the following
commands:</para>
<screen>
# cd /usr/local/apache/htdocs
# chmod -R 755 DAVtest/
# chown -R nobody DAVtest/
# chgrp -R nobody DAVtest/
</screen>
</sect2>
<sect2><title>Restart Apache</title>
<para> Finally you must run the configuration test routine that comes
with Apache to verify the syntax in <filename>httpd.conf</filename> :
</para>
<screen><command># /usr/local/apache/bin/apachectl configtest</command></screen>
<para>
If you get error messages please verify that you followed all of
the above mentioned steps correctly. If you can not figure out the
error message feel free to email me with the error message
(<ulink url="mailto:saqib@seagate.com">saqib@seagate.com</ulink>).
</para>
<para>If the configtest is successful start the apache web-server: </para>
<para><command># /usr/local/apache/bin/apachectl restart</command></para>
<para>Now you have WebDAV enabled Apache Server with LDAP
authentication and SSL encryption. </para>
</sect2>
<sect2><title>WebDAV server protocol compliance testing</title>
<para>It is very important that the WebDAV that we just implemented be fully complaint with the WebDAV-2 protocol. If it is not
fully compatible, the client side WebDAV applications will not function properly.</para>
<para>To test the complaince we will use a tool called Litmus. Litmus is a WebDAV server protocol compliance test suite,
which aims to test whether a server is compliant with the WebDAV protocol as specified in RFC2518. </para>
<para>Please download the Litmus source code from <ulink url="http://www.webdav.org/neon/litmus/">http://www.webdav.org/neon/litmus/</ulink> and place it in the /tmp/downloads directory.</para>
<para>Then use gzip and tar to extract the files:</para>
<screen>
<command># cd /tmp/downloads</command>
<command># gzip -d litmus-0.6.x.tar.gz</command>
<command># tar -xvf litmus-0.6.x.tar</command>
<command># cd litmus-0.6.x</command>
</screen>
<para>Compiling and installing Litmus is easy:</para>
<screen>
<command># ./configure</command>
<command># make</command>
<command># make install</command>
</screen>
<para><command>make install</command> will install the Litmus binary files under <filename>/usr/local/bin</filename> and the help files under <filename>/usr/local/man</filename></para>
<para>To the test the complaince of the WebDAV server that you just installed, please use the following command</para>
<screen>
<command># /usr/local/bin/litmus http://you.dav.server/DAVtest userid passwd</command>
</screen>
</sect2>
</sect1>
<sect1><title>WebDAV server management</title>
<para>In this section we will discuss about the various management task - e.g. using LDAP for access control, and working with DAV method on Apache</para>
<para>Most of the configuration changes for the DAV will have to done using the <filename>httpd.conf</filename> file. This file is located at <filename>/usr/local/apache/conf/httpd.conf</filename> </para>
<para><filename>httpd.conf</filename> is a text based configuration file that Apache uses. It can b editted using any text editor - I preffer using vi. Please make backup copy of this file, before changing it.</para>
<para>After making changes to the <filename>httpd.conf</filename> the Apache server has to be restarted using the <command>/usr/local/apache/bin/apachectl restart</command> command.
However before restarting you test for the validity of the <filename>httpd.conf</filename> by using the <command>/usr/local/apache/bin/apachectl configtest</command> comand. </para>
<sect2><title>Restricting access to DAV shares</title>
<para>In the previous section when we created the DAVtest share, we used the LDAP for authentication purposes. However anyone
who can authenticates using their LDAP useri/passwd will be able to access that folder. </para>
<para>Using the <command>require</command> directive in the httpd.conf file, we can limit access to certain individuals or groups of individuals.</para>
<para>If we look at the DAVtest configuration from the previosu section:
<screen>
&lt;Directory /usr/local/apache/htdocs/DAVtest&gt;
Dav On
#Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
AuthName "LDAP_userid_password_required"
AuthType Basic
&lt;Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
Require valid-user
&lt;/Limit&gt;
LDAP_Server ldap.server.com
LDAP_Port 389
Base_DN "o=ROOT"
UID_Attr uid
&lt;/Directory&gt;
</screen>
We see that the <command>require</command> is set to <command>valid-user</command>. Which means any valid authenticated user
has access to this folder.
</para>
<sect3><title>Restricting access based on Individual UID(s)</title>
<para>LDAP UID can be used to restrict access to DAV folder.</para>
<para><command>require valid-user</command> directive can be changed to <command>require user 334455 445566</command></para>
<para>This will restrict access to individuals with UID 334455 and 445566. Anyone else will not be able to access this folder.</para>
</sect3>
<sect3><title>Restricting access based on groups of individuals.</title>
<para><command>require</command> can also be used to restrict access to groups of individuals. This can be either done using LDAP groups or LDAP filters. The filter must be valid LDAP filter syntax.</para>
</sect3>
</sect2>
<sect2><title>Restricting write access to DAV shares</title>
<para>It maybe be required that the editting for the resources on the DAV shares be restricted to certain individual, however anyone can view the resources. This can be easily done using the <command>&lt;Limit&gt;</command> tags in the httpd.conf file</para>
<para>
<screen>
&lt;Directory /usr/local/apache/htdocs/DAVtest&gt;
Dav On
#Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
AuthName "LDAP_userid_password_required"
AuthType Basic
&lt;Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
Require valid-user
&lt;/Limit&gt;
LDAP_Server ldap.server.com
LDAP_Port 389
Base_DN "o=ROOT"
UID_Attr uid
&lt;/Directory&gt;
</screen>
</para>
<para>You restrict write access to certain individuals by changing the <command>&lt;limit&gt;</command> to
<screen>
&lt;Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
Require 334455
&lt;/Limit&gt;
</screen>
</para>
<para>Basically we are limiting the PUT POST DELETE PROPPATH MKCOL COPY MOVE LOCK and UNLOCK to an individual who has the UID of 334455. Everyone else will be able to use the methods GET and PROPFIND on the resources, but not any other method.</para>
</sect2>
</sect1>
<sect1 id="ssl"><title>Implementing and using SSL to secure HTTP traffic</title>
<para>
Security of the data stored on a file server is very important these days. Compromised data can cost thousands of dollars to
company. In the last section, we compiled LDAP authentication module into the Apache build to provide a Authentication
mechanism. However HTTP traffic is very insecure, and all data is transferred in clear text - meaning, the LDAP authentication
(userid/passwd) will be transmitted as clear text as well. This creates a problem. Anyone can sniff these userid/passwd and gain
access to DAV store. To prevent this we have to encrypt HTTP traffic, essentially HTTP + SSL or HTTPS. Anything transferred over
HTTPS is encrypted, so the LDAP userid/passwd can not be easily deciphered. HTTPS runs on port 443. The resulting build from the last
section's compilation process will have Apache to listen to both port 80 (normal HTTP) and 443 (HTTPS). If you are just going
to use this server for DAV, then I will highly suggest that you close port 80. In this section of the HOWTO I will provide some
information regarding SSL and maintaining SSL on a Apache HTTP server.
</para>
<sect2><title>Introduction to SSL</title>
<para>
SSL (Secure Socket Layer) is a protocol layer that exists between the Network Layer and Application layer. As the name suggest
SSL provides a mechanism for encrypting all kinds of traffic - LDAP, POP, IMAP and most importantly HTTP.
</para>
<para>
The following is a over-simplified structure of the layers involved in SSL.
<screen>
+-------------------------------------------+
| LDAP | HTTP | POP | IMAP |
+-------------------------------------------+
| SSL |
+-------------------------------------------+
| Network Layer |
+-------------------------------------------+
</screen>
</para>
<sect3><title>Encryption algorithms used in SSL</title>
<para>
There are three kinds of cryptographic techniques used in SSL: Public-Private Key, Symmetric Key, and <link linkend="digitsign">Digital Signature</link>.
</para>
<para>
<emphasis role="strong">Public-Private Key Crytography - Initiating SSL connection: </emphasis> In this algorithm, encryption and decryption is performed using a pair of private and public keys. The Web-server holds the private Key, and sends the Public key to the client in the Certificate.
</para>
<orderedlist>
<listitem>
<para>The client request content from the Web Server using HTTPS.</para>
</listitem>
<listitem>
<para>The web server responds with a Digital Certificate which includes the server's public key.</para>
</listitem>
<listitem>
<para>The client checks to see if the certificate has expired.</para>
</listitem>
<listitem>
<para>Then the client checks if the Certificate Authority that signed the certificate, is a trusted authority listed in the browser. This explains why we need to get a certificate from a a trusted CA.</para>
</listitem>
<listitem>
<para>The client then checks to see if the Fully Qualified Domain Name (FQDN) of the web server matches the Comman Name (CN) on the certificate?</para>
</listitem>
<listitem>
<para>If everything is successful the SSL connection is initiated.</para>
</listitem>
</orderedlist>
<note><title>Note:</title><para>Anything encrypted with Private Key can only be decrypted by using the Public Key. Similarly anything encrypted using the Public Key can only be decrypted using the Private Key. There is a common mis-conception that only the Public Key is used for encryption and Private Key is used for decryption. This is not case. Any key can be used for encryption/decryption. However if one key is used for encryption then the other key must be used for decryption. e.g. A message can not encrypted and then decrypted using only the Public Key.</para>
<para><emphasis>Using Private Key to encrypt and a Public Key to decrypt ensures the integrity of the sender (owner of the Private Key) to the recipients. Using Public Key to encrypt and a Private Key to decrypt ensures that only the inteded recipient (owner of the Private Key) will have access to the data.</emphasis>(i.e. only the person who holds the Private Key will be able to decipher the message).</para></note>
<para>
<emphasis role="strong">Symmetric Cryptography - Actual transmission of data</emphasis>: After the SSL connection has been established, Symmetric cryptography is used for encrypting data as it uses less CPU cycles. In symmetric cryptography the data can be encrypted and decrypted using the same key. The Key for symmetric cryptography is exchanged during the initiation process, using Public Key Cryptography. </para>
<para><emphasis role="strong">Message Digest</emphasis> The server uses message digest algoritm such as <link linkend="hmac">HMAC</link>, <link linkend="sha1">SHA-1</link>, <link linkend="md5">MD5</link> to verify the integrity of the transferred data.</para>
</sect3>
<sect3><title>Ensuring Authenticity and Integrity</title>
<para>Encryption Process</para>
<screen>
Sender's Receiver's
PrivateKey PublicKey
,-. ,-.
( ).......... ( )..........
`-' ''''|'|'|| `-' ''''''''||
| | |
| | |
.----------. | | .----------. | .----------.
| | V | | | V | |
|Clear Text|--------->|CipherText|--------->|CipherText|
| | Step1 | 1 | Step2 | 2 |\
`----------' | `----------' `----------' \ __
| | \ [_'
| | step5 \ |
|Step3 | __ --|--
| | _.--' |
V | _..-'' / \
.---------. | .---------. _..-'' Receiver
| SHA 1 | V | Digital | _..-''
|MsgDigest|--------->|Signature|' _
`---------' Step4 `---------' _ (_)
_____ ____ ____ ____ _ _ ____ _| |_ _ ___ ____
| ___ | _ \ / ___)/ ___) | | | _ (_ _) |/ _ \| _ \
| ____| | | ( (___| | | |_| | |_| || |_| | |_| | | | |
|_____)_| |_|\____)_| \__ | __/ \__)_|\___/|_| |_|
(____/|_|
</screen>
<itemizedlist mark='opencircle'>
<listitem><para>Step1: In this step the Original "Clear Text" message is encrypted using the Sender's Private Key, which results in Cipher Text 1. This ensures the Authenticity of the sender.</para></listitem>
<listitem><para>Step2: In this step the "CipherText 1" is encrypted using Receiver's Public Key resulting in "CipherText 2". This will ensure the Authenticity of the Receiver i.e. only the Receiver can decipher the Messsage using his Private Key.</para></listitem>
<listitem><para>Step3: Here the SHA1 Message Digest of the "Clear Text" is created.</para></listitem>
<listitem><para>Step4: SHA1 Message Digest is then encrypted using Sender's Private Key resulting in the Digital Signature of the "ClearText". This Digital Signature can be used by the receiver to ensure the Integrity of the message and authenticity of the Sender.</para></listitem>
<listitem><para>Step5: The "Digital Signature" and the "CipherText 2" are then send to the Receiver.</para></listitem>
</itemizedlist>
<para>Decryption Process</para>
<screen>
Receiver's Sender's
PrivateKey PublicKey
,-. ,-.
( ).......... ( )..........
`-' ''''''''|| `-' '''''''|||
| | |
| | |
.----------. | .----------. | | .----------.
| | V | | V | | | .---#1----.
|CipherText|--------->|CipherText|--------->|ClearText |------>| SHA 1 |
| 2 | Step1 | 1 | Step2 | | | Step3 |MsgDigest|
`----------' `----------' | `----------' `---------'
| ||
| ||Step5
| ||
| ||
.---------. | .---------.
| Digital | V | SHA 1 |
|Signature|---------------------->|MsgDigest|
_ `---------' Step4 _ `---#2----'
| | _ (_)
__| |_____ ____ ____ _ _ ____ _| |_ _ ___ ____
/ _ | ___ |/ ___)/ ___) | | | _ (_ _) |/ _ \| _ \
( (_| | ____( (___| | | |_| | |_| || |_| | |_| | | | |
\____|_____)\____)_| \__ | __/ \__)_|\___/|_| |_|
(____/|_|
</screen>
<itemizedlist mark='opencircle'>
<listitem><para>Step1: In this step the "CipherText 2" message is decrypted using the Receiver's Private Key, which results in Cipher Text 1.</para></listitem>
<listitem><para>Step2: In this step the "CipherText 1" is decrypted using Sender's Public Key resulting in "ClearText".</para></listitem>
<listitem><para>Step3: Here the SHA1 Message Digest of the "Clear Text" is created.</para></listitem>
<listitem><para>Step4: The "Digital Signature" is then decrypted using Sender's Public Key, resulting the "SHA 1 MSG Digest".</para></listitem>
<listitem><para>Step5: The "SHA1 MsgDigest #1" is then compared against "SHA1 MsgDigest #2". If they are equal, the data was not modified during transmission, and the integrity of the Original "Clear Text" has been maintained</para></listitem>
</itemizedlist>
</sect3>
</sect2>
<sect2><title>Test Certificates</title>
<para>While compiling Apache we created a test certificate. We used the makefile provided by
mod_ssl to create this custom Certificate. We used the command:
<screen><command># make certificate TYPE=custom</command></screen>
</para>
<para>This certificate can be used for testing purposes.</para>
</sect2>
<sect2><title>Certificates for Production use</title>
<para>
For production use you will need a certificate from a Certificate Authority (hereafter CA). Certificate Authorities are certificate vendors, who are listed as a Trusted CA in the user's browser. As mentioned in the Encryption Algorithms section, if the CA is not listed as a trusted authority, your user will get a warning message when trying to connect to a secure location.
</para>
<para>
Similarly the test certificates will also cause a warning message to appear on the user's browser.
</para>
</sect2>
<sect2><title>How to generate a CSR</title>
<para>
CSR or Certificate Signing Request must be sent to the trusted CA for signing. This section discusses howto create a CSR,
and send it to the CA of your choice. <command># openssl req</command> command can be used to a CSR as follows:
</para>
<screen>
<command># cd /usr/local/apache/conf/</command>
<command># /usr/local/ssl/bin/openssl req -new -nodes -keyout private.key -out public.csr</command>
Generating a 1024 bit RSA private key
............++++++
....++++++
writing new private key to 'private.key'
-----
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) [AU]:US
State or Province Name (full name) [Some-State]:California
Locality Name (eg, city) []:San Jose
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Seagate
Organizational Unit Name (eg, section) []:Global Client Server
Common Name (eg, YOUR name) []:xml.seagate.com
Email Address []:saqib@seagate.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:badpassword
An optional company name []:
</screen>
<note><title>"PRNG not seeded"</title><para>If you do not have <filename>/dev/random</filename> on your system you will get a <emphasis>"PRNG not seeded"</emphasis> error message. In that case you can use the following command:</para>
<screen><command># /usr/local/ssl/bin/openssl req -rand <filename>some_file.ext</filename> -new -nodes -keyout private.key -out public.csr </command>
</screen>
<para>Replace some_file.ext with the name of a existing file on your file system. Any file can be specified. Openssl will use that file to generate the seed</para>
<para>Solaris 9 comes with <filename>/dev/random</filename>. However on Solaris you might have to install the <ulink url="http://sunsolve.sun.com/pub-cgi/findPatch.pl?patchId=112438">112438</ulink> patch to get the /dev/random</para>
</note>
<para>
At this point you will be asked several questions about your server to generate the Certificate Singning Request</para>
<para>
Note: Your Common Name (CN) is the Fully Qualified DNS (FQDN) name of your webserver e.g. dav.server.com . If you put in anything else, it will NOT work. Remember the password that you use, for future reference.
</para>
<para>Once the process is complete, you will have <filename>private.key</filename> and a <filename>public.csr</filename> . You will need to submit the <filename>public.csr</filename> to the Certification Authority. At this pointe the public.key is not encrypted. To encrypt:
</para>
<screen> <command># mv private.key private.key.unecrpyted</command>
<command># /usr/local/ssl/bin/openssl rsa -in private.key.unecrpyted -des3 -out private.key</command>
</screen>
</sect2>
<sect2 id="InstallingServerCert"><title>Installing Server Private Key, and Server Certificate</title>
<para>Once the Certification Authority processes your request, they will send an encoded certificate (Digital Certificate) back to you. The Digital Certificate is in the format defined by X.509 v3. The following shows the structure of a typical X509 v3 Digital Certificate</para>
<itemizedlist mark='opencircle'>
<listitem><para>Certificate
<itemizedlist mark='opencircle'><listitem><para>Version</para></listitem><listitem><para>Serial Number</para></listitem><listitem><para>Algorithm ID</para></listitem><listitem><para>Issuer</para></listitem></itemizedlist>
<itemizedlist mark='opencircle'>
<listitem><para>Validity</para></listitem>
<listitem><itemizedlist mark='opencircle'><listitem><para>Not Before</para></listitem><listitem><para>Not After</para></listitem></itemizedlist></listitem>
</itemizedlist>
<itemizedlist mark='opencircle'><listitem><para>Subject</para></listitem></itemizedlist>
<itemizedlist mark='opencircle'>
<listitem><para>Subject Public Key Info</para></listitem>
<listitem><itemizedlist mark='opencircle'><listitem><para>Public Key Algorithm</para></listitem><listitem><para>RSA Public Key</para></listitem></itemizedlist></listitem>
</itemizedlist>
<itemizedlist mark='opencircle'><listitem><para>Extensions</para></listitem></itemizedlist>
</para></listitem>
<listitem><para>Certificate Signature Algorithm</para></listitem>
<listitem><para>Certificate Signature</para></listitem>
</itemizedlist>
<sect3><title>Verifying a Digital Certificate</title>
<para>To verify a X.509 Certificate use the following command</para>
<screen><command># openssl verify <filename>server.crt</filename></command>
server.crt: OK </screen>
<para>Where <filename>server.crt</filename> is the name of the file that contains the Digital Certificate</para>
</sect3>
<sect3 id="viewingdigitcertcontent"><title>Viewing the contents of a Digital Certificate</title>
<para>The contents of a Digital Certificate can be viewed by using the <command># openssl x509</command> command as follows:</para>
<screen><command># openssl x509 -text -in <filename>server.crt</filename></command>
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 312312312 (0x0)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, O=GTE Corporation, CN=GTE CyberTrust Root
Validity
Not Before: Feb 8 03:25:50 2000 GMT
Not After : Feb 8 03:25:50 2001 GMT
Subject: C=US, ST=New York, L=Pelham, O=xml-dev, OU=web, CN=www.xml-dev.com/Email=saqib@xml-dev.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Modulus (1024 bit):
............
............
Exponent: 65537 (0x10001)
Signature Algorithm: md5WithRSAEncryption
............
............
</screen>
</sect3>
<sect3><title>Modifying the httpd.conf to Install the Certificates</title>
<para> You will need to place this certificate on the server, and tell Apache where to find it.</para>
<para>For this example, the Private Key is placed in the <filename class="directory">/usr/local/apache2/conf/ssl.key/</filename> directory, and the Sever Certificate is placed in the <filename class="directory">/usr/local/apache2/conf/ssl.crt/</filename>.</para>
<para>Copy the file received from the Certification to a file called <filename>server.crt</filename> in the <filename class="directory">/usr/local/apache2/conf/ssl.crt/</filename>.</para>
<para>And place the private.key generated in the previous step in the <filename class="directory">/usr/local/apache2/conf/ssl.key/</filename></para>
<para>Then modify the <filename class="directory">/usr/local/apache2/conf/ssl.conf</filename> to point to the correct Private Key and Server Certificate files:</para>
<screen>
# Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate. If
# the certificate is encrypted, then you will be prompted for a
# pass phrase. Note that a kill -HUP will prompt again. Keep
# in mind that if you have both an RSA and a DSA certificate you
# can configure both in parallel (to also allow the use of DSA
# ciphers, etc.)
<emphasis role="strong">SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt</emphasis>
#SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server-dsa.crt
# Server Private Key:
# If the key is not combined with the certificate, use this
# directive to point at the key file. Keep in mind that if
# you've both a RSA and a DSA private key you can configure
# both in parallel (to also allow the use of DSA ciphers, etc.)
<emphasis role="strong">SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/private.key</emphasis>
#SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server-dsa.key
</screen>
</sect3>
</sect2>
<sect2><title>Removing passphrase from the RSA Private Key</title>
<para>RSA Private Key stored on the webserver is usually encrypted, and you need a passphrase to parse the file. That is why you
are prompted for a passphrase when start Apache with modssl:</para>
<para>
<screen>
<command># apachectl startssl</command>
<command>Apache/1.3.23 mod_ssl/2.8.6 (Pass Phrase Dialog)</command>
<command>Some of your private key files are encrypted for security reasons.</command>
<command>In order to read them you have to provide us with the pass phrases.</command>
<command>Server your.server.dom:443 (RSA)</command>
<command>Enter pass phrase:</command>
</screen>
</para>
<para>Encrypting the RSA Private Key is very important. If a cracker gets hold of your "Unencrypted RSA Private Key" he/she can easily impersonate your webserver. If the Key is encrypted, the cracker can not do anything without brute forcing the passphrase. Use of a strong (ie: long) passphrase is encouraged. </para>
<para>However encrypting the Key can sometimes be nuisance, since you will be prompted for a passphrase everytime you start the web-server. Especially if you are using rc scripts to start the webserver at boot time. The prompt for a passphrase will stop the boot process, waiting for your input.</para>
<para>You can get rid of the passphrase prompt easily by decrypting the Key. However make sure that no one can hold of this Key. I would
recommend Hardening and Securing guidelines be followed before decrypting the Key on the webserver.</para>
<para>To decrypt the Key:</para>
<para>First make a copy of the encrypted key</para>
<para><screen><command># cp server.key server.key.cryp</command></screen></para>
<para>Then re-write the key with encryption. You will be prompted for the original encrypted Key passphrase</para>
<para><screen><command># /usr/local/ssl/bin/openssl rsa -in server.key.cryp -out server.key</command>
read RSA key
Enter PEM pass phrase:
writing RSA key
</screen>
</para>
<para>
One way to secure the decrypted Private Key is to make readable only by the root:
<screen>
<command># chmod 400 server.key</command>
</screen>
</para>
</sect2>
<sect2><title>SSL Performance Tuning</title>
<sect3><title>Inter Process SSL Session Cache</title>
<para>Apache uses a multi-process model, in which all the request are NOT handled by the same process. This causes the SSL Session Information to be lost when a Client makes multiple requests. Multiple SSL HandShakes causes lot of overhead on the webserver and the client. To avoid this, SSL Session Information must be stored in a inter-process Session Cache, allowing all the processes to have access to the handshake information. SSLSessionCache Directive the in <filename>/usr/local/apache2/conf/ssl.conf</filename> file can be used to specify the location of the SSL Session Cache:</para>
<screen>
SSLSessionCache shmht:logs/ssl_scache(512000)
#SSLSessionCache shmcb:logs/ssl_scache(512000)
#SSLSessionCache dbm:logs/ssl_scache
SSLSessionCacheTimeout 300
</screen>
<para>Using dbm:logs/ssl_scache creates the Cache as DBM hashfile on the local disk.</para>
<para>Using shmht:logs/ssl_scache(512000) creates the Cache in Shared Memory Segment</para>
<note><title>shmht vs shmcb</title>
<para>shmht: uses a Hash Table to Cache the SSL HandShake Information in the Shared Memory</para>
<para>shmht: uses a Cyclic Buffer to Cache the SSL HandShake Informationin the Shared Memory</para>
</note>
<note><title>Note:</title>
<para>Not all platforms/OS support creation of Hash table in the Shared Memory. So dbm:logs/ssl_scache must be used instead</para>
</note>
</sect3>
<sect3><title>Verifying SSLSession Cache</title>
<para>To verify if the SSLSessionCache is working properly, you can use the <command>openssl</command> utility with the <command>-reconnect</command> as follows:</para>
<screen>
<command># openssl s_client -connect your.server.dom:443 -state -reconnect</command>
CONNECTED(00000003)
.......
.......
Reused, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA
SSL-Session:
.....
Reused, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA
SSL-Session:
.....
Reused, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA
SSL-Session:
.....
Reused, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA
SSL-Session:
.....
Reused, TLSv1/SSLv3, Cipher is EDH-RSA-DES-CBC3-SHA
SSL-Session:
.....
</screen>
<para><command>-reconnect</command> forces the s_client to connect to the server 5 times using the same SSL session ID. You should see 5 attempts of Reusing the same Session-ID as shown above. </para>
</sect3>
</sect2>
</sect1>
<appendix><title>HTTP/HTTPS Benchmarking tools</title>
<para>The following is a list of some of the OpenSource BenchMarking tools for WebServers</para>
<orderedlist numeration="lowerroman">
<listitem>
<para><ulink url="http://distcache.sourceforge.net/">SSLswamp</ulink> - For stress-testing/benchmarking connction to a SSL enable server</para>
</listitem>
<listitem>
<para><ulink url="http://www.hpl.hp.com/personal/David_Mosberger/httperf.html">HTTPERF</ulink> - A Tool for Measuring Web Server Performance</para>
</listitem>
<listitem>
<para><ulink url="http://httpd.apache.org/docs-2.1/en/programs/ab.html">ab</ulink> - Apache HTTP server benchmarking tool</para>
</listitem>
</orderedlist>
</appendix>
<appendix><title>Hardware based SSL encryption solutions</title>
<para>The following is a Hardware Based SSL encryption solution available:</para>
<orderedlist numeration="lowerroman">
<listitem>
<para><ulink url="http://www.ncipher.com">CHIL (Cryptographic Hardware Interface Library)</ulink> by nCipher</para>
</listitem>
<listitem>
<para><ulink url="http://httpd.apache.org/docs-2.1/en/programs/ab.html">ab</ulink> - Apache HTTP server benchmarking tool</para>
</listitem>
</orderedlist>
</appendix>
<appendix><title>Certificate Authorities</title>
<para>The following is list of Certificate Authorities that are trusted by the various browsers:</para>
<orderedlist numeration="lowerroman">
<listitem>
<para><ulink url="http://www.baltimore.com/">Baltimore</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://www.entrust.com/">Entrust</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://www.globalsign.net/">GeoTrust</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://www.thawte.com">Thawte</ulink></para>
</listitem>
<listitem>
<para><ulink url="http://www.trustcenter.de/">TrustCenter</ulink></para>
</listitem>
</orderedlist>
</appendix>
<glossary id="glossary"><title>Glossary of PKI Terms</title>
<glossdiv><title>A</title>
<glossentry id="asymmetric_crypt"><glossterm>Asymmetric Cryptography</glossterm>
<glossdef>
<para>In this Cryptography a Key Pair - Private and Public Key is used. Private Key is kept secret and the Public Key is Widely distributed.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>C</title>
<glossentry id="certificate"><glossterm>Certificate</glossterm>
<glossdef>
<para>A Data Record that contains the information as defined in the <link linkend="InstallingServerCert">X.509 Format</link>. </para>
</glossdef>
</glossentry>
<glossentry id="ca"><glossterm>Certificate Authority (CA)</glossterm>
<acronym>CA</acronym>
<glossdef>
<para>Issuer of the Digital Certificate. Also validates the Identity of the End-Entity that posseses the Digital Certificate.</para>
</glossdef>
</glossentry>
<glossentry id="csr"><glossterm>Certificate Signing Request (CSR)</glossterm>
<acronym>CSR</acronym>
<glossdef>
<para>Certificate Signing Request (CSR) is what you send to a Certifiate Authority (CA) to get enrolled. A CSR contains the Public Key of the End-Entity that is a requesting the Digital Certificate.</para>
</glossdef>
</glossentry>
<glossentry id="cn"><glossterm>Common Name (CN)</glossterm>
<acronym>CN</acronym>
<glossdef>
<para>Common Name is the name of the End-Entity e.g. Saqib Ali. If the End-Entity is a WebServer the CN is the Fully Qualified Domain Name (FQDN) of the WebServer</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>D</title>
<glossentry id="digitcert"><glossterm>Digital Certificate</glossterm>
<glossdef>
<para>A certificate that binds a Public Key to a Subject (end-entity). This certificate also contains other indentifying information about the subject as defined in the <link linkend="InstallingServerCert">X.509 Format</link>. It is signed by Issuing CA, using CA's pivate key. e.g. of a <link linkend="viewingdigitcertcontent">digital certificate</link></para>
</glossdef>
</glossentry>
<glossentry id="digitsign"><glossterm>Digital Signature</glossterm>
<glossdef>
<para>A Digital Signature is created by signing the Message Digest (Message Hash) using the Private Key. It ensures the Identity of the Sender, and the Integrity of the Data.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>E</title>
<glossentry id="end_entity"><glossterm>End-Entity</glossterm>
<glossdef>
<para>An entity that participates in the PKI. Usually a Server, Service, Router, or a Person. A CA is not a End-Entity. An RA is an End-Entity to the CA</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>H</title>
<glossentry id="hash"><glossterm>Hash</glossterm>
<glossdef>
<para>A hash is Hexadecimal number generated from a string of text such that, no two different strings can produce the same hash.</para>
</glossdef>
</glossentry>
<glossentry id="hmac"><glossterm>HMAC: Keyed Hashing for Message Authentication</glossterm>
<acronym>HMAC</acronym>
<glossdef>
<para>HMAC is an implementation of Message Authentication Code Algorithm.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>M</title>
<glossentry id="mac"><glossterm>Message Authentication Code</glossterm>
<acronym>MAC</acronym>
<glossdef>
<para>Similar to a Message Digest (Hash/Fingerprint), except the Shared Secret Key is used in the process of calculating the Hash. Since a shared secret key is used, an attacker can not change the Message Digest. However the shared secret key has to be first communicated to the participating entities, unlike Digital Signature where Message Digest is signed using the Private Key. HMAC is an example of a Message Authentication Code Algorithm.</para>
</glossdef>
</glossentry>
<glossentry id="md5"><glossterm>Message Digest 5 - MD5</glossterm>
<acronym>MD5</acronym>
<glossdef>
<para>Message Digest 5 (MD5) is a 128-bit one-way hash function</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>P</title>
<glossentry id="private_key"><glossterm>Private Key</glossterm>
<glossdef>
<para>Private Key is the Key in Asymmetric Cryptography that is kept secret by the owner (End-Entity). Can be used for encryption or decryption</para>
</glossdef>
</glossentry>
<glossentry id="public_key"><glossterm>Public Key</glossterm>
<glossdef>
<para>Public Key is the Key in Asymmetric Cryptography that is widely distributed. Can be used for encryption or decryption</para>
</glossdef>
</glossentry>
<glossentry id="pki"><glossterm>Public Key Infrastructure (PKI)</glossterm>
<acronym>PKI</acronym>
<glossdef>
<para>Public Key Infrastructure</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv><title>S</title>
<glossentry id="sha1"><glossterm>SHA-1: Secure Hash Algorithm</glossterm>
<acronym>MD5</acronym>
<glossdef>
<para>Secure Hash Algorithm (SHA-1) is a 160-bit one-way hash function. Maximum message is 2^64 bits.</para>
</glossdef>
</glossentry>
<glossentry id="sslayer"><glossterm>Secure Socket Layer (SSL)</glossterm>
<acronym>SSL</acronym>
<glossdef>
<para>Secure Socket Layer (SSL) is a security protocol that provides authentication (Digital Certificate), confidentiality (encryption), and data integrity (Message Digest - MD5, SHA etc).</para>
</glossdef>
</glossentry>
<glossentry id="symmetric_crypt"><glossterm>Symmetric Cryptography</glossterm>
<glossdef>
<para>In this cryptography the message the encrypted and decrypted by the same key. (((n^2-n))/2) keys are required for n users who want to participate in this system of cryptography. </para>
</glossdef>
</glossentry>
</glossdiv>
</glossary>
</article>