Я следил за ссылка для запуска pdp с использованием конверта SAML на XACML. Затем я создал веб-сервис (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>
И вот моя просьба
Subject-Id: urn: oasis: names: tc: xacml: 1.0: subject: за пределами университета, Subject-Value: Staff
Arttibute-Id: urn: oasis: names: tc: xacml: 1.0: resource: file123, Значение атрибута: Файл сервера
Action-Id: urn: oasis: names: tc: xacml: 1.0: action: delete123, Action-Value: Delete
Я получаю ответ Запретить. Как вы видите, MustBePresent = true
в Subject, Resource и Action of Policy-Target и Request не содержит идентификаторов. Согласно XACML 2.0, если MustBePresent имеет значение true и идентификаторы НЕ присутствуют в запросе, то цель будет неопределенной. И если целью является цель политики, тогда вся политика будет неопределенной. Но в этом случае после неопределенной цели политики PDP все же оценивает Правило и выдает результат в соответствии с алгоритмом объединения Правил.
Сообщите мне, если я ошибаюсь.