Ошибка оценки политики XACML

Я следил за ссылка для запуска 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 все же оценивает Правило и выдает результат в соответствии с алгоритмом объединения Правил.

Сообщите мне, если я ошибаюсь.


person Junaid    schedule 10.03.2014    source источник
comment
Вы внедряете свой собственный PDP? Вы используете Sun XACML?   -  person David Brossard    schedule 12.03.2014
comment
Я использую реализацию PDP JBoss.   -  person Junaid    schedule 15.03.2014


Ответы (1)


На самом деле, с первого взгляда вы должны получить NotApplicable.

У вас следующая структура:

  • Policy
    • Rule 1: ServerDataDeletion yields Permit
    • Правило 2: По умолчанию выдает "Запретить".

Ваша политика имеет следующую цель:

<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>

Это применимо только в том случае, если вы Visitor пытаетесь Delete Server File.

В своем запросе вы отправляете Staff вместо Visitor. Следовательно, вы должны получить NotApplicable.

Если будет возможность, переходите на XACML 3.0. Ознакомьтесь с подключаемым модулем ALFA для Eclipse, чтобы легко писать свои политики.

person David Brossard    schedule 16.05.2014