Red Hat Bugzilla – Bug 1118014
[RFE] Enhance ACIs to have more control over MODRDN operations
Last modified: 2015-06-03 02:20:57 EDT
This bug is created as a clone of upstream ticket: https://fedorahosted.org/389/ticket/47553 The current ACI implementation is somewhat limited with the way it handles MODRDN operations where newsuperior is used. For example, consider the case where you want to move an entry as follows: uid=tuser,ou=ou1,dc=example,dc=com -> uid=tuser,ou=ou2,dc=example,dc=com To allow someone to perform this operation, they need the "add" permission on "ou=ou2,dc=example,dc=com". This permission would also allow one to add a brand new entry to "ou=ou2,dc=example,dc=com". Certain use cases might want to allow a user to move an entry into a particular portion of the tree, but disallow adding a new entry. We could extend the ACI code to have a new permission for move operations that is separate from the "add" permission. This permission would mean that the target could be used as the destination for a move operation. In addition, it would be nice to be able to control the source for a move operation in ACIs. This would allow one to have an ACI that says "Allow user X to move entries from ou=1 to ou=2". This would likely require a new ACI keyword to specify the source (or multiple sources) for the operation. The destination could likely just use the ACI target.
I have the following ACIs set in the suffix. The modrdn fails with Insufficient access. Please let me know if I am missing something. [root@intel-s3eb1-03 MMR_WINSYNC]# ldapsearch -LLL -x -p 9989 -D "cn=Directory Manager" -w Secret123 -h localhost -b dc=modrdn,dc=com aci dn: dc=modrdn,dc=com aci: (targetattr="userPassword")(version 3.0; acl "Replication Manager Access" ; allow (write,compare) userdn="ldap:///cn=SyncManager,cn=config";) aci: (target ="ldap:///dc=modrdn,dc=com")(targetattr !="userPassword")(version 3.0; acl "Anonymous read-sch access"; allow (read, search, compare)(userdn = "ldap:///anyone");) aci: (target ="ldap:///dc=modrdn,dc=com")(targetattr = "userpassword || teleph onenumber")(version 3.0; acl "Allow self entry modificn";allow (write)(userdn = "ldap:///self");) aci: (target_from="ldap:///ou=People,dc=modrdn,dc=com")(target_to="ldap:///ou= Groups,dc=modrdn,dc=com")(version 3.0; acl "MODDN from"; allow (moddn) userdn ="ldap:///uid=adminaci1,ou=Testing,dc=modrdn,dc=com";) dn: ou=People,dc=modrdn,dc=com aci: (target_from="ldap:///ou=People,dc=modrdn,dc=com")(target_to="ldap:///ou= Groups,dc=modrdn,dc=com")(version 3.0; acl "MODDN from"; allow (moddn) userdn ="ldap:///uid=adminaci1,ou=Testing,dc=modrdn,dc=com";) aci: (target_from="ldap:///uid=*,ou=People,dc=modrdn,dc=com")(target_to="ldap: ///ou=Groups,dc=modrdn,dc=com")(version 3.0; acl "MODDN from"; allow (moddn) userdn="ldap:///uid=adminaci1,ou=Testing,dc=modrdn,dc=com";) [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9989 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 << EOF dn: uid=testusr1,ou=People,dc=modrdn,dc=com changetype: modrdn newrdn: uid=allnewtestaci2 deleteoldrdn: 1 newsuperior: ou=Groups,dc=modrdn,dc=com EOF modifying rdn of entry "uid=testusr1,ou=People,dc=modrdn,dc=com" ldap_rename: Insufficient access (50) [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9989 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 << EOF dn: uid=testusr2,ou=People,dc=modrdn,dc=com changetype: modrdn newrdn: uid=allnewtestaci1 deleteoldrdn: 1 newsuperior: ou=Groups,dc=modrdn,dc=com EOF modifying rdn of entry "uid=testusr2,ou=People,dc=modrdn,dc=com" ldap_rename: Insufficient access (50)
Hello Sankar, Reading your question I did not see what was going wrong and I have to debug it. The test case has two problems: - First the MODDN (ability to move the entry from a subtree to an other) requires an ACI localized above in the tree. So that it covers the source and destination. I moved the following acis at the suffix level: dn: dc=example,dc=com aci: (target_from="ldap:///ou=People,dc=example,dc=com")(target_to="ldap:///ou =Groups,dc=example,dc=com")(version 3.0; acl "MODDN from"; allow (moddn)userd n="ldap:///cn=adminaci,ou=testing,dc=example,dc=com";) aci: (target_from="ldap:///cn=*,ou=People,dc=example,dc=com")(target_to="ldap: ///ou=Groups,dc=example,dc=com")(version 3.0; acl "MODDN from"; allow (moddn) userdn="ldap:///cn=adminaci,ou=testing,dc=example,dc=com";) This was enough to allow the "move" of the entry. But there is a second problem because your test case change the RDN. - The second problem is that you need an extra aci to allow 'cn=adminaci' to 'write' the RDN attribute ('cn' in my test case, while it is 'uid' in your test case). So I added this aci dn: dc=example,dc=com aci: (targetattr="cn")(version 3.0; acl "MODDN write RDN"; allow (read, search , compare, write) userdn="ldap:///cn=adminaci,ou=testing,dc=example,dc=com";) With theses two changes I was able to MOVE+rename the test entry: ldapmodify -h ... -D "cn=adminaci,ou=testing,dc=example,dc=com" -w Secret123 <<EOF dn: cn=testuser,ou=People,dc=example,dc=com changetype: modrdn newrdn: cn=allnewtestuser deleteoldrdn: 1 newsuperior: ou=Groups,dc=example,dc=com EOF
Thanks Thierry for the detailed steps. I tested the following cases with the ACI set as this... aci: (target_from="ldap:///uid=*,ou=People,dc=modrdn,dc=com")(target_to="ldap: ///ou=Groups,dc=modrdn,dc=com")(version 3.0; acl "MODDN from"; allow (moddn) userdn="ldap:///uid=adminaci1,ou=Testing,dc=modrdn,dc=com";) 1. Move users from ou=People to ou=Groups, without changing the RDN of the entry. Result : PASS. [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9189 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 << EOF dn: uid=peopleusr8,ou=People,dc=modrdn,dc=com changetype: modrdn newrdn: uid=peopleusr8 deleteoldrdn: 0 newsuperior: ou=Groups,dc=modrdn,dc=com EOF modifying rdn of entry "uid=peopleusr8,ou=People,dc=modrdn,dc=com" 2. Move users from ou=People to ou=Groups, change the RDN of the entry. Expected to FAIL with error 50. Result : PASS. [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9189 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 << EOF dn: uid=peopleusr7,ou=People,dc=modrdn,dc=com changetype: modrdn newrdn: uid=peopleusr99 deleteoldrdn: 0 newsuperior: ou=Groups,dc=modrdn,dc=com EOF modifying rdn of entry "uid=peopleusr7,ou=People,dc=modrdn,dc=com" ldap_rename: Insufficient access (50) 3. Move users from ou=Groups to ou=People, change the RDN of the entry or without the change of RDN. Expected to FAIL with error 50. Result : PASS. [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9189 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 << EOF dn: uid=peopleusr9,ou=Groups,dc=modrdn,dc=com changetype: modrdn newrdn: uid=peopleusr9 deleteoldrdn: 0 newsuperior: ou=People,dc=modrdn,dc=com EOF modifying rdn of entry "uid=peopleusr9,ou=Groups,dc=modrdn,dc=com" ldap_rename: Insufficient access (50) additional info: Insufficient 'moddn' privilege to move an entry to 'ou=People,dc=modrdn,dc=com'. 4. Add a new entry to ou=People. Expected to FAIL. Result: PASS [root@intel-s3eb1-03 MMR_WINSYNC]# ldapmodify -x -p 9189 -h localhost -D "uid=adminaci1,ou=Testing,dc=modrdn,dc=com" -w Secret123 -avf /tmp/testusr1.ldif > /dev/null ; echo $? ldap_initialize( ldap://localhost:9189 ) ldap_add: Insufficient access (50) additional info: Insufficient 'add' privilege to add the entry 'uid=mmrtestctt333,ou=people,dc=modrdn,dc=com'. 50
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0416.html