# The backend type, ldbm, is the default standard
-database bdb
+database hdb
# The base of your directory
suffix "@@DN@@"
# Where the database file are physically stored
directory "/var/lib/ldap"
+moduleload accesslog
+overlay accesslog
+logdb cn=log
+logops writes
+logold (objectclass=top)
+logpurge 90+00:00 1+00:00
+
+moduleload constraint
+overlay constraint
+constraint_attribute keyfingerprint regex ^([0-9A-F]{40})$
+
# Indexing options
-index uid eq
-index keyfingerprint eq
-index cn,sn sub,eq
-index dnsZoneEntry eq
-index uidNumber eq
-index gidNumber eq
-index ircNick sub,eq
-index c eq
-index gender eq
-index birthDate eq
+index gecos,cn,sn,uid,ircNick,hostname,emailForward pres,eq,sub,approx
+index keyfingerprint,homeDirectory,objectClass,loginShell,supplementaryGid pres,eq
+index c,dnsZoneEntry,birthDate,gidNumber,uidNumber pres,eq
# Don't limit queries to the default of 500
sizelimit 10000
# Save the time that the entry gets modified
lastmod on
-# owner writeable
-access to attrs=userPassword,sshrsaauthkey
+
+##
+## prefix some rules that only apply to certain clients
+## and grant them more privileges
+##
+
+# LDAP admins have full access, so has sshdist
+access to *
by group="cn=LDAP Administrator,ou=users,@@DN@@" write
- by dn="uid=sshdist,ou=users,@@DN@@" write
+ by dn="uid=sshdist,ou=users,@@DN@@" write
+ by * break
+
+# allow keyring maint to write to the keyFingerPrint attribute
+# (make an exception for adm for security reasons)
+access to filter="(!(supplementaryGid=adm))" attrs=keyFingerPrint
+ by group="cn=Keyring Maintainers,ou=users,@@DN@@" write
+ by * break
+
+# allow listmasters to write to the privateSub attribute
+access to attrs=privateSub
+ by group="cn=Listmasters,ou=users,@@DN@@" write
+ by self write
+ by * break
+
+# allow users write access to an explicit subset of their fields
+access to attrs=c,l,loginShell,ircNick,labeledURI,icqUIN,jabberJID,onVacation,birthDate,mailDisableMessage,emailforward,mailCallout,mailGreylisting,mailRBL,mailRHSBL,mailWhitelist,mailContentInspectionAction,mailDefaultOptions,facsimileTelephoneNumber,telephoneNumber,postalAddress,postalCode,loginShell,onVacation,latitude,longitude,VoIP,userPassword,sudoPassword,webPassword,rtcPassword,bATVToken
by self write
+ by * break
+
+
+##
+## All ACLs from here on result in a decision. no fall through to later.
+##
+
+# allow authn/z by anyone
+access to attrs=userPassword,sudoPassword,webPassword,rtcPassword,bATVToken
by * compare
-# debian readable
-access to attrs=activity-pgp,activity-from,dnsZoneEntry
- by group="cn=LDAP Administrator,ou=users,@@DN@@" write
- by dn="uid=sshdist,ou=users,@@DN@@" write
+# inaccessible to everybody
+access to attrs=totpSeed
+ by * none
+
+# readable only by self
+access to attrs=sshrsaauthkey
+ by self read
+ by * none
+
+# debian.org readable, authenticated user readable
+access to attrs=activity-pgp,activity-from,c,l,loginShell,onVacation,birthDate,mailDisableMessage,emailforward,mailCallout,mailGreylisting,mailRBL,mailRHSBL,mailWhitelist,mailContentInspectionAction,mailDefaultOptions
by peername.ip=127.0.0.1 read
- by domain=alioth.debian.org none
by domain.subtree=@@DOMAIN@@ read
by dn.regex="uid=.*,ou=users,@@DN@@" read
by * none
-# owner writeable, debian readable, authenticated user readable
-access to attrs=c,l,loginShell,ircNick,labeledURI,icqUIN,jabberJID,onVacation,birthDate,mailDisableMessage,gender,emailforward,mailCallout,mailGreylisting,mailRBL,mailRHSBL,mailWhitelist
- by group="cn=LDAP Administrator,ou=users,@@DN@@" write
- by dn="uid=sshdist,ou=users,@@DN@@" write
- by self write
+# authenticated user readable
+access to attrs=facsimileTelephoneNumber,telephoneNumber,postalAddress,postalCode,privateSub,latitude,longitude,VoIP
by dn.regex="uid=.*,ou=users,@@DN@@" read
- by peername.ip=127.0.0.1 read
- by domain=alioth.debian.org none
- by domain.subtree=@@DOMAIN@@ read
by * none
-# owner writeable, authenticated user readable
-access to attrs=facsimileTelephoneNumber,telephoneNumber,postalAddress,postalCode,loginShell,onVacation,privateSub,latitude,longitude,VoIP
- by group="cn=LDAP Administrator,ou=users,@@DN@@" write
- by dn="uid=sshdist,ou=users,@@DN@@" write
- by self write
- by dn.regex="uid=.*,ou=users,@@DN@@" read
+# rest is globally readable
+access to attrs=access,accountComment,accountStatus,admin,allowedGroups,allowedHost,architecture,bandwidth,cn,comment,dc,description,disk,distribution,dnsTTL,dnsZoneEntry,exportOptions,gecos,gid,gidNumber,homeDirectory,host,hostname,icqUin,ipHostNumber,ircNick,jabberJID,keyFingerPrint,labeledURI,mXRecord,machine,member,memory,mn,objectClass,ou,physicalHost,purpose,shadowExpire,shadowLastChange,shadowMax,shadowMin,shadowWarning,sn,sponsor,sponsor-admin,sshRSAHostKey,status,subGroup,supplementaryGid,uid,uidNumber
+ by * read
+
+access to *
by * none
-# globally readable
+
+database hdb
+directory "/var/lib/ldap-log"
+suffix cn=log
+#
+sizelimit 10000
+
+index reqStart eq
access to *
by group="cn=LDAP Administrator,ou=users,@@DN@@" write
- by dn="uid=sshdist,ou=users,@@DN@@" write
- by * read
+ by dn="uid=sshdist,ou=users,@@DN@@" read
+ by * none
+