【问题标题】:Send several simultaneous actions in one XACML request在一个 XACML 请求中同时发送多个操作
【发布时间】:2014-04-30 13:38:23
【问题描述】:

我们可以在同一个 XACML 请求中指定两个操作吗?

这个问题来自下面的例子。我想做以下事情:

  1. 定义如下策略:U 可以使用资源 D 中的 READ 或 WRITE 函数(策略示例可在 this previous post 获得
  2. 定义如下请求:U 想要使用 READ AND DELETE(或任何其他不允许的操作)
  3. 得到响应:拒绝

所以这是请求:

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">
 <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
  <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="false">
   <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
   <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">delete</AttributeValue>
  </Attribute>
 </Attributes>
 <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
  <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="false">
   <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">u</AttributeValue>
  </Attribute>
 </Attributes>
 <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
  <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="false">
   <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">d</AttributeValue>
  </Attribute>
 </Attributes>
</Request> 

那么问题又来了,我们可以有这样的 XACML 请求吗(即 U 同时请求读取和删除)?

【问题讨论】:

    标签: authorization access-control xacml abac


    【解决方案1】:

    是的..您可以发送两个属性值。但我想,这将导致Permit,因为您的策略是使用string-at-least-one-member-of 函数编写的。这个函数只是验证是否至少有一个匹配。当read 操作匹配时,策略返回Permit。我想,你可以使用subset 函数来实现这一点。请参阅以下政策。这将满足您的要求。

    <Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="test-bis" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides" Version="1.0"> <Target></Target> <Rule Effect="Permit" RuleId="read-or-write"> <Target> <AnyOf> <AllOf> <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">d</AttributeValue> <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> </Match> </AllOf> </AnyOf> </Target> <Condition> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and"> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-subset"> <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue> <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue> </Apply> </Apply> <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">u</AttributeValue> <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> </Apply> </Apply> </Condition> </Rule> <Rule Effect="Deny" RuleId="deny"></Rule> </Policy>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-11
      • 2018-06-17
      • 2016-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多