如何使用自定义属性编写XACML策略

Ber*_*ord 2 policy xacml fedora-commons

我正在尝试编写一个将使用自定义属性的XACML策略.我想的是:

<?xml version="1.0" encoding="UTF-8"?>
<Policy xmlns="urn:oasis:names:tc:xacml:1.0:policy"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" PolicyId="deny-demo100"
  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
  <Description> </Description>
  <Target>
    <Subjects>
      <AnySubject/>
    </Subjects>
    <Resources>
  <AnyResource/>
</Resources>
<Actions>
  <AnyAction/>
</Actions>
  </Target>

  <Rule Effect="Deny" RuleId="rule-deny-demo100">
    <Target>
      <Subjects>
        <AnySubject/>
      </Subjects>
      <Resources>
        <Resource>
           <AnyResource/>
        </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">customAttribute</AttributeValue>
            <ActionAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-    id" MustBePresent="false" DataType="http://www.w3.org/2001/XMLSchema#string"/>
          </ActionMatch>
        </Action>
      </Actions>
    </Target>    
  </Rule>

  <Rule RuleId="deny-demo100-catch-all" Effect="Permit" />

</Policy>
Run Code Online (Sandbox Code Playgroud)

(我们正在使用Fedora的XACML实现).

我确信我在这里遗漏了一些非常简单和基本的东西,但是无法弄清楚是什么.有人能指出我正确的方向吗?

Dav*_*ard 5

你的自定义属性是什么意思?你想用"普通老英语"表达什么?

在XACML中,您可以使用您喜欢的任何属性,例如角色,公民身份,许可,资源分类,时间......当然,属性的可用性取决于您要保护的应用程序类型.你是如何使用Fedora实现的?它是否适用于Fedora Linux OS中的访问控制?

如果你想比较一个属性值,例如citizenship == Canadian,那么使用a <Target/>.如果要将2个属性进行比较,例如清除>分类,则使用a <Condition>.