Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A5A17995 for ; Thu, 6 Oct 2011 08:30:48 +0000 (UTC) Received: (qmail 6080 invoked by uid 500); 6 Oct 2011 08:30:48 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 6043 invoked by uid 500); 6 Oct 2011 08:30:47 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 6035 invoked by uid 99); 6 Oct 2011 08:30:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 08:30:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of markus.joschko@gmail.com designates 209.85.213.170 as permitted sender) Received: from [209.85.213.170] (HELO mail-yx0-f170.google.com) (209.85.213.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 08:30:43 +0000 Received: by yxi13 with SMTP id 13so4528383yxi.1 for ; Thu, 06 Oct 2011 01:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=mDDFQZnBFIdKt5nBMDTdrpCgg28LCR1kUaRD3MCvuPw=; b=WyORBDwrFfOwkh3NvhgMDFRA1eJJLS2pmJYSe8AWf/Pt1OmpW6lSpVx8v943xVM0Ut yYqbo2PdxcRMYkxdPi4zctSH/ladzlV1qLQBDgt5jhk7e0i/LsMahA8QDP78oVfB1oqd jdNBhRQMXn8ColoE738WAx8fIG/d0E4lAqnFg= MIME-Version: 1.0 Received: by 10.236.144.136 with SMTP id n8mr1965485yhj.12.1317889822100; Thu, 06 Oct 2011 01:30:22 -0700 (PDT) Received: by 10.236.103.19 with HTTP; Thu, 6 Oct 2011 01:30:22 -0700 (PDT) In-Reply-To: <4E8D63EE.6050104@adobe.com> References: <4E8B265D.1010707@adobe.com> <4E8C4200.7080609@adobe.com> <4E8D63EE.6050104@adobe.com> Date: Thu, 6 Oct 2011 10:30:22 +0200 Message-ID: Subject: Re: ACLs, GlobPattern and move From: Markus Joschko To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Angela, I already voted for it. As we need to protect properties on nodes that are frequently moved that is a real blocker. Regards, Markus On Thu, Oct 6, 2011 at 10:16 AM, Angela Schreiber wrote= : > hi markus > > it's actually as i suspected. in fact this is not an issue with > restrictions but a general problem. anyway: i created JCR-3095 > to follow up on this. > > regards > angela > > [1] https://issues.apache.org/jira/browse/JCR-3095 > > On 10/5/11 1:39 PM, Angela Schreiber wrote: >> >> hi markus >> >> thanks for the tests. i will take a closer look and provide feedback as >> soon as possible. >> regards >> angela >> >> On 10/5/11 12:41 PM, Markus Joschko wrote: >>> >>> Hi Angela, >>> I wrote two methods to demonstrate the behaviour: >>> https://gist.github.com/1261791#file_write_test.java >>> The two tests can simply be pasted into the WriteTest. They differ >>> from the other tests as they don't test for write but for read >>> privileges. >>> >>> Both tests differ in just one line and both fail at the moment. >>> The first test fails at the privilege check after the move. >>> The second test fails already at the nodeExists check one line above. >>> >>> assertFalse(testSession.nodeExists(movedchildchildPath)); >>> assertFalse(testAcMgr.hasPrivileges(movedchildchildPath, read)); >>> >>> This is because in the second test the childchildPath is not tested >>> with nodeExists BEFOR the move. >>> >>> So if nodeExists is checked on the node before the move, it succeeds >>> also after the move. >>> If it is not tested before the move, it fails after the move. >>> >>> This is one of the oddities that drove me crazy. >>> >>> Regards, >>> =A0 Markus >>> >>> >>> On Tue, Oct 4, 2011 at 5:29 PM, Angela Schreiber >>> wrote: >>>> >>>> hi markus >>>> >>>> regarding caches: >>>> >>>> there are multiple caches involved but they should be cleared >>>> or adjusted upon access control modifications i.e. adding, >>>> removing or modification of an policy node. >>>> one thing i can think of without taking a closer look at was >>>> that the move operation of a parent node does not trigger an event >>>> for those event-listeners that are interested in ac-modification >>>> in order to keep the caches up to date... >>>> >>>> to help us verify that a simple test case would be helpful. >>>> you could e.g. add it to >>>> org.apache.jackrabbit.core.security.authorization.acl.WriteTest >>>> >>>> regarding crx vs jackrabbit: >>>> >>>> there is not difference in ac evaluation between crx and jackrabbit. >>>> >>>> regarding alex' comment ("AFAIK if you change permissions, they will >>>> only >>>> apply to newly created sessions."): >>>> >>>> that's not the case. >>>> >>>> regards >>>> angela >>>> >>>> >>>> On 10/4/11 4:52 PM, Markus Joschko wrote: >>>>> >>>>> OK. =A0I now urgently need somebody to have a look at it. There must = be >>>>> something wrong with my test, as the results is otherwise quite >>>>> discouraging. >>>>> Even without a davex client in the mix. >>>>> >>>>> I uploaded a very simple Testservlet to >>>>> https://gist.github.com/1261791 which can be installed in the >>>>> jackrabbit-webapplication to make it easier to follow my experiments. >>>>> The basic idea is to restrict read access to a subnode =A0and a prope= rty >>>>> via rep:glob entries. The setup looks like that: >>>>> >>>>> /test1 =A0 =A0 =A0 =A0 =A0 =A0 =A0-> =A0 =A0 visible >>>>> /test1/second =A0-> =A0 =A0 visible >>>>> /test1/sub =A0 =A0 =A0 -> =A0 =A0 hidden >>>>> /test1/hidden =A0 -> =A0 =A0 hidden >>>>> >>>>> To get there, install the servlet and call setup on it (performed as >>>>> admin): action=3Dsetup >>>>> >>>>> Next is to verify that the setup works as expected (performed as >>>>> user1): action=3Ddump >>>>> That should show the following output (only visible nodes are listed)= : >>>>> >>>>> /test1 readable: OK >>>>> /test1/second readable: OK >>>>> >>>>> Now do a move (admin): action=3Dmove&src=3D/test1&dest=3D/test2 >>>>> >>>>> Verify that the moved nodes subnodes visibility is correct (user1 >>>>> session still open and used): >>>>> >>>>> /test2 readable: nt:unstructured: OK >>>>> /test2/second readable: nt:unstructured: OK >>>>> >>>>> Fine until now. Next is to try a new session of user1. Logout user1: >>>>> action=3Dlogout >>>>> >>>>> And login&dump again: action=3Ddump >>>>> >>>>> /test2 readable: nt:unstructured: OK >>>>> /test2/second readable: nt:unstructured: OK >>>>> /test2/hidden readable: secret: ERROR! >>>>> /test2/sub readable: nt:unstructured: ERROR! >>>>> >>>>> Why is that? And why is it only happen after relogin? >>>>> >>>>> Thanks, >>>>> =A0 Markus >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Fri, Sep 30, 2011 at 6:00 PM, Alexander Klimetschek >>>>> =A0 =A0 wrote: >>>>>> >>>>>> On 30.09.11 15:48, "Markus Joschko" >>>>>> wrote: >>>>>>> >>>>>>> I am not completely sure on this. At the moment I am totally confus= ed >>>>>>> about the behavior. >>>>>>> With a mix of davex client and serverside sessions I've seen the >>>>>>> described leakage: Only for newly created sessions the acls applied= . >>>>>>> >>>>>>> On the other hand I just have written a test that works solely with >>>>>>> an >>>>>>> embedded jackrabbit and two sessions (admin& =A0 =A0 user) and here >>>>>>> security >>>>>>> seems to apply immediately on move, no leakage. >>>>>> >>>>>> If you use Workspace.move() that this is working outside of a sessio= n >>>>>> (no >>>>>> session.save() needed), i.e. acts like a new session. >>>>>> >>>>>>> Should it really only work with newly created session then that is >>>>>>> IMO >>>>>>> a security risk. >>>>>> >>>>>> Hmm, yes, maybe I am wrong :-) >>>>>> >>>>>>> In a setup like /departmentA/topsecret where topsecret is denied in >>>>>>> rep:glob, topsecret should certainly not be visible to anyone even >>>>>>> when the department is moved to /departmentB. >>>>>> >>>>>> Yes. >>>>>> >>>>>> Alex >>>>>> >>>>>> -- >>>>>> Alexander Klimetschek >>>>>> Developer // Adobe (Day) // Berlin - Basel >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>> >