Page 1 of 1

Openldap ACLs in slapd.conf

Posted: 2014-11-19 10:45
by spacewan
Hallo Leute,
ich stecke gerade etwas bei den ACLs in slapd.conf von openldap (2.4) fest.
Ein paar Tips für den Durchblick wären toll.

Im Moment sehen meine ACLs so aus:
access to *
by dn="cn=admin,dc=sub,dc=mydomain,dc=de" write
by * read

access to attrs=userPassword,shadowLastChange,sambaPwdLastSet,sambaPwdMustChange,sambaPwdCanChange,shadowMax,shadowExpire
by anonymous auth
by self write
by * none

access to attrs=sambaLmPassword,sambaNtPassword
by anonymous auth
by self write
by * none

#access to attrs=cn,displayName,gecos,gidNumber,mail,uid,uidNumber
# by anonymous auth
# by self write
# by * read

Mit dem auskommentierten Block hier drüber habe ich experimentiert und wollte damit folgendes erreichen:

Ohne Authentifizierung am LDAP Server dürfen nur die Einträge cn,displayName,gecos,gidNumber,mail,uid und uidNumber
gesucht und gelesen werden, alles andere nicht. Natürlich habe ich beim einkommentieren
access to * angepasst und by * read entfernt, dann geht aber garnichts mehr :)

Was mache ich falsch?

Danke und Grüße
Marc

Re: Openldap ACLs in slapd.conf

Posted: 2014-11-20 14:04
by Joe User
Hast Du schon versucht, die Reihenfolge der Blocks zu tauschen?

Code: Select all

access to *
by dn="cn=admin,dc=sub,dc=mydomain,dc=de" write
by * read

access to attrs=cn,displayName,gecos,gidNumber,mail,uid,uidNumber
by anonymous auth
by self write
by * read

access to attrs=userPassword,shadowLastChange,sambaPwdLastSet,sambaPwdMustChange,sambaPwdCanChange,shadowMax,shadowExpire
by anonymous auth
by self write
by * none

access to attrs=sambaLmPassword,sambaNtPassword
by anonymous auth
by self write
by * none
Und wenn ich es richtig verstehe, müssten sich die beiden letzten Blöcke zusammenfassen lassen können:

Code: Select all

access to *
by dn="cn=admin,dc=sub,dc=mydomain,dc=de" write
by * read

access to attrs=cn,displayName,gecos,gidNumber,mail,uid,uidNumber
by anonymous auth
by self write
by * read

access to attrs=userPassword,shadowLastChange,sambaPwdLastSet,sambaPwdMustChange,sambaPwdCanChange,shadowMax,shadowExpire,sambaLmPassword,sambaNtPassword
by anonymous auth
by self write
by * none

PS: Ich kenne mich nicht mit OpenLDAP aus, aber viele Dienste arbeiten Konfigurationen von oben nach unten ab und wenden dabei first-match-wins oder last-match-wins an. Daher sind einfache Unstrukturierungen und das Zusammenfassen manchmal zielführend. Wäre einen Versuch wert.

Re: Openldap ACLs in slapd.conf

Posted: 2014-11-20 15:14
by spacewan
Hi, ja du hattest Recht, ich habs rausgefunden:

access to attrs=userPassword,shadowLastChange,sambaNTPasswor d,sambaPwdLastSet,sambaPwdMustChange,sambaPwdCanCh ange,sambaLmPassword,shadowMax,shadowExpire,object Class,sambaMungedDial,sambaAcctFlags,sambaLogoffTi me,sambaLogonTime,sambaSID,sambaPrimaryGroupSID
by dn="cn=admin,dc=sub,dc=mydomain,dc=de" write
by anonymous auth
by self write
by * none

# The admin dn has full write access, everyone else
# can read everything.
access to *
by dn="cn=admin,dc=sub,dc=mydomain,dc=de" write
by * read

Erst alles verbieten was man nicht will, danach den Rest erlauben

Grüße Marc