Logic XACML资源
我正在尝试编写一个代码,允许用户根据安全角色访问网站内容。因此,有些用户可以看到所有内容,有些用户只能看到带有特定扩展名的URL 我的大部分代码都可以工作,但我在访问3个子类别时遇到了问题Logic XACML资源,logic,xacml2,Logic,Xacml2,我正在尝试编写一个代码,允许用户根据安全角色访问网站内容。因此,有些用户可以看到所有内容,有些用户只能看到带有特定扩展名的URL 我的大部分代码都可以工作,但我在访问3个子类别时遇到了问题 <Rule Effect="Permit" RuleId="accesses"> <Description>Permission for lower clearance</Description> <Target> <Res
<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>
允许降低净空
home.html
localweather.html
关于.html
清楚的
我有这3种资源,当我运行程序时,我会得到一个“不确定”的响应。每个规则只能有1个资源吗?其他东西是否引发异常?您可以在目标中为其设置树资源。根据你的规则,他们将充当“或”。请检查您的XACML请求,可能是您发送的请求与策略不匹配(策略has MustBePresent=“true”这意味着,如果属性不存在,PDP将创建一个不确定的错误)。请将其更改为“false””“瞧 这实际上是一个条件问题。这些资源都是叶级文件。我的策略没有正确的用户属性值集。我将其与我的LDAP模式进行了比较,并使其正常工作