【发布时间】:2018-04-04 01:16:06
【问题描述】:
我正在研究 XACML 中的一项策略,其中应将具有安全分类和类别的主题与对象的分类和类别进行比较。 请求可能是:
- 主题:
- 分类:秘密,
- 类别:北约、欧盟。
- 资源:
- 分类:秘密,
- 类别:北约。
这应该是允许的。 如果资源的分类高于主题,或者主题没有正确的类别,则结果应被拒绝。所以,我需要以某种方式对分类进行排名(使用 in-bag 函数?)以查看主题是否具有正确的分类。我还需要比较主体和客体的一个或多个类别。
我只能用分类来硬编码,我在这个网站上看到的类似问题使用xacml 3.0 和alfa。我无法对类别部分进行编码。这是我在硬编码属性政策中的条件。
<Condition FunctionId="urn:oasis:names:tc:xacml:1.0:function:and">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
<SubjectAttributeDesignator
AttributeId="classification"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Apply>
<AttributeValue
DataType="http://www.w3.org/2001/XMLSchema#string">top-secret</AttributeValue>
</Apply>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
<ResourceAttributeDesignator
AttributeId="resclassification"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Apply>
<AttributeValue
DataType="http://www.w3.org/2001/XMLSchema#string">top-secret</AttributeValue>
</Apply>
</Condition>
有什么帮助吗?
此代码适用于硬编码属性。
<!-- Hard-coded condition check -->
<Condition FunctionId="urn:oasis:names:tc:xacml:1.0:function:and">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-greater-than-or-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
<SubjectAttributeDesignator
AttributeId="classification"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Apply>
<AttributeValue
DataType="http://www.w3.org/2001/XMLSchema#string">3.0 top-secret</AttributeValue>
</Apply>
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
<ResourceAttributeDesignator
AttributeId="resclassification"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</Apply>
<AttributeValue
DataType="http://www.w3.org/2001/XMLSchema#string">3.0 top-secret</AttributeValue>
</Apply>
</Condition>
【问题讨论】:
-
你能发布你的整个政策吗?此外,如果您想进行比较,您将需要使用正确顺序的数字或字符串,例如“1.0 秘密”、“2.0 绝密”...
-
我在机舱里过周末,但会尽快带我去看看!
-
您的条件是 XACML 2.0。你能切换到 XACML 3.0 吗?
-
我被特别要求使用符合 XACML v2 的 API。
-
在分类前添加数字,将请求中的属性与策略中的硬编码字符串进行比较,得到正确的结果(允许、拒绝等)。尝试比较主题和文件之间请求中的分类属性仍然没有运气。
标签: xacml alfa authorization access-control xacml abac alfa