我對使用WSO2 Balana庫的XACML策略有疑問。XACML策略 - 是否正確?
有一個政策:
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="Policy1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">MyApp</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"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Rule Effect="Permit" RuleId="RuleFor_user1_myapp">
<Target>
<AnyOf>
<AllOf>
<Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">user1</AttributeValue>
<AttributeDesignator AttributeId="http://example.site.com/id/user"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Match>
</AllOf>
</AnyOf>
</Target>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">READ</AttributeValue>
</Apply>
<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"/>
</Apply>
</Rule>
</Policy>
它應該定義USER1具有隻讀的權限MyApp的。
我有一個請求來評估,詢問user1是否具有讀取權限,並且我在響應中獲得「許可」,這是確定的。
但是,當我有一個請求來評估詢問user1是否具有寫權限時,我還獲得「許可」,而不是「不適用」。
有人可以告訴我是政策是正確的,以產生我剛剛描述的結果嗎?
預先感謝您!
最好的問候, 尤里察Krizanic
XACML驗證器網站不再工作。有沒有其他我可以使用的驗證器? – Ozkan 2016-02-09 18:37:20
只需使用XACML 3.0模式和一個標準的XML驗證工具,例如Notepad ++或XML Spy ... – 2016-02-10 00:08:23