include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/misc.schema include /etc/ldap/schema/inetorgperson.schema include /usr/share/sfidirector/etc/extraschema/evolutionperson.schema include /usr/share/sfidirector/etc/director.schema include /usr/share/sfidirector/etc/extraschema/samba.schema include /usr/share/sfidirector/etc/extraschema/autofs.schema schemacheck on
database bdb directory "/var/ldap/" lastmod on cachesize 10000 checkpoint 128 10 suffix "dc=yourcompany,dc=example" # protect passwords access to attr=userpassword,ntpassword,lmpassword,sambantpassword,sambalmpassword by self write by dn="uid=root,ou=System Users,ou=people,dc=yourcompany,dc=example" write by dn="uid=ldaproot,ou=System Users,ou=people,dc=yourcompany,dc=example" write by * compare # open read access to everything else, write for admins only access to dn.sub="dc=yourcompany,dc=example" by self read by dn="uid=root,ou=System Users,ou=people,dc=yourcompany,dc=example" write by dn="uid=ldaproot,ou=System Users,ou=people,dc=yourcompany,dc=example" write by * read index uid,sfihostclass,macaddress,apprepository eq index cn,ou,mail,surname,givenname eq,subinitial,pres index appname eq,sub index apppackageprovides eq index objectclass,uidNumber,gidNumber eq,pres
The Director then includes its own schema (director.schema) and a few 3rd-party schema definitions like evolutionperson, samba and autofs. Please also include them.
moduleload back_bdb
Later in the config file you start configuring a database tree for the Director:
database bdb
directory "/var/ldap/"
lastmod on
where /var/ldap is the directory where the database files are going to be stored. Please create this directory yourself. Depending on your distribution the OpenLDAP server will run under a special system user account, e.g. slapd. Make sure, this user has read/write access to the database directory.
Lastmod switches automatic generation of time stamps of creation and last modification on. The Director does not use those time stamps, but sooner or later you might be glad to be able to see when records have been modified.
Unfortunately, the BDB backend's default configuration is not safe, using it without additional parameters is highly dangerous - expect to loose modifications on restart or crashes. At least enable checkpointing. Some minimal suggested parameters are:
cachesize 10000 checkpoint 128 10
Additionally, the BDB backend expects further configuration in a file called DB_CONFIG within the database directory. Suggested configuration therein:
set_cachesize 0 2097152 0 set_lg_bsize 524288 set_lk_max_objects 5000 set_lk_max_locks 5000 set_lk_max_lockers 5000
OpenLDAP needs to know which part of its tree is to be stored in the database we are about to configure:
suffix "dc=yourcompany,dc=example"
The configuration requires a user named root and/or ldaproot being present in the database and stored under a well-defined DN.
First of all we limit access to password attributes, since some of them contain weak hashes:
access to attr=userpassword,ntpassword,lmpassword,sambantpassword,sambalmpassword by self write by dn="uid=root,ou=System Users,ou=people,dc=yourcompany,dc=example" write by dn="uid=ldaproot,ou=System Users,ou=people,dc=yourcompany,dc=example" write by * compare
So, the root and ldaproot users get full access to the password hashes, each user is allowed to read and change his password records, everyone else can compare entries (used by a few applications for authentication purposes).
We allow rather open access to everything else:
access to dn.sub="dc=yourcompany,dc=example" by self write by dn="uid=root,ou=System Users,ou=people,dc=yourcompany,dc=example" write by dn="uid=ldaproot,ou=System Users,ou=people,dc=yourcompany,dc=example" write by * read
Everyone is allowed to update his own record, the root/ldaproot users may update everything, everyone else (including anonymous users) get read access. You probably want to limit anonymous access, maybe replacing the last line by
by users read
by * none
or if you are not going to use your LDAP database for anything else even drop the "by users read" part of it.
Also, the first entry allowing write access for every user to its own record is potentially dangerous. You might change "by self write" to "by self read" or at least limit the attributes you allow write access to.
index uid,sfihostclass,macaddress,apprepository eq index cn,ou,mail,surname,givenname eq,subinitial,pres index appname eq,sub index apppackageprovides eq index objectclass,uidNumber,gidNumber eq,pres
This list of suggested indexes may change in the future as new queries are going to be implemented.
1.4.5