Goal
- We want to move the ACL checks to the JCR layer
Reasoning
- better performance
- JCR repository can be exposed otherwise (the ACLs are then still taken into account)
- we want to use the JCR API without needing to wrap the objects everywhere
Resources
Conclusion
- we cannot use "Resource-based ACLs". We had to update all the nodes on ACL changes and the permissions are only inherited on creation.
- we will provide a custom AccessControlManager. This is very similar to our current solution, its not tied to the jackrabbit API.
AccessControlManager
API defined by spec is insufficient to control privileges. The control could be done at this level in JackRabbit, but only by overriding JR specific methods.
- we will provide our own privilege provider. Privilege provider is already swappable in both JR and MS as each provides Resource based provider and limited role based provider.
- JR already allows specifying custom privilege provider. MS currently supports only two of its own implementation. We will initiate request to open this to custom implementations.
Milestone 3 Sprint 3 - progress update
- security is now executed in JCR layer
superuser
account is treated as "admin" type account by JCR (JR) giving it all permissions always
MagnoliaAccessProvider
is partially implemented - grants all to superuser, none to anonymous
- ModeShape team is preparing MS 2.5b2 with hooks for extending security same way as possible in JR
- only magnolia jaas chain and security realm exist in JCR configuration
Next Steps
- implement security for ModeShape
- finalize implementation of Access Provider
- refactor
RepositoryAccessStrategy
and WorkspaceAccessUtil
- related to unclosed sessions exceptions
- test and make updates necessary for working with external users/groups
- internal JR "admin" user should be replaced with superuser only, or admin should be locked out more strongly
- test with pur or anything with custom realms
- move supportBase constants to SecurityConstants
{"serverDuration": 76, "requestCorrelationId": "8035d49e8ae9bc18"}
7 Comments
Federico Grilli
Moving ACLs to the JCR level has already been attempted by Openmind's criteria module (http://www.openmindlab.com/lab/products/mgnlcriteria/searchindex.html) According to them, it seems to be a rather tricky thing. In any case, it may be worth having a look at how they tackled the problem and talk with them about it.
Jan Haderka
This doesn't seem to use JCR security, but rather customize the index to take care of the security rules. The problem I see here is that changing security config requires one to force reindexing.
Also it applies only to search i.e. if not having rights to the page it will not appear in the search results, but if you know the path, you can still access it.
Philipp Bärfuss
What we try to do is something completely different.
criteria module: apply the ACLs upon search results in an efficient way. JCR is not aware of the ACLs.
Magnolia 5.0: define the ACLs in the repository so that all operations can use the JCR security. All access to JCR are secured by the repository.
The approach followed by the criteria module just solves a particular use-case because Magnolia doesn't make the ACLs transparent to the repository. Once we do, the criteria module will very well be able to benefit from this change.
Jan Haderka
As of ModeShape 2.4
AccessControlManager
in MSfull transcript of the conversation with MS/Jboss:
Richard Unger
Hi security-architects!
We're having some problems with the current (pre 5.0) implementation of security, and before implementing our own stuff I wanted to get some feedback, if possible, about the future capabilities of Magnolia with regards to security.
Basically, our customer's requirement is for fairly fine-grained security. They can't work with a centrally managed publish and approve process. Each author can publish his/her own work, without a 2 stage workflow. (We have tried arguing against this, but to no avail).
So, to keep control over the site, they want to set permissions, ideally down to the individual page level. This creates massive problems for us with magnolia's current security architecture.
So we can't really offer security at the page level at the moment, instead we create groups and roles, and set the ACLs down to about the 3rd level of the content hierarchy, which is not exactly what the customer wants, but enough for the moment (with promises of future improvement).
With this solution we still have the significant problem that whenever the content-hierarchy is changed (our customer uses "Articles", which are organised in "folders" they call "Categories"), the ACLs lose traction, because they are Path rather than UUID based... unfortunately, adding new or renaming the existing "folders" or "Categories" is something they do frequently, forcing us to update the roles all the time to reflect the new path values in the ACLs.
In my analysis, what we would really need is:
Currently a role needs very many ACEs to cover all the "folders" and "articles" the role is allowed to edit. By setting ACLs on the page-nodes themselves, each page-node will have only a few users allowed to edit it, making for shorter, more manageable lists...
All this is important only on the aithoring side, of course, on the public instance the current security mechanisms are sufficient.
Any ideas or feedback for our situation?
Should we wait for Magnolia 5.0? Are there any components/modules in Magnolia 4.x that could help with our situation? Is there even any chance of getting this working in Magnolia 4.x?
Any insights would be greatly appreciated!
Regards from Vienna,
Richard Unger
Jan Haderka
Hi Richard,
what you describe is almost exactly what the default security model of JCR is and what each repository implementation has to provide - the access permissions are stored as part of the node itself.
In 5.0 we are moving security layer to JCR so you should be able to switch off Magnolia AccessProvider and use default AccessProvider shipped with repository. You would still need (most likely) write your own ui code for setting those permissions (we don't have it for 5.0 yes, which is why I don't know how closely we can use JR API for that). However you would get the implementation of permission checking for free. One of the reasons why MAgnolia doesn't use this model is the fact that to check permissions you need to access the node and this effectively renders caching useless, but recent versions of JR have provided some caching at this level as well so the impact might not be so high these days.
We will try to keep your need in mind and make sure that if possible you can switch provider with minimal effort.
Regards,
Jan
Richard Unger
Thank you for your response!
We will take this into account in our planning. I really hope we pursuade our customer to choose a more reasonable approach to security, but if not then I will try to argue that we need to wait for Magnolia 5.0 for this feature.
Regards,
Richard