Mettre la sécurité ssl avec LDAP

Bonjour,

J’essaye d’activer la sécurité ssl avec mon LDAP, mais ça ne fonctionne pas, j’ai suivi quelque tutoriaux, mais sans grand résultat. Pouvait vous m’aider. J’utilise debian 6.

Merci,

kidrek.fr…
www.vogelweith.com…
Edité le 15/02/2011 à 16:25

J’ai suivi ce tutoriel : kidrek.fr…

Quand je fait la commande pour tester : ldapsearch -x “(objectClass=*)” -H 192.168.110.130…

Sa me donne cette erreur : ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

mais si j’enleve le s de

Sa fonctionne.

Quand je fait

netstat -plane |grep “:636”

Sa ne me donne rien

Pouvait vous m’aider
Edité le 16/02/2011 à 20:36

Bonjour,

pouvez-vous détailler davantage votre problème ? S’agit-il d’un outil mobile ?

De quel type de certificat s’agit-il ?

De quelle Autorité de certification ? S’agit-il de VeriSign, thawte, GlobalSign, Geotrust, RapidSSL ?

En attente de vous lire,

Cordialement,
Networking4all

J’utilise GlobalSSL

L’idée et d’avoir un ldap sécuritaire donc avoir SLL, permet de renforcir la sécurité, J’ai tester le certificat et il est ok, j’ai vérifier les endroit ou je doit mettre mon domaine et sa ne fonctionne toujours pas.

Peut etre une question e droit de ldap sur les fichier de certification ?

J’ai modifier le fichier /etc/default/slapd en mettant:
SLAPD_SERVICES="ldap:///

netstat -plane |grep “:636” fonctionne maintenant, il me retourne :

tcp 0 0 0.0.0.0:636 0.0.0.0:* LISTEN 0 4958 1762/slapd
tcp6 0 0 :::636 :::* LISTEN 0 4959 1762/slapd

Aussi quand je fais ldapsearch -b “dc=domaine” -ZZ -xh debian6

Ça me donne

ldap_start_tls: Protocol error (2)
additional info: unsupported extended operation

Mais j’ai toujours le même problème, il me dit qu’il ne peut pas se connecter à mon serveur LDAP.

ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

J’utilise une vraie certification SSL.

Des idées ?

Quand je fais

openssl s_client -connect nom du serveur ldap:636

Sa me donne : CONNECTED(00000003)
3551:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:

Des idée de solution.

Merci,

up

J’ai décidé de compiler LDAP avec SLL directement, ça fonctionne, mais j’ai une erreur quand, je veux démarrer mon serveur slapd avec cette commande

./slapd -d127 -h "ldap:/// -f /usr/local/etc/openldap/slapd.conf

@(#) $OpenLDAP: slapd 2.4.23 (Apr 1 2011 15:34:33) $
root@debian6:/home/simon/openldap-2.4.23/servers/slapd
ldap_pvt_gethostbyname_a: host=exemple, r=0
daemon_init: …[/url] [url=ldaps:///]…
daemon_init: listen on
daemon_init: listen on
daemon_init: 2 listeners to open…
ldap_url_parse_ext(ldap:///)
daemon: listener initialized
ldap_url_parse_ext(ldaps:///)
daemon: listener initialized
daemon_init: 4 listeners opened
ldap_create
slapd init: initiated server.
bdb_back_initialize: initialize BDB backend
bdb_back_initialize: Berkeley DB 4.8.30: (April 9, 2010)
hdb_back_initialize: initialize HDB backend
hdb_back_initialize: Berkeley DB 4.8.30: (April 9, 2010)
reading config file /usr/local/etc/openldap/slapd.conf
line 17 (pidfile /usr/local/var/run/slapd.pid)
line 18 (argsfile /usr/local/var/run/slapd.args)
line 20 (TLSCipherSuite HIGH:MEDIUM:+TLSv1:+SSLv2:+SSLv3 )
line 21 (TLSCertificateFile /usr/local/etc/openldap/CA/server.pem )
line 22 (TLSCertificateKeyFile /usr/local/etc/openldap/CA/server.key )
line 23 (TLSCACertificateFile /usr/local/etc/openldap/CA/cacert.pem )
line 24 (TLSVerifyClient never)
line 52 (access to * by self write by users read by anonymous auth)
line 64 (database hdb)
hdb_db_init: Initializing HDB database
line 65 (suffix “dc=exemple,dc=com”)

dnPrettyNormal: <dc=exemple,dc=com>
=> ldap_bv2dn(dc=exemple,dc=com,0)
<= ldap_bv2dn(dc=exemple,dc=com)=0
ldap_err2string
/usr/local/etc/openldap/slapd.conf: line 65: invalid DN 21 (Invalid syntax)
slapd destroy: freeing system resources.
slapd stopped.

Voila mes fichiers de config

/etc/ldap/ldap.conf

LDAP Defaults

See ldap.conf(5) for details

This file should be world readable but not world writable.

BASE dc=exemple,dc=com
URI adresse… ip de la machine
tls_checkpeer yes
tls_ciphers HIGH
ssl yes
tls_cacert /usr/local/etc/openldap/CA/cacert.pem

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never

/usr/local/etc/openldap/slapd.conf

See slapd.conf(5) for details on configuration options.

This file should NOT be world readable.

#include /usr/local/etc/openldap/schema/core.schema
#include /usr/local/etc/openldap/schema/cosine.schema
#include /usr/local/etc/openldap/schema/nis.schema
#include /usr/local/etc/openldap/schema/inetorgperson.schema

Define global ACLs to disable default read access.

Do not enable referrals until AFTER you have a working directory

service AND an understanding of referrals.

#referral root.openldap.org…

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

TLSCipherSuite HIGH:MEDIUM:+TLSv1:+SSLv2:+SSLv3
TLSCertificateFile /usr/local/etc/openldap/CA/server.pem
TLSCertificateKeyFile /usr/local/etc/openldap/CA/server.key
TLSCACertificateFile /usr/local/etc/openldap/CA/cacert.pem
TLSVerifyClient never

Load dynamic backend modules:

modulepath /usr/local/libexec/openldap

moduleload back_hdb

moduleload back_hdb.la

moduleload back_ldap.la

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

allows anyone and everyone to read anything but restricts

updates to rootdn. (e.g., “access to * by * read”)

rootdn can always read and write EVERYTHING!

#######################################################################

BDB database definitions

#######################################################################

database hdb
suffix “dc=exemple,dc=com”
rootdn “cn=admin,dc=exemple,dc=com”

rootpw {SSHA}bgFRgv7+wknb3Xj7WVda3js/Hx8n6Yw2

Cleartext passwords, especially for the rootdn, should

be avoid. See slappasswd(8) and slapd.conf(5) for details.

Use of strong authentication encouraged.

rootpw 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 /usr/local/var/openldap-data

Indices to maintain

index objectClass eq
index uid eq

Je vois bien qu’il me dit qu’il y a une erreur de syntaxe, mais je ne vois rien.

De plus, je ne trouve pu mes schémas, j’ai cherché dans /usr/local/etc/openldap/schema mais je n’est rien trouver.

Merci à l’avance
Edité le 06/04/2011 à 16:06

J’ai trouvé la solution.

qui était?

Il fallait transférer les schémas de l’installe de openldap dans ce dossier /usr/local/etc/openldap/schema