简体   繁体   English

XACML策略中的分层属性

[英]Hierarchical attributes in XACML Policy

We are using WSO2 Identity Server 5.1.0 . 我们正在使用WSO2 Identity Server 5.1.0。

We have a location hierarchy like Plant1->Area1->unit1. 我们有一个类似于Plant1-> Area1-> unit1的位置层次结构。 Now if a user is having attribute for the Plant1, he should get access to unit1 as well (all children of the parent in a tree). 现在,如果用户具有Plant1的属性,那么他也应该可以访问unit1(树中父级的所有子级)。

Can we specify this in XACML? 我们可以在XACML中指定吗? We have the hierarchy stored in DB. 我们将层次结构存储在数据库中。 We can provide the list of hierarchical elements as a list of attributes also if so required. 如果需要,我们也可以提供层次结构元素列表作为属性列表。

Problem explained in sample : A user bob has been given access to area2 as shown below : 样本中说明的问题:用户鲍勃已被授予对area2的访问权限,如下所示:

Plant1 Plant1

|--Area1 | --Area1

     |--Unit1

|--Area2 | --Area2

     |--Unit2

We want to specify the Area2 location in XACML policy. 我们要在XACML策略中指定Area2位置。 Now if the request with area2 or unit2 comes that should be permitted while if the request with plant1, area1 or unit1 comes that should get denied. 现在,如果带有area2或unit2的请求应被允许,而如果带有plant1,area1或unit1的请求应被拒绝。

I need the structure for XACML policy. 我需要XACML策略的结构。

You can implement this with a custom PIP (Policy Information Point, aka Attribute Provider) in XACML implementations like AuthzForce . 您可以在AuthzForce之类的XACML实现中使用自定义的PIP(策略信息点,也称为属性提供程序)来实现该功能 I don't know WSO2 IS as much but according to the doc, it is also extensible with custom PIPs , so I assume this should do the trick. 我不太了解WSO2,但是根据文档,它可以通过自定义PIP进行扩展,所以我认为这应该可以解决问题。

The idea is that in the XACML Policy, you use an AttributeDesignator with a custom AttributeId to indicate that the top parent value in the hierarchy of some attribute is requested, eg AttributeId = resource-id-parent for the parent value of resource-id attribute value. 这个想法是,在XACML策略中,您使用带有自定义AttributeId的AttributeDesignator来指示请求某个属性的层次结构中的顶级父值,例如AttributeId = resource-id-parent表示resource-id属性的父值值。

What your custom PIP does: when this custom attribute id resource-id-parent is requested, the PIP gets the value of the attribute resource-id from the request, ie "area2" or "unit2", then gets the corresponding top value in the hierarchy from your DB (or all the values above if you will) and return it as bag. 您的自定义PIP的作用:当请求此自定义属性ID resource-id-parent时 ,PIP从请求中获取属性resource-id的值,即“ area2”或“ unit2”,然后在其中获取相应的最高值。数据库中的层次结构(如果需要,也可以包含以上所有值),然后将其作为包返回。 Then, in the XACML Policy, you can use string-equal in a Match or string-at-least-one-member-of in a Condition to match the AttributeDesignator with "area2" (remember an AttributeDesignator always evaluate to a bag). 然后,在XACML策略中,可以在Match中使用字符串等于或在条件中使用字符串至少为一个成员,以将AttributeDesignator与“ area2”进行匹配(请记住,AttributeDesignator始终求值到包中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM