XACML规则中如何使用Fiware服务和服务路径



我们正在研究KeyRock Wilma AuthzForce,以确保运行Orion和Quantum Leap的Fiware系统。我们系统中的实体正在服务和服务路径。这些可以使用适当的标头访问,即Fiware-Service和Fiware-ServicePath。

我正在尝试为AuthzForce创建XACML规则,其中包括服务和服务路径,但尚未成功。如果有人能够这样做,我将感谢您的帮助。另外,如果这种方法是错误的,我将感谢有关如何通过FIWare访问控制使用的服务和服务路径的其他建议。

处理fiware标题并不是 authzforce 的问题,而是 pep pep proxy 的默认行为。

authzforce 是一个完全通用的PDP,如果您提供了正确的XACML策略集并发送适当的数据将为您裁定。以下<Rule>permitfiware-header = "smartgondor"

时,所有访问/v2/entities
<?xml version="1.0" encoding="UTF-8"?>
<Rule RuleId="ccxsx-xs-xsx-xsxs-xs" Effect="Permit">
   <Description>Context Broker Access with Header=SmartGondor</Description>
   <Target>
      <AnyOf>
         <AllOf>
            <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-starts-with">
               <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">/v2/entities</AttributeValue>
               <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="urn:thales:xacml:2.0:resource:sub-resource-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
            </Match>
         </AllOf>
      </AnyOf>
      <AnyOf>
         <AllOf>
            <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
               <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">smartgondor</AttributeValue>
               <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="fiware-header" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true" />
            </Match>
         </AllOf>
      </AnyOf>
   </Target>
</Rule>

不幸的是,默认情况下,在向AuthzForce请求时, PEP代理代码,仅通过以下值通过以下值:

  • 角色
  • 动作
  • Resourceurl
  • appid

,您可以看到默认

包括有关FIWare标头的信息。您将不得不更改文件以从发送到PEP代理的请求中读取标题,并添加带有请求的另一个属性到AuthzForce。可以在管理-XACML教程中找到此类自定义请求的更简单的示例

安全人员只能在上午9点之前或下午5点后敲响警钟

可以在教程代码库中找到要向AuthzForce发送请求的自定义代码-Charlie的用户名包含在请求中。

最新更新