Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 56078 invoked from network); 30 Jan 2009 21:08:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2009 21:08:27 -0000 Received: (qmail 18031 invoked by uid 500); 30 Jan 2009 21:08:26 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 17994 invoked by uid 500); 30 Jan 2009 21:08:26 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 17985 invoked by uid 99); 30 Jan 2009 21:08:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jan 2009 13:08:26 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of akarasulu@gmail.com designates 209.85.200.174 as permitted sender) Received: from [209.85.200.174] (HELO wf-out-1314.google.com) (209.85.200.174) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jan 2009 21:08:18 +0000 Received: by wf-out-1314.google.com with SMTP id 27so695983wfd.31 for ; Fri, 30 Jan 2009 13:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=p/R7PFMoeaG+UUJZ/hxMLhLA50/D2R796uZYapukQCM=; b=vyyNzir8hAOY8Cs9r3/R8NtqlsxdqAYE7KFjqlcnOgNsUBm+mujnnsPpnuXs21ISi+ yNhphhjT6olpDyxhqJCSWUfHPex9o5H9dWQPF5z1r13sVbC3JsZjjkWVO+BSk6LdQsn6 jpjsNJcba+O5yWEKl3/4m+RMJn40XSM1IVOyI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=mgfQcLzl9SPkshQHgSsdmDLKiZgPxh9UT0mxBhDoyaEZm25f8g4ghRqZCp5Iws7JRl YmNeb1fsRtFJSPhQyT8qRsfr0MMPQyXuS8kPWSwqJlBbLmf5Wh25WBnoT5F0+8aF/WKH 2tvpwoHndRfjwuMpr4Mbal7wDTlhrIyhmIrMY= MIME-Version: 1.0 Sender: akarasulu@gmail.com Received: by 10.143.7.5 with SMTP id k5mr649163wfi.176.1233349676591; Fri, 30 Jan 2009 13:07:56 -0800 (PST) Date: Fri, 30 Jan 2009 16:07:56 -0500 X-Google-Sender-Auth: b324577a33bdf9c6 Message-ID: Subject: [ApacheDS] [RFC 4370] Why we should implement the "Proxied Authorization Control" From: Alex Karasulu To: Apache Directory Developers List Content-Type: multipart/alternative; boundary=001636e0a8845b6c250461b99907 X-Virus-Checked: Checked by ClamAV on apache.org --001636e0a8845b6c250461b99907 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi folks, Lately we've been thinking about disaster recovery and leveraging the change log to recover from partition corruption. We've also mixed into the fray the idea of building up a replica after a nascent server is added to a cluster. We also spoke about applying the changes in the CL of one server to bring a fresh server to some previous state. In all these cases, and a couple more below, - exporting then reimporting - connection pooling there is a distinct need to preserve the identity information associated with the creatorsName and the modifiersName. In the above examples, the server internally must apply changes in the change log as the identity of the creator and modifier. In most cases timestamps should also be preserved. Internally this is easy to do with ApacheDS' API. However it is not so easy when changes are coming from outside of the server. For example when bringing a new replica into a cluster and loading it with entries it's very hard to preserve the values of these operational attributes. Currest State ------------------- Some leg work was done to be able to implement a "RunAs" capability in ApacheDS. An autorizedPrincipal property and effectivePrincipal was added to all operation contexts [0] via a base class. The authenticatedPrincipal and yet another effectivePrincipal is accessible via the CoreSession [1]. The DefaultAuthorizationInterceptor [2] was indirectly modified via it's base class, BaseInterceptor [3], to leverage the effectivePrincipal. There needs to be some clarification here as to what all this is about. A session must have an authenticated principal and my optionally have an authorized principal. The authenticated principal is the principal whose credentials were provided to bind after establishing the session. The authorized principal is another identity associated with the session rather than with an individual request. There are, I believe, SASL mechanisms that would set this authorized principal. When this is the case, operations should be performed as the authorized user. Hence the getEffectivePrincipal() method on the CoreSession checks if an authorized principal exists and returns that or in it's absence returns the authenticated principal. AbstractOperationContext [0], also contains an authorized principal and has access to the CoreSession. These operation contexts represent requests being processed. Eventually with the proxied authorization control implemented, this authorized principal will be populated when the control is used to issue requests. The effectivePrincipal() method on OperationContexts will return the authorized principal when it is set at the request level. If it has not been set then the session.getEffectivePrincipal() value is returned by a context. Need for Controls ------------------------- There is really very little work that remains to implement this great control. It's great because it facilitates a single connection to issue requests as another user. This is obviously a huge plus when dealing with connection pooling. But more importantly it's a plus when dealing with bringing a replica online and up to speed with the contents of it's peers in a cluster. It will allow the a user with the proper authorization power to write entries to the DIT with the identity that was originally used to perform the operation hence preserving the creatorsName and the modifiersName. This is important to do since these attributes can impact auditing, and access controls [4]. Likewise we should preserve modifyTimestamp and the createTimestamp operational attribute. There is no specification for doing this as far as I know but a control which carries with it the timestamps to use can be very useful here. Perhaps this is also something we can explore. Now all these operationalAttributes have the directoryOperation USAGE and not distributedOperation or dSAOperation. This is somewhat confusing. If the dSAOperation were used then that would tell us that these values can be different for each server. If distributedOperation was used then it's something I would imagine would need to be the same across replicas. Although confusing I think these operational attributes must line up across replicas in the cluster otherwise you have divergence. Stored Procedures and Triggers ---------------------------------------------- When we get the SP and trigger story right, the RunAs code will come in very handy. For example, an administrator installs a trigger to fire a SP whenever an entry is deleted in some region of the DIT. The SP updates groups by removing references to the deleted entry. The groups are protected from ACI to prevent anyone but the administrator to make changes. When a normal user raises the trigger, that trigger will need to execute the SP with the authorization rights of the administrator. The procedure will then execute as the administrator. Summary -------------- This control as well as another to support the preservation of timestamps is needed to do several things correctly. Thankfully we already have some foundation to build on so their implementation would not be that involved. Thanks, Alex ------------------- [0] - http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?revision=702434&view=markup [1] - http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.java?revision=725712&view=markup [2] - http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?view=log [3] - http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?revision=702434&view=markup [4] - Nothing in ApacheDS exists yet to leverage the creatorsName or the modifiersName to conduct access decisions --001636e0a8845b6c250461b99907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi folks,

Lately we've been thinking about disaster recovery and= leveraging the change log to recover from partition corruption. We've = also mixed into the fray the idea of building up a replica after a nascent = server is added to a cluster.  We also spoke about applying the change= s in the CL of one server to bring a fresh server to some previous state.
In all these cases, and a couple more below,
       - exporting then reimporting
   - connection pooling


there is a distinct need to preserve the identity information assoc= iated with the creatorsName and the modifiersName. In the above examples, t= he server internally must apply changes in the change log as the identity o= f the creator and modifier.  In most cases timestamps should also be p= reserved. Internally this is easy to do with ApacheDS' API. However it = is not so easy when changes are coming from outside of the server.  Fo= r example when bringing a new replica into a cluster and loading it with en= tries it's very hard to preserve the values of these operational attrib= utes.

Currest State
-------------------

Some leg work was done to b= e able to implement a "RunAs" capability in ApacheDS. An autorize= dPrincipal property and effectivePrincipal was added to all operation conte= xts [0] via a base class.  The authenticatedPrincipal and yet another = effectivePrincipal is accessible via the CoreSession [1]. The DefaultAuthor= izationInterceptor [2] was indirectly modified via it's base class, Bas= eInterceptor [3], to leverage the effectivePrincipal.

There needs to be some clarification here as to what all this is about.= A session must have an authenticated principal and my optionally have an a= uthorized principal. The authenticated principal is the principal whose cre= dentials were provided to bind after establishing the session.  The au= thorized principal is another identity associated with the session rather t= han with an individual request. There are, I believe, SASL mechanisms that = would set this authorized principal. When this is the case, operations shou= ld be performed as the authorized user.  Hence the getEffectivePrincip= al() method on the CoreSession checks if an authorized principal exists and= returns that or in it's absence returns the authenticated principal.
AbstractOperationContext [0], also contains an authorized principal and= has access to the CoreSession. These operation contexts represent requests= being processed. Eventually with the proxied authorization control impleme= nted, this authorized principal will be populated when the control is used = to issue requests. The effectivePrincipal() method on OperationContexts wil= l return the authorized principal when it is set at the request level. If i= t has not been set then the session.getEffectivePrincipal() value is return= ed by a context.

Need for Controls
-------------------------

There is really v= ery little work that remains to implement this great control. It's grea= t because it facilitates a single connection to issue requests as another u= ser.  This is obviously a huge plus when dealing with connection pooli= ng. But more importantly it's a plus when dealing with bringing a repli= ca online and up to speed with the contents of it's peers in a cluster.=   It will allow the a user with the proper authorization power to writ= e entries to the DIT with the identity that was originally used to perform = the operation hence preserving the creatorsName and the modifiersName. = ; This is important to do since these attributes can impact auditing, and a= ccess controls [4].

Likewise we should preserve modifyTimestamp and the createTimestamp ope= rational attribute.  There is no specification for doing this as far a= s I know but a control which carries with it the timestamps to use can be v= ery useful here.  Perhaps this is also something we can explore.

Now all these operationalAttributes have the directoryOperation USAGE a= nd not distributedOperation or dSAOperation. This is somewhat confusing.&nb= sp; If the dSAOperation were used then that would tell us that these values= can be different for each server.  If distributedOperation was used t= hen it's something I would imagine would need to be the same across rep= licas.  Although confusing I think these operational attributes must l= ine up across replicas in the cluster otherwise you have divergence.

Stored Procedures and Triggers
-------------------------------------= ---------

When we get the SP and trigger story right, the RunAs code= will come in very handy. For example, an administrator installs a trigger = to fire a SP whenever an entry is deleted in some region of the DIT. The SP= updates groups by removing references to the deleted entry.  The grou= ps are protected from ACI to prevent anyone but the administrator to make c= hanges.  When a normal user raises the trigger, that trigger will need= to execute the SP with the authorization rights of the administrator. = ; The procedure will then execute as the administrator.

Summary
--------------

This control as well as another to sup= port the preservation of timestamps is needed to do several things correctl= y.  Thankfully we already have some foundation to build on so their im= plementation would not be that involved.


Thanks,
Alex

-------------------
[0] - http://svn.apache.org/viewvc/directo= ry/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/inter= ceptor/context/AbstractOperationContext.java?revision=3D702434&view=3Dm= arkup
[1] - http://svn.apache.org/viewvc/directory/apached= s/trunk/core/src/main/java/org/apache/directory/server/core/CoreSession.jav= a?revision=3D725712&view=3Dmarkup
[2] - http://svn.apache.org/viewvc/directory/apacheds= /trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAut= horizationInterceptor.java?view=3Dlog
[3] - http://svn.apache.org/viewvc/dir= ectory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/i= nterceptor/BaseInterceptor.java?revision=3D702434&view=3Dmarkup
[4] - Nothing in ApacheDS exists yet to leverage the creatorsName or the mo= difiersName to conduct access decisions
--001636e0a8845b6c250461b99907--