Bug 921162 - Possible to add nonexistent target to ACI
Summary: Possible to add nonexistent target to ACI
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
low
unspecified
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-13 15:21 UTC by Ján Rusnačko
Modified: 2015-03-05 09:30 UTC (History)
3 users (show)

Fixed In Version: 389-ds-base-1.3.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 09:30:21 UTC
Target Upstream Version:


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 Ján Rusnačko 2013-03-13 15:21:15 UTC
Description of problem:
ACI acts as access control mechanism. The "target" part of ACI can be used to specify, to which entry this ACI applies. If the target is not specified, the ACI applies to the entry containing the aci attribute and to the entries below it. 

Currently, it is possible to add non-existent entry as target and ACI is accepted by DS.

Version-Release number of selected component (if applicable):
389-ds-base-1.2.11.15-12.el6_4.i686

How reproducible:
always

Steps to Reproduce:
[jrusnack@dhcp-31-42 /]$ ldapmodify  -h 192.168.122.188 -p 389 -D "cn=directory manager" -w Secret123 <<EOF
dn: dc=example,dc=com
changetype: modify
add: aci
aci: (targetattr != "userPassword") (target = "ldap:///ou=invalid,dc=example,dc=com") (version 3.0;acl "Enable anonymous access";allow (read,compare,search)(userdn = "ldap:///anyone");)
EOF

[jrusnack@dhcp-31-42 /]$ echo $?
0

Actual results:
ACI is accepted.

Expected results:
DS should indicate that ACI applies to non-existent entry.

Comment 1 Nathan Kinder 2013-03-13 17:15:16 UTC
I'm not sure if this is something that we should change.  With the current behavior, one can create an ACI for a target that doesn't exist yet, but they may add the target later.  I don't see much downside to this other then the following:

  - If you make a typo in the target, you might not notice it unless you
    test the new ACI.

  - There is an extra ACI to evaluate that will never match any target.

If we decide to change the behavior, we have a few options:

  - Reject an ACI with a non-existent target, but this would prevent
    someone from pre-creating their ACIs for targets that will be added
    later.

  - Return/log a warning when an ACI is added with a non-existent target,
    but allow the operation to go through.  The problem with this is that
    I'm not sure if most LDAP clients will not display the error message
    since the result code is 0.  It is also not likely that the person
    adding the ACI will then check the errors log.

Comment 3 Sankar Ramalingam 2013-03-14 07:49:28 UTC
(In reply to comment #1)
> I'm not sure if this is something that we should change.  With the current
> behavior, one can create an ACI for a target that doesn't exist yet, but
> they may add the target later.  I don't see much downside to this other then
> the following:
> 
>   - If you make a typo in the target, you might not notice it unless you
>     test the new ACI.
> 
>   - There is an extra ACI to evaluate that will never match any target.
> 
> If we decide to change the behavior, we have a few options:
> 
>   - Reject an ACI with a non-existent target, but this would prevent
>     someone from pre-creating their ACIs for targets that will be added
>     later.
> 
>   - Return/log a warning when an ACI is added with a non-existent target,
>     but allow the operation to go through.  The problem with this is that
>     I'm not sure if most LDAP clients will not display the error message
>     since the result code is 0.  It is also not likely that the person
>     adding the ACI will then check the errors log.

Logging an error/warning message might be helpful when the user finds that one of the ACI is not working. I am sure most of the users/customers will look at the error logs when something stops working or not working as expected. But, I agree that it deoesn't require a validation on the fly considering that the target might be created a later point of time.

Comment 4 Nathan Kinder 2013-03-17 18:55:09 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/626

Comment 6 Sankar Ramalingam 2014-12-01 04:48:55 UTC
Invalid ACI throws error message in the logs.

[root@vm-idm-035 ~]# ldapmodify -x -p 1189 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: dc=example,dc=com
> changetype: modify
> add: aci
> aci: (targetattr != "userPassword") (target = "ldap:///ou=invalid,dc=example,dc=com") (version 3.0;acl "Enable anonymous access";allow (read,compare,search)(userdn = "ldap:///anyone");)
> EOF
modifying entry "dc=example,dc=com"


==> /var/log/dirsrv/slapd-M1/errors <==
[01/Dec/2014:10:09:11 +051800] NSACLPlugin - The ACL target ou=invalid,dc=example,dc=com does not exist

Comment 8 errata-xmlrpc 2015-03-05 09:30:21 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.