0

リンクに従って、XACML で SAML エンベロープを使用して pdp を実行しました。次に、Web サービス ( pdp および pdpclient - つまり XACML Request Generator ) を作成しました。ここでは、すべてが正常に実行されます。つまり、要求を生成し、指定された (次のリンクで指定されたテスト ポリシー) ポリシーで完璧な結果が得られます。

今、私は自分のポリシーで 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:outside-university、Subject-Value: スタッフ

Arttibute-Id: urn:oasis:names:tc:xacml:1.0:resource:file123、属性値: サーバー ファイル

アクション ID: urn:oasis:names:tc:xacml:1.0:action:delete123、アクション値: 削除

そして私が得る応答はDenyです。ご覧のとおりMustBePresent = true、Subject、Resource、および Policy-Target の Action と Request には、none の ID が含まれていません。XACML 2.0 によると、MustBePresent が true で ID がリクエストに存在しない場合、ターゲットは不確定になります。また、ターゲットがポリシー ターゲットの場合、ポリシー全体が不確定になります。ただし、この場合、不確定なポリシー ターゲットの後、PDP は引き続きルールを評価し、ルール結合アルゴリズムに従って結果を作成します。

私が間違っている場合はお知らせください。

4

1 に答える 1

0

実際、一見すると、NotApplicable.

次の構造があります。

  • ポリシー
    • ルール 1: ServerDataDeletion は 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 に移行してください。ポリシーを簡単に作成するには、Eclipse 用の ALFA プラグインを確認してください。

于 2014-05-16T21:19:25.283 に答える