An example constraint overlay
[mirror/userdir-ldap.git] / doc / slapd-config.txt
1 Most of the configuration of the ldap server has to do with getting correct
2 access controls to keep the data safe. Here is a sample:
3
4
5 # only allow plain text auth when we do crypto
6 security simple_bind=128
7
8 # and the database definition
9 include /etc/ldap/userdir-ldap-slapd.conf
10
11 # Overlays are useful to enforce constraints:
12
13 moduleload /usr/lib/ldap/unique.so
14 overlay unique
15 unique_uri ldap:///ou=users,dc=debian,dc=org?uidNumber,uid,keyFingerPrint?sub
16 unique_uri ldap:///ou=groups,dc=debian,dc=org?gidNumber,cn?sub
17
18 # Constraints are useful
19 moduleload /usr/lib/ldap/constraint.so
20 overlay constraint
21 constraint_attribute mailContentInspectionAction regex ^([mM][aA][rR][kK][uU][pP]|[bB][lL][aA][cC][kK][hH][oO][lL][eE]|[rR][eE][jJ][eE][cC][tT])$
22 constraint_attribute gender regex ^(1|2|9|[mM][aA][lL][eE]|[fF][eE][mM][aA][lL][eE]|[uU][nN][sS][pP][eE][cC][iI][fF][iI][eE][dD])$
23
24 # End----------
25
26 Note that in more modern versions of slapd, the "by addr" and "by domain"
27 syntax has changed and the following should be used instead:
28         by peername.ip=127.0.0.1 read
29         by domain.subtree=debian.org read
30
31
32
33 Here is the initial seed file to import and setup the proper entries:
34
35 dn: dc=org
36 dc: net
37 objectClass: top
38 objectClass: domain
39
40 dn: dc=debian,dc=org
41 dc: visi
42 objectClass: top
43 objectClass: domain
44
45 dn: ou=users,dc=debian,dc=org
46 ou: users
47 objectClass: top
48 objectClass: organizationalUnit
49
50 dn: uid=admin,ou=users,dc=debian,dc=org
51 uid: admin
52 cn: LDAP administrator
53 objectClass: top
54 objectClass: groupOfNames
55 userPassword: {crypt}?????
56 member: uid=jgg,ou=users,dc=debian,dc=org
57 member: uid=joey,ou=users,dc=debian,dc=org
58 member: uid=troup,ou=users,dc=debian,dc=org
59 mail: debian-admin@debian.org