【发布时间】:2019-08-11 04:41:57
【问题描述】:
如何评估 XACML 2.0 中的多值属性?我有以下 XACML 2.0 政策和要求。如果用户具有超级管理员的角色,他将获得许可。在同一主题属性中具有多个角色作为<AttributeValue> 元素,仅检索第一个<AttributeValue> 元素进行评估。如何获取和检查我的策略中的所有这些值?
政策
<Policy xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os" PolicyId="a-user-role-policy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
<Description>Sample XACML Authorization Policy</Description>
<Target></Target>
<Rule Effect="Permit" RuleId="primary-group-rule">
<Target>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
<ActionAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"></ActionAttributeDesignator>
</ActionMatch>
</Action>
</Actions>
</Target>
<Condition>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of">
<Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"></Function>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">super-admin</AttributeValue>
<SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"></SubjectAttributeDesignator>
</Apply>
</Condition>
</Rule>
<Rule Effect="Deny" RuleId="deny-rule"></Rule>
</Policy>
请求
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Subject>
<Attribute AttributeId="group"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>admin</AttributeValue>
<AttributeValue>super-admin</AttributeValue>
</Attribute>
</Subject>
<Resource>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>http://localhost:8280/services/echo/</AttributeValue>
</Attribute>
</Resource>
<Action>
<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
DataType="http://www.w3.org/2001/XMLSchema#string">
<AttributeValue>read</AttributeValue>
</Attribute>
</Action>
<Environment />
</Request>
【问题讨论】:
-
你用的是什么引擎?
-
你应该切换到 AuthZForce(开源)或 Axiomatics(商业)
-
我正在使用 WSO2 身份服务器 5.4.1。
-
嗯,他们应该没问题,现在也在 XACML 3.0 上
-
它工作正常,当我将
列表拆分为单独的 元素时,每个元素都有一个 。
标签: authorization access-control xacml abac xacml2