How shall PIPs resolve correct attribute values? Which kind of interface should it have to be able to resolve the attribute value? For example, I need to get user roles and in this case I just need to pass an attribute for the user id. Let's now make this task more complicated. What if I have context under which user role might be changed, so a single user id is not enough here. In this case, I need to pass the access level for which we are trying to get the user role.
So on this example we can see, that interface will change every time, and the only suitable one will be that accepts everything.
How are PIP usually implemented in this case?
Update
Example: We have the following hierarchy:
Level 0 1 2
Organization < tenants < documents.
Symbol < means right is a child of the left operand.
User might have role admin or user on each level. If user has admin role on level n then he is able to access anything on this level and level n+1,n+2,n+3.... In the same time user will have role user on all levels n-1, n-2, n-3....
Example:
user admin admin
Organization < tenants < documents
This is the first part. The second part of it is about documents. Let's say, we have a few attributes such as publicTenant and publicDocument. Resolution of each other on different levels are not relevant and also requires knowledge not only of the userId but also the level on which we are working and resource attributes like organizationId, tenantId and documentId to resolve correctly not only role of the user, but also resource attributes.
How can this be implemented correctly in ABAC? Current solution is hybrid with ACL/RBAC/ABAC. ACL and RBAC are hidden under ABAC and used as attributes of subject, but this doesn't feel right.
The following approach is based on XACML model. If you need a solution that better handle cases where some of the resource attributes are missing from requests, let us know. I can update my answer, but the solution is more complex since it adds more checks for empty/undefined attributes.
I use a simplified syntax but you can easily translate to XACML with these few conventions:
The PolicySet would look like this:
PolicySet 'root'
Policy 'Organization Level'
Policy 'Tenant Level'
Policy 'Document level'
For this to work, you would need to implement one or more PIPs to resolve the following subject attributes (you could do everything in one PIP, especially if all the user roles are managed by the same system, it's up to you):
A few comments on the PIP implementation: