[英]XACML Policy Evaluation Error
我按照鏈接在XACML上使用SAML信封運行pdp。 然后,我創建了Web服務(pdp和pdpclient-換句話說XACML請求生成器)。 在這里,每件事都運行良好,即生成請求並通過給定的策略(由后繼鏈接給出的測試策略)獲得完美的結果。
現在我用我的政策測試PDP了! 但是(以我的觀點),pdp無法正確評估策略。 例如這是我的政策
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Policy xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"
PolicyId="ServerDataDeletion" Version="2.0"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:deny-overrides">
<Description>Server Data Deletion by Student</Description>
<Target>
<Subjects>
<Subject>
<SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Visitor</AttributeValue>
<SubjectAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:subject:outside-university"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</SubjectMatch>
</Subject>
</Subjects>
<Resources>
<Resource>
<ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Server File</AttributeValue>
<ResourceAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:resource:file123"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</ResourceMatch>
</Resource>
</Resources>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Delete</AttributeValue>
<ActionAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:action:delete123"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</ActionMatch>
</Action>
</Actions>
</Target>
<Rule RuleId="ServerDataDeletion" Effect="Permit">
<Description>Server Data Deletion</Description>
<Target>
<Subjects>
<Subject>
<SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Student</AttributeValue>
<SubjectAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:subject:inside-university123"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</SubjectMatch>
</Subject>
</Subjects>
<Resources>
<Resource>
<ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Server File</AttributeValue>
<ResourceAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:resource:file"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false" />
</ResourceMatch>
</Resource>
</Resources>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Delete</AttributeValue>
<ActionAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:action:delete"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false" />
</ActionMatch>
</Action>
</Actions>
</Target>
</Rule>
<Rule RuleId="Default" Effect="Deny" />
</Policy>
這是我的要求
主題編號:urn:oasis:names:tc:xacml:1.0:subject:outside-university,主題值:Staff
Arttibute-Id:urn:oasis:names:tc:xacml:1.0:resource:file123,Attribute-Value:服務器文件
動作ID:urn:oasis:names:tc:xacml:1.0:action:delete123,動作值:刪除
我得到的回應是拒絕 。 如您所見,Policy-Target和Request的Subject,Resource和Action中的MustBePresent = true
包含沒有ID。 根據XACML 2.0,如果MustBePresent為true並且請求中不存在ID,則目標為不確定。 如果目標是政策目標,那么整個政策將是不確定的。 但是在這種情況下,在確定了不明確的策略目標之后,PDP仍然根據規則組合算法評估規則和制定結果。
讓我知道我是否錯。
實際上,您一眼就能看到NotApplicable
。
您具有以下結構:
您的保單的目標如下:
<Target>
<Subjects>
<Subject>
<SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Visitor</AttributeValue>
<SubjectAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:subject:outside-university"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</SubjectMatch>
</Subject>
</Subjects>
<Resources>
<Resource>
<ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Server File</AttributeValue>
<ResourceAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:resource:file123"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</ResourceMatch>
</Resource>
</Resources>
<Actions>
<Action>
<ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Delete</AttributeValue>
<ActionAttributeDesignator
AttributeId="urn:oasis:names:tc:xacml:1.0:action:delete123"
DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
</ActionMatch>
</Action>
</Actions>
</Target>
僅當您是試圖Delete
Server File
的Visitor
它才適用。
在您的請求中,您發送的是Staff
而不是Visitor
。 因此,您應該獲得NotApplicable
。
如果有機會,請轉到XACML 3.0。 查看適用於Eclipse的ALFA插件,輕松編寫策略。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.