[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: OpenLDAP 2.1.21-2 Simple Bind over TLS still sending ClearText (Box is client to itself)







----- Forwarded by Kent Soper/Austin/IBM on 07/25/2003 12:30 PM -----
                                                                                                                                       
                      Kent Soper                                                                                                       
                                               To:      Jason.McGlamary@Medstar.net                                                    
                      07/25/2003 12:09         cc:                                                                                     
                      PM                       From:    Kent Soper/Austin/IBM@IBMUS                                                    
                                               Subject: Re: OpenLDAP 2.1.21-2 Simple Bind over TLS still sending ClearText (Box is     
                                               client to itself)(Document link: Kent Soper)                                            
                                                                                                                                       
                                                                                                                                       



Hi Jason,

You wrote:
>After configuring the TLS portion, I ran Ethereal to capture the traffic
on
>the local loopback device, and then ran the command
>          'ldapsearch -x -D "cn=Manager,ou=DON,l=WHC,dc=Medstar,dc=net"
>'(objectclass=*)' -W -ZZ'
>The command returns the following error:
>          'ldap_start_tls: Connect error (91)
>               additional info: error:14077410:SSL
>routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'
>However, when I run without the 'ZZ' flag:
>          'ldapsearch -x -D "cn=Manager,ou=DON,l=WHC,dc=Medstar,dc=net"
>'(objectclass=*)' -W'
>The command returns the results of the search correctly, but when I
>investigate the output from Ethereal, it has sent everything in the clear,
>even though I have 'ssl start_tls' specified in my /etc/openldap/ldap.conf
>file.

First of all, the "ssl start_tls" in your ldap.conf doesn't do anything.
Therefore everything is in the clear without "-ZZ" flag.  It's a PAM
directive that goes into a PAM ldap.conf.  That one has bitten a lot of
people, me included.  No way to start TLS from within your OpenLDAP conf
file.  I hope someone disagrees with me here because I would like to use
that feature.

Second, you have "TLSVerifyClient try"  in the slapd.conf and no ldaprc
file in your user's home directory (or current directory) that contains
your client info (cert, keys).  I haven't tried this setup, but that could
be in error even though the value is only "try".  You don't need client
auth for TLS/SSL so comment out that line for now.

ldap.conf is going to demand to request the server cert by default since
you don't have that directive in it.  That's fine.  No problem.

Once you get server side SSL setup, client side isn't much harder.  You
must have client side configured correctly before using SASL's EXTERNAL
mechanism to invoke client auth that way.  That's another note for a future
time!
See if that helps for now.

Cheers,
Kent

"You don't stop playing because you grow old ...
       you grow old because you stop playing."

Linux Technology Center, Linux Security
tie line:     678-9216
external:  1-512-838-9216
e-mail:  dksoper@us.ibm.com




                                                                                                                                               
                      Jason.McGlamary@Medstar.n                                                                                                
                      et                               To:       openldap-software@OpenLDAP.org                                                
                      Sent by:                         cc:                                                                                     
                      owner-openldap-software@O        Subject:  OpenLDAP 2.1.21-2 Simple Bind over TLS still sending ClearText (Box is client 
                      penLDAP.org                       to itself)                                                                             
                                                                                                                                               
                                                                                                                                               
                      07/25/2003 09:02 AM                                                                                                      
                                                                                                                                               
                                                                                                                                               




Hello All,
     I've been bashing my head against the screen the past couple days
trying to figure this out.  I've read through all the TLS postings on the
list, and I haven't found an answer clear to me.  I'm running OpenLDAP
2.1.21-2 on a RedHat 9.0 server, hoping to eventually use LDAP to
authenticate, and for Samba.  My OpenLDAP distribution is from the RedHat
Rawhide RPMs.  Install and configure went fine, and simple unprotected bind
seems to work flawlessly.  I then wanted to enable TLS transport, and
eventually use SASL over TLS (Hoping to get to complete LDAPv3 compliant).

     I created my own certificate authority for the server, then created
and signed the following certificate files:
          /etc/openldap/certificates/cacert.pem
          /etc/openldap/certificates/servercert.pem
          /etc/openldap/certificates/serverkey.pem

After configuring the TLS portion, I ran Ethereal to capture the traffic on
the local loopback device, and then ran the command
          'ldapsearch -x -D "cn=Manager,ou=DON,l=WHC,dc=Medstar,dc=net"
'(objectclass=*)' -W -ZZ'
The command returns the following error:
          'ldap_start_tls: Connect error (91)
               additional info: error:14077410:SSL
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'
However, when I run without the 'ZZ' flag:
          'ldapsearch -x -D "cn=Manager,ou=DON,l=WHC,dc=Medstar,dc=net"
'(objectclass=*)' -W'
The command returns the results of the search correctly, but when I
investigate the output from Ethereal, it has sent everything in the clear,
even though I have 'ssl start_tls' specified in my /etc/openldap/ldap.conf
file.  The output from Ethereal follows:

----------------------------------------------------------------------------------------------------------------------------------

0000  00 00 00 00 00 00 00 00  00 00 00 00 08 00 45 00   ........ ......E.
0010  00 74 a2 0b 40 00 40 06  9a 76 7f 00 00 01 7f 00   .t..@.@. .v......
0020  00 01 db 11 01 85 41 52  3a f2 41 76 5b fe 80 18   ......AR :.Av[...
0030  7f ff 3e 98 00 00 01 01  08 0a 08 41 98 f8 08 41   ..>..... ...A...A
0040  98 f8 30 3e 02 01 01 60  39 02 01 03 04 29 63 6e   ..0>...` 9....)cn
0050  3d 4d 61 6e 61 67 65 72  2c 6f 75 3d 44 4f 4e 2c   =Manager ,ou=DON,
0060  6c 3d 57 48 43 2c 64 63  3d 4d 65 64 73 74 61 72   l=WHC,dc =Medstar
0070  2c 64 63 3d 6e 65 74 80  09 6e 69 40 77 68 63 64   ,dc=net. .<secret>
0080  6f 6e
----------------------------------------------------------------------------------------------------------------------------------


Ethereal interprets the packets as plain text.

Can anyone point me in the right direction or to a resource that could help
me figure out what I'm doing incorrectly?  I'd really appreciate it.  My
configuration files for OpenLDAP follow below.

     For my slapd.conf file, I wanted to disable anonymous binds and
unprotected simple binds, but the option 'disallow bind_simple_unprotected'
mentioned in the administrator's guide doesn't seem to be a valid option in
this version of OpenLDAP.  I receive error message 'bad configuration file'
when trying to start slapd with that option, so I left it out until I can
learn more.  The contents of my slapd.conf file is below:

-------------------------------------------------------------------------------------------------------------------------------------

# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24
23:19:14 kurt Exp $
#
disallow        bind_anon bind_simple

# Specify inactivity timeout (in seconds)
idletimeout     600

# Load dynamic backend modules: (not sure what these are for)
# modulepath    /usr/sbin/openldap
# moduleload    back_bdb.la
# moduleload    back_ldap.la
# moduleload    back_ldbm.la
# moduleload    back_passwd.la
# moduleload    back_shell.la

# Specify default password hash method (stored in 'userPassword' attribute)
password-hash   {MD5}

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral       ldap://root.openldap.org

pidfile /var/run/slapd.pid
argsfile        //var/run/slapd.args

# Require strong authentication (ie. Protected "simple" authentication or
# SASL authentication)
require strong authc

# TLS transport options
 TLSCipherSuite HIGH:MEDIUM:+SSLv2
 TLSCACertificateFile /etc/openldap/certificates/cacert.pem
 TLSCertificateFile /etc/openldap/certificates/servercrt.pem
 TLSCertificateKeyFile /etc/openldap/certificates/serverkey.pem
 TLSVerifyClient        try

# Sample security restrictions
#       Require integrity protection (prevent hijacking)
#       Require 112-bit (3DES or better) encryption for updates
#       Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
#       Root DSE: allow anyone to read it
#       Subschema (sub)entry DSE: allow anyone to read it
#       Other DSEs:
#               Allow self write access
#               Allow authenticated users read access
#               Allow anonymous users to authenticate
#       Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#       by self write
#       by users read
#       by anonymous auth
#
# if no access controls are present, the default policy is:
#       Allow read by all
#
# rootdn can always write!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database        bdb
suffix          "ou=DON,l=WHC,dc=Medstar,dc=net"
rootdn          "cn=Manager,ou=DON,l=WHC,dc=Medstar,dc=net"
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw                secret
rootpw          "{MD5}<secret>"

# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory       /var/lib/ldap

# Indices to maintain for this database
index uid,cn,sn         pres,eq,approx,sub
index objectClass       eq

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 tls=yes
#     bindmethod=sasl saslmech=GSSAPI
#     authcId=host/ldap-master.example.com@EXAMPLE.COM

# Specify database Access Control Lists
# (find ACL in a separate file)
include /etc/openldap/slapd.access.conf
---------------------------------------------------------------------------------------------------------------------------------


My /etc/openldap/ldap.conf file is below:

--------------------------------------------------------------------------------------------------------------------------------

# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.4.8.6 2000/09/05
17:54:38kurt Exp $
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE   dc=example, dc=com
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT      12
#TIMELIMIT      15
#DEREF          never
ssl start_tls
HOST ESRVYJM1
BASE ou=DON,l=WHC,dc=Medstar,dc=net
TLS_CACERT /etc/openldap/certificates/cacert.pem
--------------------------------------------------------------------------------------------------------------------------------




I hope I've been thorough enough with my problem, but not too thorough.  I
gladly welcome all suggestions and criticisms...I realize how much of a
Newbie I am.

Thanks,
Jason McGlamary
Washington Hospital Center
Washington, DC, USA