Openldap ACLs in slapd.conf

Serverdienste ohne eigene Kategorie
spacewan
Posts: 5
Joined: 2007-10-09 12:25
 

Openldap ACLs in slapd.conf

Post 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
User avatar
Joe User
Project Manager
Project Manager
Posts: 11190
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Openldap ACLs in slapd.conf

Post 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.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
spacewan
Posts: 5
Joined: 2007-10-09 12:25
 

Re: Openldap ACLs in slapd.conf

Post 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