2016-06-14 10 views
0

의 시도 - 그것은 아래 XACML V.3 정책 설정과 관련된 문제는 내가 주어진 정책을 경우 정의 대상을 사용하여 순서대로 일련의 정책을 실행하기 위해 설정 한 정책을 추가 할 입력 필드 "resource"를 기반으로 적용 할 수도 있고 사용하지 않을 수도 있습니다. 테스트를 시작하기 위해 하나의 정책을 포함하는 단일 policySet을 작성했습니다. 나는 "허가"를 받으실 때 WSO2 신원 서버 - PAP

WSO2 PAP에 의해 평가

는 "적용 불가"의 결과를 나타내는 실패. 여기

XML에서 만든 "cfatest0"라는 정책 :

여기
<!--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="cfatest0" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides" Version="1.0"> 
     <xacml3:Description></xacml3:Description> 
     <xacml3:PolicyDefaults> 
     <xacml3:XPathVersion>http://www.w3.org/TR/1999/REC-xpath-19991116</xacml3:XPathVersion> 
     </xacml3:PolicyDefaults> 
     <xacml3:Target> 
     <xacml3:AnyOf> 
      <xacml3:AllOf> 
       <xacml3:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
        <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">TPS_AE_REST_Policy</xacml3:AttributeValue> 
        <xacml3:AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" MustBePresent="false"></xacml3:AttributeDesignator> 
       </xacml3:Match> 
      </xacml3:AllOf> 
     </xacml3:AnyOf> 
     </xacml3:Target> 
     <xacml3:Rule Effect="Permit" RuleId="http://axiomatics.com/alfa/identifier/com.red.XACML.permitAll"> 
     <xacml3:Description></xacml3:Description> 
     <xacml3:Target></xacml3:Target> 
     </xacml3:Rule> 
     <xacml3:Rule Effect="Deny" RuleId="http://axiomatics.com/alfa/identifier/com.red.XACML.checkId"> 
     <xacml3:Description></xacml3:Description> 
     <xacml3:Target></xacml3:Target> 
     <xacml3:Condition> 
      <xacml3:Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:not"> 
       <xacml3:Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:any-of"> 
        <xacml3:Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"></xacml3:Function> 
        <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">[email protected]</xacml3:AttributeValue> 
        <xacml3:AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://www.w3.org/2001/XMLSchema#string" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" MustBePresent="false"></xacml3:AttributeDesignator> 
       </xacml3:Apply> 
      </xacml3:Apply> 
     </xacml3:Condition> 
     <xacml3:ObligationExpressions> 
      <xacml3:ObligationExpression ObligationId="obligation.displayAttributes" FulfillOn="Deny"> 
       <xacml3:AttributeAssignmentExpression AttributeId="urn:oasis:names:tc:xacml:3.0:example:attribute:text" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
        <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Access denied due to invalid UserID</xacml3:AttributeValue> 
       </xacml3:AttributeAssignmentExpression> 
      </xacml3:ObligationExpression> 
     </xacml3:ObligationExpressions> 
     </xacml3:Rule> 
     <xacml3:AdviceExpressions> 
     <xacml3:AdviceExpression AdviceId="advice.displayAttributes" AppliesTo="Deny"> 
      <xacml3:AttributeAssignmentExpression AttributeId="urn:oasis:names:tc:xacml:3.0:example:attribute:text" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
       <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Valid subjectId</xacml3:AttributeValue> 
      </xacml3:AttributeAssignmentExpression> 
     </xacml3:AdviceExpression> 
     <xacml3:AdviceExpression AdviceId="advice.displayAttributes" AppliesTo="Permit"> 
      <xacml3:AttributeAssignmentExpression AttributeId="urn:oasis:names:tc:xacml:3.0:example:attribute:text" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
       <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Valid subjectId</xacml3:AttributeValue> 
      </xacml3:AttributeAssignmentExpression> 
     </xacml3:AdviceExpression> 
     </xacml3:AdviceExpressions> 
    </xacml3:Policy> 

XML에서 만든 정책 (PolicySet)라는 이름의 cfapolicyset1 다음 WSO2에 의해 생성 된 요청 아래

<!--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:PolicySet xmlns:xacml3="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicySetId="cfapolicyset1" PolicyCombiningAlgId="urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:permit-overrides" Version="1.0"> 
     <xacml3:Description></xacml3:Description> 
     <xacml3:PolicySetDefaults> 
     <xacml3:XPathVersion>http://www.w3.org/TR/1999/REC-xpath-19991116</xacml3:XPathVersion> 
     </xacml3:PolicySetDefaults> 
     <xacml3:Target> 
     <xacml3:AnyOf> 
      <xacml3:AllOf> 
       <xacml3:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
        <xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">TPS_AE_REST_Policy</xacml3:AttributeValue> 
        <xacml3:AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" MustBePresent="false"></xacml3:AttributeDesignator> 
       </xacml3:Match> 
      </xacml3:AllOf> 
     </xacml3:AnyOf> 
     </xacml3:Target> 
     <xacml3:PolicyIdReference>cfatest0</xacml3:PolicyIdReference> 
    </xacml3:PolicySet> 

"를보십시오 - 그것은" PAP는 아래 도구 :

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false"> 
    <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">[email protected]</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">TPS_AE_REST_Policy</AttributeValue> 
     </Attribute> 
    </Attributes> 
</Request> 

결정은 : 적용 불가

01 23,516,

내가이 정책 (PolicySet)에 요청을 보내는 데 사용할 방법을 방법으로 무언가를 그리워합니까? WSO2 상위 레벨 정책 편집기를 사용할 때 응답시 동일한 오류가 발생합니다. PAP "Try-It"도구에서 격리 된 정책을 테스트 할 때이 정책에 대해 올바른 값인 "Permit"이 표시됩니다.

답변

1

귀하의 요청과 정책을 공리적 폴리시 관리 지점에서 시도한 결과, 원하는 응답 즉 허가 + 조언을 받았습니다.

Simulation result in the Axiomatics Policy Administration Point

은 당신이 WSO2IS 내부 정책을로드하는 것을 잊었다 수 있을까? xacml3 : PolicyIdReference 경우 @ 데이비드 브로사드을 테스트

+0

덕분에 힌트가 옳았다는 PolicyReference 문에서 참조되는 정책은 바로 문 뒤에 배치 정책 (PolicySet)의 소스 코드, 내부에 존재해야합니다. WSO2 PAP 도구는 원본을 하나의 XML 파일로 사용할 수 있으므로 PDP에 설정된 정책과 참조 된 정책을로드 할 필요없이 올바르게 해석 할 수 있습니다. 이것은 테스트에 유용합니다. –