2016-10-27 7 views
1

AdviceまたはObligation文字列をXACMLレスポンスに返す方法は、評価(たとえば環境)で使用される属性に応じて動的に生成されますか?ポリシーまたはルールで動的にXACMLアドバイス文字列を生成する

たとえば、ロジックを実装する拡張モジュールを介して。

+0

あなたはより具体的なことはできますか? –

+0

アイデアは、すべての人にルールを定義することなく、ユーザーに依存した特定のアドバイスを生成することです。これがはっきりしているかどうかは不明です。 – Hos

答えて

2

XACML 3.0では、ObligationAdviceの要素に属性の割り当てを含めることができます。属性割り当ては、静的値または動的値で埋められるプレースホルダです。別のXACML属性から来る値。例えば、我々は(表記用い - Axiomatics Language for Authorization)以下を有することができる:

  • com.axiomatics.examples.message:このプレースホルダこの例で

    obligation notifyManager = "com.axiomatics.examples.notification.notifyManager" 
    policy accessDocs{ 
        apply firstApplicable 
        rule denyOutOfOffice{ 
         target clause currentTime>"17:00:00":time or currentTime<"09:00:00":time 
         deny 
         on deny{ 
          obligation notifyManager{ 
           com.axiomatics.examples.message = "You cannot access anything outside office hours" 
           com.axiomatics.examples.user.managerEmail = com.axiomatics.examples.user.managerEmail 
          } 
         } 
        }   
    } 
    

    を、義務は2つのプレースホルダを有しています静的な値を含んでいます。

  • com.axiomatics.examples.user.managerEmail:このプレースホルダには動的値が含まれています。

機能は、プレースホルダなどで使用できます。文字列連結。

次のようにXACMLソースはなります

<?xml version="1.0" encoding="UTF-8"?> 
<!--This file was generated by the ALFA Plugin for Eclipse from Axiomatics AB (http://www.axiomatics.com). 
Any modification to this file will be lost upon recompilation of the source ALFA file--> 
<xacml3:Policy xmlns:xacml3="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" 
    PolicyId="http://axiomatics.com/alfa/identifier/example.accessDocs" 
    RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" 
    Version="1.0"> 
    <xacml3:Description /> 
    <xacml3:PolicyDefaults> 
     <xacml3:XPathVersion>http://www.w3.org/TR/1999/REC-xpath-19991116</xacml3:XPathVersion> 
    </xacml3:PolicyDefaults> 
    <xacml3:Target /> 
    <xacml3:Rule 
      Effect="Deny" 
      RuleId="http://axiomatics.com/alfa/identifier/example.accessDocs.denyOutOfOffice"> 
     <xacml3:Description /> 
     <xacml3:Target> 
      <xacml3:AnyOf> 
       <xacml3:AllOf> 
        <xacml3:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:time-less-than"> 
         <xacml3:AttributeValue 
          DataType="http://www.w3.org/2001/XMLSchema#time">17:00:00</xacml3:AttributeValue> 
         <xacml3:AttributeDesignator 
          AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-time" 
          DataType="http://www.w3.org/2001/XMLSchema#time" 
          Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" 
          MustBePresent="false" 
         /> 
        </xacml3:Match> 
       </xacml3:AllOf> 
       <xacml3:AllOf> 
        <xacml3:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:time-greater-than"> 
         <xacml3:AttributeValue 
          DataType="http://www.w3.org/2001/XMLSchema#time">09:00:00</xacml3:AttributeValue> 
         <xacml3:AttributeDesignator 
          AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-time" 
          DataType="http://www.w3.org/2001/XMLSchema#time" 
          Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" 
          MustBePresent="false" 
         /> 
        </xacml3:Match> 
       </xacml3:AllOf> 
      </xacml3:AnyOf> 
     </xacml3:Target> 
     <xacml3:ObligationExpressions> 
      <xacml3:ObligationExpression ObligationId="com.axiomatics.examples.notification.notifyManager" 
      FulfillOn="Deny"> 
       <xacml3:AttributeAssignmentExpression AttributeId="com.axiomatics.examples.message" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment"> 
        <xacml3:AttributeValue 
         DataType="http://www.w3.org/2001/XMLSchema#string">You cannot access anything outside office hours</xacml3:AttributeValue> 
       </xacml3:AttributeAssignmentExpression> 
       <xacml3:AttributeAssignmentExpression AttributeId="com.axiomatics.examples.user.manager.email" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
        <xacml3:AttributeDesignator 
         AttributeId="com.axiomatics.examples.user.manager.email" 
         DataType="http://www.w3.org/2001/XMLSchema#string" 
         Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" 
         MustBePresent="false" 
        /> 
       </xacml3:AttributeAssignmentExpression> 
      </xacml3:ObligationExpression> 
     </xacml3:ObligationExpressions> 
    </xacml3:Rule> 
</xacml3:Policy> 
関連する問題