0

gitからダウンロードした balana を使用しています。ポリシーの文字列バッグがリクエスト内の一致する属性のサブセットである場合にのみ許可するポリシー ルールに取り組んでいます。例えば。リクエストには attributes が含まれて"letter=a, letter=b"おり、ポリシーは string-subset を使用して、リクエストの一連の文字属性を string-bag と比較します。サブセットの両方の順序 (サブセット文字 stringbag とサブセット stringbag 文字) を試しましPermitたが、テスト要求が " " になるはずのときに、どちらも " "で返されDenyます。

サンプル ポリシー

<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="policy1"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides" 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">
                        myguid0123456789
                    </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="Deny" RuleId="securityLevel">
        <Condition>
            <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than">
                <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only">
                    <AttributeDesignator AttributeId="securityLevel" Category="tags" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="true" />
                </Apply>
                <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">
                    9000
                </AttributeValue>
            </Apply>
        </Condition>
        <AdviceExpressions>
            <AdviceExpression AdviceId="channel-security-too-low" AppliesTo="Deny">
                <AttributeAssignmentExpression AttributeId="urn:oasis:names:tc:xacml:2.0:example:attribute:text">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                        Message security is over 9000! It's not good cap'n, I cannae make it go any faster!
                    </AttributeValue>
                </AttributeAssignmentExpression>
            </AdviceExpression>
        </AdviceExpressions>
    </Rule>
    <Rule Effect="Permit" RuleId="caveats">
        <Condition>
            <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-subset">
                <AttributeDesignator AttributeId="caveats" Category="tags" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
                <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                        A
                    </AttributeValue>
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                        B
                    </AttributeValue>
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                        C
                    </AttributeValue>
                </Apply>
            </Apply>
        </Condition>
        <AdviceExpressions>
            <AdviceExpression AdviceId="data-caveat-not-on-channel" AppliesTo="Deny">
                <AttributeAssignmentExpression AttributeId="urn:oasis:names:tc:xacml:2.0:example:attribute:text">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                        caveat advice fail
                    </AttributeValue>
                </AttributeAssignmentExpression>
            </AdviceExpression>
        </AdviceExpressions>
    </Rule>
    <Rule RuleId="permit-rule" Effect="Permit" />
</Policy>

そして、私はテストのためにこのリクエストを渡しています:

リクエスト

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="true">
    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                send
            </AttributeValue>
        </Attribute>
    </Attributes>
    <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                99991699
            </AttributeValue>
        </Attribute>
    </Attributes>
    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
        <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                myguid0123456789
            </AttributeValue>
        </Attribute>
    </Attributes>
    <Attributes Category="tags">
        <Attribute AttributeId="securityLevel" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">
                8000
            </AttributeValue>
        </Attribute>
        <Attribute AttributeId="caveats" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                A
            </AttributeValue>
        </Attribute>
        <Attribute AttributeId="caveats" IncludeInResult="true">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
                B
            </AttributeValue>
        </Attribute>
    </Attributes>
</Request>

だから、私の考えは(否定を伝える方法がわからないので)

  • 条件の否定的な一致を効果の否定に暗黙的に関連付けます。

それが正しい場合、私の直感では、OK である一致するサブセットは「許可する」と言うべきですが、条件に一致しない場合は代わりに「拒否する」と言うでしょう。

ターゲットステートメントがないため、私の直感では、すべてのリクエストでその条件を評価しようとする「べき」であり、条件に一致しないことでルールの評価がスキップされることはありません。

いずれにせよ、サンプルを見て、「私のポリシーは A,B を取りますが、あなたは A,B,C を持っているので、私はあなたを否定しなければなりません」と言いたいのです。残念ながら、それはそれが行っていることではありません。その理由はわかりません。助けてください。x_x

4

1 に答える 1