嗨,我正在使用XACML 3.0策略,我的场景是:
策略基于多个资源,单个规则将包含与该特定资源对应的多个资源和操作,如以下场景所述:
政策:
Resources:
firstname
lastname
email
规则1:
Action:
firstname : {create, read}
lastname : {delete, update, create}
email : {read}
并且该用户组允许的角色组是admin。
规则1:的作用
admin
如何实现此策略以及相同的请求格式。
您可以创建目标为资源和操作的组合的策略,以及在角色为管理员的情况下具有许可效果的规则1。
如果你想同时对多个资源执行操作,那么在这种情况下,你可以选择多个决策配置文件,在那里你可以发送单个请求,在单个响应中获得多个资源的策略决策。
策略的伪代码如下:
Policy1 Start
-Target Start
--(Resource is firstname) and ((action is create) or (action is read))
OR
--(Resource is lastname) and ((action is delete) or (action is update) or (action is create))
OR
--(Resource is email) and (action is read)
-Target End
-Rule1 with effect Permit
--Role is admin
-Rule1 End
-Policy1 End