diff options
Diffstat (limited to 'docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html')
-rw-r--r-- | docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html b/docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html index 5d0aade78b..463505791e 100644 --- a/docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html +++ b/docs/htmldocs/Samba3-HOWTO/ch-ldap-tls.html @@ -1,58 +1,58 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 46. LDAP and Transport Layer Security</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The Official Samba 3.4.x HOWTO and Reference Guide"><link rel="up" href="Appendix.html" title="Part VI. Reference Section"><link rel="prev" href="speed.html" title="Chapter 45. Samba Performance Tuning"><link rel="next" href="ch47.html" title="Chapter 47. Samba Support"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 46. LDAP and Transport Layer Security</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="speed.html">Prev</a> </td><th width="60%" align="center">Part VI. Reference Section</th><td width="20%" align="right"> <a accesskey="n" href="ch47.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 46. LDAP and Transport Layer Security"><div class="titlepage"><div><div><h2 class="title"><a name="ch-ldap-tls"></a>Chapter 46. LDAP and Transport Layer Security</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gavin</span> <span class="surname">Henry</span></h3><div class="affiliation"><span class="orgname">Suretec Systems Limited, UK<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:ghenry@suretecsystems.com">ghenry@suretecsystems.com</a>></code></p></div></div></div></div><div><p class="pubdate">July 8, 2005</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-intro-ldap-tls">Introduction</a></span></dt><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-config-ldap-tls">Configuring</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-certs">Generating the Certificate Authority</a></span></dt><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-server">Generating the Server Certificate</a></span></dt><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-install">Installing the Certificates</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-test-ldap-tls">Testing</a></span></dt><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-int-ldap-tls">Troubleshooting</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-intro-ldap-tls"></a>Introduction</h2></div></div></div><p> - <a class="indexterm" name="id2697511"></a> -<a class="indexterm" name="id2697521"></a> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 46. LDAP and Transport Layer Security</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.4.x HOWTO and Reference Guide"><link rel="up" href="Appendix.html" title="Part VI. Reference Section"><link rel="prev" href="speed.html" title="Chapter 45. Samba Performance Tuning"><link rel="next" href="ch47.html" title="Chapter 47. Samba Support"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 46. LDAP and Transport Layer Security</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="speed.html">Prev</a> </td><th width="60%" align="center">Part VI. Reference Section</th><td width="20%" align="right"> <a accesskey="n" href="ch47.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="ch-ldap-tls"></a>Chapter 46. LDAP and Transport Layer Security</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gavin</span> <span class="orgname">Suretec Systems Limited, UK</span> <span class="surname">Henry</span></h3><div class="affiliation"><span class="orgname">Suretec Systems Limited, UK<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:ghenry@suretecsystems.com">ghenry@suretecsystems.com</a>></code></p></div></div></div></div><div><p class="pubdate">July 8, 2005</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-intro-ldap-tls">Introduction</a></span></dt><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-config-ldap-tls">Configuring</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-certs">Generating the Certificate Authority</a></span></dt><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-server">Generating the Server Certificate</a></span></dt><dt><span class="sect2"><a href="ch-ldap-tls.html#s1-config-ldap-tls-install">Installing the Certificates</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-test-ldap-tls">Testing</a></span></dt><dt><span class="sect1"><a href="ch-ldap-tls.html#s1-int-ldap-tls">Troubleshooting</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-intro-ldap-tls"></a>Introduction</h2></div></div></div><p> + <a class="indexterm" name="id2691426"></a> +<a class="indexterm" name="id2691435"></a> Up until now, we have discussed the straightforward configuration of <span class="trademark">OpenLDAP</span>™, with some advanced features such as ACLs. This does not however, deal with the fact that the network transmissions are still in plain text. This is where <em class="firstterm">Transport Layer Security (TLS)</em> comes in. </p><p> -<a class="indexterm" name="id2697544"></a> +<a class="indexterm" name="id2691459"></a> <span class="trademark">OpenLDAP</span>™ clients and servers are capable of using the Transport Layer Security (TLS) framework to provide integrity and confidentiality protections in accordance with <a class="ulink" href="http://rfc.net/rfc2830.html" target="_top">RFC 2830</a>; <span class="emphasis"><em>Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security.</em></span> </p><p> -<a class="indexterm" name="id2697574"></a> +<a class="indexterm" name="id2691489"></a> TLS uses X.509 certificates. All servers are required to have valid certificates, whereas client certificates are optional. We will only be discussing server certificates. - </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p> -<a class="indexterm" name="id2697588"></a> -<a class="indexterm" name="id2697595"></a> -<a class="indexterm" name="id2697601"></a> + </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p> +<a class="indexterm" name="id2691503"></a> +<a class="indexterm" name="id2691509"></a> +<a class="indexterm" name="id2691516"></a> The DN of a server certificate must use the CN attribute to name the server, and the CN must carry the server's fully qualified domain name (FQDN). Additional alias names and wildcards may be present in the <code class="option">subjectAltName</code> certificate extension. More details on server certificate names are in <a class="ulink" href="http://rfc.net/rfc2830.html" target="_top">RFC2830</a>. </p></div><p> We will discuss this more in the next sections. - </p></div><div class="sect1" title="Configuring"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-config-ldap-tls"></a>Configuring</h2></div></div></div><p> - <a class="indexterm" name="id2697641"></a> + </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-config-ldap-tls"></a>Configuring</h2></div></div></div><p> + <a class="indexterm" name="id2691556"></a> Now on to the good bit. - </p><div class="sect2" title="Generating the Certificate Authority"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-certs"></a>Generating the Certificate Authority</h3></div></div></div><p> -<a class="indexterm" name="id2697664"></a> + </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-certs"></a>Generating the Certificate Authority</h3></div></div></div><p> +<a class="indexterm" name="id2691579"></a> In order to create the relevant certificates, we need to become our own Certificate Authority (CA). - <sup>[<a name="id2697675" href="#ftn.id2697675" class="footnote">8</a>]</sup> This is necessary, so we can sign the server certificate. + <sup>[<a name="id2691590" href="#ftn.id2691590" class="footnote">8</a>]</sup> This is necessary, so we can sign the server certificate. </p><p> -<a class="indexterm" name="id2697704"></a> - We will be using the <a class="ulink" href="http://www.openssl.org" target="_top">OpenSSL</a> <sup>[<a name="id2697718" href="#ftn.id2697718" class="footnote">9</a>]</sup> software for this, which is included with every great <span class="trademark">Linux</span>® distribution. +<a class="indexterm" name="id2691619"></a> + We will be using the <a class="ulink" href="http://www.openssl.org" target="_top">OpenSSL</a> <sup>[<a name="id2691632" href="#ftn.id2691632" class="footnote">9</a>]</sup> software for this, which is included with every great <span class="trademark">Linux</span>® distribution. </p><p> - TLS is used for many types of servers, but the instructions<sup>[<a name="id2697736" href="#ftn.id2697736" class="footnote">10</a>]</sup> presented here, are tailored for <span class="application">OpenLDAP</span>. - </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + TLS is used for many types of servers, but the instructions<sup>[<a name="id2691651" href="#ftn.id2691651" class="footnote">10</a>]</sup> presented here, are tailored for <span class="application">OpenLDAP</span>. + </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> The <span class="emphasis"><em>Common Name (CN)</em></span>, in the following example, <span class="emphasis"><em>MUST</em></span> be the fully qualified domain name (FQDN) of your ldap server. </p></div><p> First we need to generate the CA: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> mkdir myCA </code> </pre><p> Move into that directory: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> cd myCA </code> </pre><p> - Now generate the CA:<sup>[<a name="id2697812" href="#ftn.id2697812" class="footnote">11</a>]</sup> -</p><pre class="screen" width="90"> + Now generate the CA:<sup>[<a name="id2691727" href="#ftn.id2691727" class="footnote">11</a>]</sup> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> /usr/share/ssl/misc/CA.pl -newca CA certificate filename (or enter to create) @@ -83,15 +83,15 @@ Email Address []:support@abmas.biz </pre><p> </p><p> There are some things to note here. - </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> + </p><div class="orderedlist"><ol type="1"><li><p> You <span class="emphasis"><em>MUST</em></span> remember the password, as we will need it to sign the server certificate.. - </p></li><li class="listitem"><p> + </p></li><li><p> The <span class="emphasis"><em>Common Name (CN)</em></span>, <span class="emphasis"><em>MUST</em></span> be the fully qualified domain name (FQDN) of your ldap server. - </p></li></ol></div></div><div class="sect2" title="Generating the Server Certificate"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-server"></a>Generating the Server Certificate</h3></div></div></div><p> + </p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-server"></a>Generating the Server Certificate</h3></div></div></div><p> Now we need to generate the server certificate: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> openssl req -new -nodes -keyout newreq.pem -out newreq.pem Generating a 1024 bit RSA private key @@ -122,14 +122,14 @@ An optional company name []: </pre><p> </p><p> Again, there are some things to note here. - </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> + </p><div class="orderedlist"><ol type="1"><li><p> You should <span class="emphasis"><em>NOT</em></span> enter a password. - </p></li><li class="listitem"><p> + </p></li><li><p> The <span class="emphasis"><em>Common Name (CN)</em></span>, <span class="emphasis"><em>MUST</em></span> be the fully qualified domain name (FQDN) of your ldap server. </p></li></ol></div><p> Now we sign the certificate with the new CA: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> /usr/share/ssl/misc/CA.pl -sign Using configuration from /etc/ssl/openssl.cnf @@ -174,11 +174,11 @@ Signed certificate is in newcert.pem </pre><p> </p><p> That completes the server certificate generation. - </p></div><div class="sect2" title="Installing the Certificates"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-install"></a>Installing the Certificates</h3></div></div></div><p> + </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="s1-config-ldap-tls-install"></a>Installing the Certificates</h3></div></div></div><p> Now we need to copy the certificates to the right configuration directories, rename them at the same time (for convenience), change the ownership and finally the permissions: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> cp demoCA/cacert.pem /etc/openldap/ <code class="prompt">root# </code> cp newcert.pem /etc/openldap/servercrt.pem @@ -191,7 +191,7 @@ Signed certificate is in newcert.pem </p><p> Now we just need to add these locations to <code class="filename">slapd.conf</code>, anywhere before the <code class="option">database</code> declaration as shown here: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> TLSCertificateFile /etc/openldap/servercrt.pem TLSCertificateKeyFile /etc/openldap/serverkey.pem @@ -201,17 +201,17 @@ TLSCACertificateFile /etc/openldap/cacert.pem </p><p> Here is the declaration and <code class="filename">ldap.conf</code>: <code class="filename">ldap.conf</code> -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> TLS_CACERT /etc/openldap/cacert.pem </code> </pre><p> </p><p> That's all there is to it. Now on to <a class="xref" href="ch-ldap-tls.html#s1-test-ldap-tls" title="Testing">the section called “Testing”</a> - </p></div></div><div class="sect1" title="Testing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-test-ldap-tls"></a>Testing</h2></div></div></div><p> -<a class="indexterm" name="id2698220"></a> + </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-test-ldap-tls"></a>Testing</h2></div></div></div><p> +<a class="indexterm" name="id2692135"></a> This is the easy part. Restart the server: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> /etc/init.d/ldap restart Stopping slapd: [ OK ] @@ -220,15 +220,15 @@ Starting slapd: [ OK ] </code> </pre><p> Then, using <code class="literal">ldapsearch</code>, test an anonymous search with the - <code class="option">-ZZ</code><sup>[<a name="id2698262" href="#ftn.id2698262" class="footnote">12</a>]</sup> option: -</p><pre class="screen" width="90"> + <code class="option">-ZZ</code><sup>[<a name="id2692177" href="#ftn.id2692177" class="footnote">12</a>]</sup> option: +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> ldapsearch -x -b "dc=ldap,dc=abmas,dc=biz" \ -H 'ldap://ldap.abmas.biz:389' -ZZ </code> </pre><p> Your results should be the same as before you restarted the server, for example: -</p><pre class="screen" width="90"> +</p><pre class="screen"> <code class="computeroutput"> <code class="prompt">root# </code> ldapsearch -x -b "dc=ldap,dc=abmas,dc=biz" \ -H 'ldap://ldap.abmas.biz:389' -ZZ @@ -264,8 +264,8 @@ sambaNextGroupRid: 67109863 </code> </pre><p> If you have any problems, please read <a class="xref" href="ch-ldap-tls.html#s1-int-ldap-tls" title="Troubleshooting">the section called “Troubleshooting”</a> -</p></div><div class="sect1" title="Troubleshooting"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-int-ldap-tls"></a>Troubleshooting</h2></div></div></div><p> -<a class="indexterm" name="id2698360"></a> +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="s1-int-ldap-tls"></a>Troubleshooting</h2></div></div></div><p> +<a class="indexterm" name="id2692275"></a> The most common error when configuring TLS, as I have already mentioned numerous times, is that the <span class="emphasis"><em>Common Name (CN)</em></span> you entered in <a class="xref" href="ch-ldap-tls.html#s1-config-ldap-tls-server" title="Generating the Server Certificate">the section called “Generating the Server Certificate”</a> is <span class="emphasis"><em>NOT</em></span> the Fully Qualified Domain Name (FQDN) of your ldap server. @@ -275,13 +275,13 @@ your have the wrong permissions on the <code class="filename">servercrt.pem</cod files. They should be set with <code class="literal">chmod 640</code>, as per <a class="xref" href="ch-ldap-tls.html#s1-config-ldap-tls-install" title="Installing the Certificates">the section called “Installing the Certificates”</a>. </p><p> For anything else, it's best to read through your ldap logfile or join the <span class="application">OpenLDAP</span> mailing list. -</p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2697675" href="#id2697675" class="para">8</a>] </sup>We could however, get our generated server certificate signed by proper CAs, like <a class="ulink" href="http://www.thawte.com/" target="_top">Thawte</a> and <a class="ulink" href="http://www.verisign.com/" target="_top">VeriSign</a>, which +</p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2691590" href="#id2691590" class="para">8</a>] </sup>We could however, get our generated server certificate signed by proper CAs, like <a class="ulink" href="http://www.thawte.com/" target="_top">Thawte</a> and <a class="ulink" href="http://www.verisign.com/" target="_top">VeriSign</a>, which you pay for, or the free ones, via <a class="ulink" href="http://www.cacert.org/" target="_top">CAcert</a> - </p></div><div class="footnote"><p><sup>[<a name="ftn.id2697718" href="#id2697718" class="para">9</a>] </sup>The downside to + </p></div><div class="footnote"><p><sup>[<a name="ftn.id2691632" href="#id2691632" class="para">9</a>] </sup>The downside to making our own CA, is that the certificate is not automatically recognized by clients, like the commercial - ones are.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2697736" href="#id2697736" class="para">10</a>] </sup>For information straight from the + ones are.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2691651" href="#id2691651" class="para">10</a>] </sup>For information straight from the horse's mouth, please visit <a class="ulink" href="http://www.openssl.org/docs/HOWTO/" target="_top">http://www.openssl.org/docs/HOWTO/</a>; the main OpenSSL - site.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2697812" href="#id2697812" class="para">11</a>] </sup>Your <code class="filename">CA.pl</code> or <code class="filename">CA.sh</code> might not be + site.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2691727" href="#id2691727" class="para">11</a>] </sup>Your <code class="filename">CA.pl</code> or <code class="filename">CA.sh</code> might not be in the same location as mine is, you can find it by using the <code class="literal">locate</code> command, i.e., <code class="literal">locate CA.pl</code>. If the command complains about the database being too old, run - <code class="literal">updatedb</code> as <span class="emphasis"><em>root</em></span> to update it.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2698262" href="#id2698262" class="para">12</a>] </sup>See <code class="literal">man ldapsearch</code></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="speed.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="Appendix.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch47.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 45. Samba Performance Tuning </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 47. Samba Support</td></tr></table></div></body></html> + <code class="literal">updatedb</code> as <span class="emphasis"><em>root</em></span> to update it.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2692177" href="#id2692177" class="para">12</a>] </sup>See <code class="literal">man ldapsearch</code></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="speed.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="Appendix.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch47.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 45. Samba Performance Tuning </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 47. Samba Support</td></tr></table></div></body></html> |