Access control list for LDAP OU (Organisational Unit) - ldap

I am new to LDAP (currently using OpenLDAP 2.4) and I am struggling to define a ACL entry that will manage the various Access Levels for entries that are child entries of an OU.
The structure is as follows:
cn=user1,ou=users,dc=somedomain,dc=com
cn=user2,ou=users,dc=somedomain,dc=com
This is what I currently have, but when implemented, the children of the OU "users" don't have the access level as required:
access to dn.subtree="ou=users,dc=somedomain,dc=com"
by dn.subtree="ou=users,dc=somedomain,dc=com" read
by * none
I would like to have all the children of the OU to only be able to read the contents of the OU and it's children.
Any help would be greatly appreciated.
Kind regards

Related

Limit LDAP users by OU

To deny a LDAP user, we can use LDAP filter for Common Name i.e., CN as '(!(cn=username))'.
But how to deny by Organizational Unit i.e., OU?
'(!(ou=projectmail))' not working.
I don't want to allow users with ou as projectmail
It's possible to define a filter on the DN attributes, with the following filter:
(ou:dn:=group1).
In your case, you may want to use (!(ou:dn:group1))

LDAP Query to return list of users which contain specific attributes

In this OU=Employees,OU=Users,DC=org,DC=com I have a list of CN (user1, user2, user3. Each CN (user) contains a list of attributes (isUseless, managerid, etc.)
I want to obtain a list of all CN Employees, whos attribute isUseless=Yes.
I've searched all over the web and read countless tutorials, but am struggling to understand probably some basic concepts here. I would really apprecaite if someone could break down the solution for me.
A LDAP Search filter similar to:
(&(isUseless=Yes)(|(cn= user1)(cn= user1)(cn=user1)))
or for all entries with cn values:
(&(isUseless=Yes)(cn=*))
or for all user type entries (in Microsoft Active Directory:
(&(isUseless=Yes)(sAMAccountType=805306368))
Specifying the:
returned attributes: "isUseless" "managerid" "etc"
baseDN: OU=Employees,OU=Users,DC=org,DC=com
Should do the trick.
Let me know how I can help.
-jim

LDAP Filter memberof

Hallo I need help to optimize a LDAP Filter string because the Ldap filter is too long (maximum is 255 characters) for my tool (Foreman).
My LDAP curent Ldap filter
(|
(memberOf=cn=admingoup,ou=groups,OU=admin,DC=xxx,DC=de)
(memberOf=CN=group1,OU=dd,OU=cc,OU=ab,DC=xxx,DC=de)
(memberOf=CN=group2,OU=dd,OU=cc,OU=ab,DC=xxx,DC=de)
)
This work but i need a soultion like
(|
(memberOf=cn=admingoup,ou=groups,OU=admin,DC=xxx,DC=de)
(memberOf=CN=*,OU=dd,OU=cc,OU=ab,DC=xxx,DC=de)
)
I don't think you can work your way out without making modifications on your constraints somewhere :
Allow longer filter in foreman
Modify the LDAP directory to allow substring match on the memberOf attribute
Modify your filter. A way to do it could be :
search base dn : DC=xxx,DC=de
search filter : (&(objectclass=group)(|(cn=admingroup)(cn=group1)(cn=group2))) (This is an example, the point is to match only the group you need, maybe using the entry id if necessary)
attribute retrieve member (or the equivalent)
What it will do is to retrieve all the members of these groups, dupplicate members should not be a probleme for access control I presume

memberOf attribute does not exist when user is in a group (dirsrv, CentOS6.2)

I have a problem adding user in a group using dirsrv, CentOS6.2.
Default schema, have user jmarsden in "People" and created a group into "Groups".
Tried to use any types of the group: groupOfNames, groupOfUniqueNames, posixgroup. Member (uniqueMember or memberUid) is successfully added as attribute.
member=uid=jmarsden,ou=People,dc=mymy,dc=localdomain
But when I fetch operational attributes using Apache Directory Studio there is not memberOf attribute for user jmarsden. Search with filter "memberOf=cn=M"* does not work either.
What am I doing wrong?
memberOf is an attribute that is most often associated with Active Directory.
Many LDAP implementation do not use an attribute on the user to represent which group the users are a member of.
Which LDAP implementation are your using?

ldap query on parent & child entry

My DIT:
dc=mucompany,dc=com
ou=moodlegroups
ou=moodleusers
ou=Students
mail=student1#mail.com
courseCertificate=Type1
courseCertificate=Type2
courseCertificate=Type3
mail=student2#mail.com
courseCertificate=Type1
courseCertificate=Type2
courseCertificate=Type3
the mail=student1#gmail.com entry has the mail as RDN and a bunch of other attributes(cn,sn...also custom attributes) and has like childrens the CourseCertificate=value entres also containing bunch of other attributes(courseCertificateRunning=TRUE,courseCertificateEnding=20120210,...)
I need to make a query that searchs for (&(sn=Brad)(courseRunning=TRUE)) that returns all the attributes of the parent entry and of the child entry that satisfy the filter...
Is this possible with one ldapsearch?
Any help it will means a lot to me, thanks in advance.
P.S. I'm using openldap 2.4, i try to do the queres using AD Studio
LDAP search filters are evaluated against each individual entry, to decide if it must be returned or not. They are not evaluated against a hierarchy of entries.