监控 Orion Context Broker 以创建新的 XACML 规则

Monitoring Orion Context Broker to create new XACML rules

我想知道是否可以实现这个工作环境:

我正在通过 PEP、PDP、PAP 等构建安全的 Orion Context Broker。 我希望,如果 Orion 为属性存储了异常值,则会发送警报(例如电子邮件),并且会创建一个新的 XACML 规则,以便角色用户可以看到这些值(在此之前他不会'必须有权限才能看到它)。

可能吗?如果是,我该如何实现? 有没有办法通过詹金斯来做?

in case of Orion stores an abnormal value for an attribute, an alert was sent ( e.g an email)

在这种情况下,用于发送电子邮件的 FIWARE 组件将是 复杂事件处理 - 例如Perseo

您可以设置 EPL 规则来发送电子邮件

Set up an XACML rule to only allow access if an attribute is "abnormal"

这看起来像一个标准的 <Condition> 子句,例如:

<Condition>
   <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-greater-than-or-equal">
      <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only">
         <EnvironmentAttributeSelector DataType="http://www.w3.org/2001/XMLSchema#time"
           AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-time"/>
      </Apply>
      <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">17:00:00</AttributeValue>
   </Apply>
</Condition>

将只允许在一天中的特定时间后执行操作。

我猜您可能正在考虑在 <Condition> 中使用 "urn:oasis:names:tc:xacml:1.0:function:double-greater-than"urn:oasis:names:tc:xacml:1.0:function:integer-greater-than",例如:

<Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal">
   <SubjectAttributeDesignator SubjectCategory="urn:oasis:names:tc:xacml:1.0:subjectcategory:accesssubject" AttributeId="SubjectClassificationRank" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"></SubjectAttributeDesignator>
   <ResourceAttributeDesignator AttributeId="ResourceClassificationRank" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"></ResourceAttributeDesignator>
</Apply>

现在是棘手的一点,您需要修改 PEP 代理的代码以确保您可以传递 "abnormal" 属性的值,这样Authzforce 可以裁决。

逻辑需要是这样的:

  1. 每当调用 PEP 代理 时,在 PEP 代理 内直接调用 Orion 以检索 当前 属性值。
  2. 在您的 PEP Proxy 中修改 XML 创建函数以添加相关属性。
  3. 调用Authzforce检查请求是否被允许

这里的重点是 PEP 代理 的标准代码将没有必要的信息来允许 Authzforce 进行裁决,所以你将不得不添加更多信息。

以下 Tutorial 中出现了一个更简单的相同类型的场景 - 这里用户的电子邮件地址被添加到 Authzforce 的请求中,您将只需要应用相同的原则。