Bug 1118014 - [RFE] Enhance ACIs to have more control over MODRDN operations
Summary: [RFE] Enhance ACIs to have more control over MODRDN operations
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
Aneta Šteflová Petrová
URL:
Whiteboard:
Depends On:
Blocks: 1185062
TreeView+ depends on / blocked
 
Reported: 2014-07-09 20:47 UTC by Noriko Hosoi
Modified: 2015-06-03 06:20 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-1.3.3.1-1.el7
Doc Type: Enhancement
Doc Text:
ACIs offer better control over the MODDN and MODRDN operations With the enhanced Access Control Instructions (ACIs), it is possible to define a source tree and a destination tree, allow or deny the MODDN and MODRDN operations, and also specify the source and destination targets in the same ACI. As a result, you can, for example, enable users to move an entry from one part of the tree to another, but at the same time forbid them to move an entry from or to other parts of the tree. You can also forbid users to delete or add entries.
Clone Of:
Environment:
Last Closed: 2015-03-05 09:35:59 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0416 normal SHIPPED_LIVE Important: 389-ds-base security, bug fix, and enhancement update 2015-03-05 14:26:33 UTC

Description Noriko Hosoi 2014-07-09 20:47:13 UTC
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.

Comment 4 Sankar Ramalingam 2015-01-27 12:18:40 UTC
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)

Comment 5 thierry bordaz 2015-01-28 09:50:51 UTC
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

Comment 6 Sankar Ramalingam 2015-01-28 13:46:33 UTC
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

Comment 8 errata-xmlrpc 2015-03-05 09:35:59 UTC
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


Note You need to log in before you can comment on or make changes to this bug.