0

セキュリティロールに基づいて、Webサイトからのコンテンツへのユーザーアクセスを可能にするコードを作成しようとしています。したがって、一部のユーザーはすべてのコンテンツを表示でき、一部のユーザーは特定の拡張子を持つURLのみを表示できます。

私のコードのほとんどは機能しますが、3つのサブカテゴリへのアクセスに問題があります。

<Rule Effect="Permit" RuleId="accesses">
    <Description>Permission for lower clearance</Description>
    <Target>
        <Resources>
            <Resource>
                <ResourceMatch
                    MatchId="urn:oasis:names:tc:xacml:1.0:function:regexp-string-match">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">home.html
                    </AttributeValue>
                    <ResourceAttributeDesignator
                        AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
                        DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="policy-admin@website.com"
                        MustBePresent="true" />
                </ResourceMatch>
            </Resource>
            <Resource>
                <ResourceMatch
                    MatchId="urn:oasis:names:tc:xacml:1.0:function:regexp-string-match">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">localweather.html
                    </AttributeValue>
                    <ResourceAttributeDesignator
                        AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
                        DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="policy-admin@website.com"
                        MustBePresent="true" />
                </ResourceMatch>
            </Resource>
            <Resource>
                <ResourceMatch
                    MatchId="urn:oasis:names:tc:xacml:1.0:function:regexp-string-match">
                    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">about.html
                    </AttributeValue>
                    <ResourceAttributeDesignator
                        AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
                        DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="policy-admin@website.com"
                        MustBePresent="true" />
                </ResourceMatch>
            </Resource>
        </Resources>
    </Target>
    <Condition>
        <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:regexp-string-match">
            <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
                <SubjectAttributeDesignator AttributeId="AccessLevel"
                    DataType="http://www.w3.org/2001/XMLSchema#string" Issuer="policy-admin@website.com"
                    MustBePresent="true" />
                <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Clear</AttributeValue>
            </Apply>
        </Apply>
    </ Condition >
</Rule>

これらの3つのリソースがあり、プログラムを実行すると、「不確定」な応答が返されます。ルールごとに1つのリソースしか持てませんか?他に例外をスローしているものはありますか?

4

2 に答える 2

0

ターゲット内のツリーリソースを持つことができます。あなたのルールによれば、それらは「OR」として機能します。XACMLリクエストを確認してください。ポリシーと一致しないリクエストを送信している可能性があります(ポリシーにはMustBePresent = "trueがあります。これは、属性がない場合、PDPが不確定エラーを作成することを意味します)。「false」に変更してください。を参照してください。

于 2013-02-27T11:45:14.600 に答える
0

それは実際には状態の問題でした。リソースはすべてリーフレベルのファイルでした。ポリシーに適切なユーザー属性値のセットがありませんでした。LDAPスキーマと比較して、機能させました。

于 2013-07-26T12:37:09.333 に答える