Отправить несколько одновременных действий в одном запросе XACML

Можем ли мы указать два действия в одном запросе XACML?

Этот вопрос исходит из следующего примера. Я хочу сделать следующее:

  1. Определите политику, например: U может использовать функции READ OR WRITE из ресурса D (пример политики доступен по адресу this предыдущий пост
  2. Определите запрос, например: U хочет использовать READ AND DELETE (или любые другие неразрешенные действия)
  3. Получить в ответ: Denial

Итак, вот запрос:

<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 запрашивает чтение и удаление одновременно)?


person Mohamed Sellami    schedule 30.04.2014    source источник


Ответы (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>

person Asela    schedule 30.04.2014