简体   繁体   English

在PDP处对属性提供者的XACML请求的属性进行双重检查的位置?

[英]Where to double-check attributes of the XACML-request against Attribute-Providers at the PDP?

I'm evaluation PDP engines and at the moment I give AuthzForce Core a try. 我正在评估PDP引擎,现在我试试AuthzForce Core Evaluating a Request by the PDP runs pretty solid so far: 到目前为止,PDP对请求的评估运行非常可靠:

//My request and pdp configuration files
File confLocation = new File("D:/docs/XACML/AuthZForce/IIA001/pdp.xml");//pdp.xml tells the pdp where the policies xml files are
File requestFile = new File("D:/docs/XACML/AuthZForce/IIA001/Request.xml");

//I instantiate the pdp engine and the xacml parser
final PdpEngineConfiguration pdpEngineConf = PdpEngineConfiguration.getInstance(confLocation, null, null);
PdpEngineInoutAdapter<Request, Response> pdp = PdpEngineAdapters.newXacmlJaxbInoutAdapter(pdpEngineConf);
XmlUtils.XmlnsFilteringParser xacmlParserFactory = XacmlJaxbParsingUtils.getXacmlParserFactory(false).getInstance();

//I parse the request file
Object request = xacmlParserFactory.parse(requestFile.toURI().toURL());
if (request instanceof Request) {
    //At this point I could access all request attributes or alter them

    //I let the PDP evaluate the request
    Response response = pdp.evaluate((Request) request);

    //I check the results inside the response
    for (Result result : response.getResults()) {
                    if (result.getDecision() == DecisionType.PERMIT) {
                        //it's permitted!

                    } else {
                        //denied!
                    }
    }
}

Now, according to the literature like [1] I should not trust the attributes in the given request-xacml-file. 现在,根据像[1]这样的文献,我不应该信任给定request-xacml文件中的属性。 Whenever possible, I have to check against a Attribute Provider (eg a Patient database) if the given attributes (eg patient birthdate) actually belong to the patient in order to prevent attacks. 只要有可能,我必须检查属性提供者(例如患者数据库),如果给定的属性(例如患者出生日期)实际上属于患者,以防止发作。

Otherwise the attacker could make the patient younger in the Request in order to access the patient's record as a parent guardian. 否则,攻击者可以使请求中的患者更年轻,以便作为父母监护人访问患者的记录。

Questions 问题

  1. Is checking Requests against Attribute Providers the task of a PDP or of another entitiy? 检查针对属性提供程序的请求是PDP或其他权限的任务吗?
  2. Did OASIS specify anything concrete about that issue? OASIS是否具体说明了该问题的具体内容? Eg workflow or syntax of configuration files 例如配置文件的工作流程或语法
  3. Is there a way to make my pdp engine aware of Attribute Providers? 有没有办法让我的pdp引擎知道属性提供者?
  4. Should I just check the provided request on my own before Response response = pdp.evaluate((Request) request); 我应该在Response response = pdp.evaluate((Request) request);之前自己检查提供的Response response = pdp.evaluate((Request) request); ?
  1. I don't know for other XACML implementations, but regarding AuthzForce, Attribute Providers play the role of PIPs in official XACML terms (see the definition of PIP in XACML spec 's Glossary ), ie responsible for getting any additional attribute that is not in the XACML request context (it usually means they are not provided by the PEP originally), whenever the PDP needs it to evaluate the policy. 我不知道其他XACML实现,但是对于AuthzForce,属性提供者在官方XACML术语中扮演PIP的角色(参见XACML规范 术语表中的PIP定义),即负责获取不在的任何其他属性每当PDP需要它来评估策略时,XACML请求上下文(通常意味着它们最初不是由PEP提供)。 This relates to steps 5-8 of XACML standard data-flow model (§3.1 of XACML 3.0 spec ). 这涉及XACML标准数据流模型的步骤5-8( XACML 3.0规范的 §3.1)。 Besides, if you read the XACML spec carefully, you notice that the actual entity calling the PIPs for the PDP is the so-called context handler . 此外,如果您仔细阅读XACML规范 ,您会注意到调用PDP的PIP的实际实体是所谓的上下文处理程序 In practice, this is a matter of implementation, the context handler can take many forms. 在实践中,这是一个实现问题, 上下文处理程序可以采取多种形式。 In AuthzForce, it is just a sub-component of the PDP, but you might have one on the PEP side as well which is application-specific, especially in a typical ABAC/XACML scenario where the PDP is a remote service from the PEP's perspective, and the PDP is possibly talking to many PEPs in completely different application environments. 在AuthzForce中,它只是PDP的一个子组件,但您可能在PEP端也有一个特定于应用程序,特别是在典型的ABAC / XACML场景中,PDP是从PEP角度看的远程服务PDP可能在完全不同的应用环境中与许多PEP交谈。
  2. As mentioned previously, for the workflow, look at section 3.1 Data-flow model in the XACML core spec . 如前所述,对于工作流程,请参阅XACML核心规范中的3.1 数据流模型 For the syntax, XACML core specification defines a syntax for policies, authorization decision requests and responses, nothing else at this point. 对于语法,XACML核心规范定义了策略,授权决策请求和响应的语法,此时没有其他内容。 You may find other things in XACML Profiles, but no such thing as configuration syntax, to my knowledge. 您可以在XACML配置文件中找到其他内容,但据我所知,没有配置语法。
  3. In AuthzForce, the PDP engine is made aware of Attribute Providers by the PDP configuration, ie the pdp.xml file in your example. 在AuthzForce中,PDP引擎通过PDP配置(即示例中的pdp.xml文件)了解属性提供程序。 You'll need two other files (XML catalog and schema) depending on the Attribute Provider you want to use. 您需要两个其他文件(XML目录和架构),具体取决于您要使用的属性提供程序。 This is documented in the Using Attribute Providers section of AuthzForce Core's wiki . 这在AuthzForce Core的wikiUsing Attribute Providers部分中有记录
  4. Your code seems like test code to me since you are getting the xacml request from a local file so it seems you have full control over it, so no need to check further. 您的代码对我来说似乎是测试代码,因为您从本地文件获取xacml请求,因此您似乎可以完全控制它,因此无需进一步检查。 More generally, it depends on the actual use case, really, no universal rule for that. 更一般地说,它取决于实际用例,实际上,没有通用规则。 Some attributes (like a subject-id resulting from authentication) are specific and only known by the PEP in its own app environment, so they are the responsibility of the PEP. 某些属性(如身份验证产生的主题ID)是特定的,只有PEP在其自己的应用环境中才知道,因此它们是PEP的责任。 Some other attributes are more likely the responsibility of the PDP (through attribute providers) if they can be resolved in a central way, such as attributes in a company's directory or other kind of identity repository. 如果可以通过集中方式解决PDP(通过属性提供者),则其他一些属性更可能是PDP的责任,例如公司目录中的属性或其他类型的身份库。

In addition to @cdan's excellent response, here are a few more pointers: 除了@ cdan的出色响应之外,还有以下几点:

Is checking Requests against Attribute Providers the task of a PDP or of another entitiy? 检查针对属性提供程序的请求是PDP或其他权限的任务吗?

The PDP always trusts the information (attributes) it receives whether it be from the PEP or from the PIPs. 无论是来自PEP还是来自PIP,PDP始终信任它接收的信息(属性)。 As such the PDP need not verify values it received from a PEP by checking with a PIP. 因此,PDP不需要通过检查PIP来验证它从PEP接收的值。 That's counter-productive an inefficient. 这是适得其反的低效率。 If you cannot trust the PEP to send the right value, how can you trust it to enforce the right decision? 如果你不能相信PEP发送正确的价值,你怎么能相信它来执行正确的决定呢?

Did OASIS specify anything concrete about that issue? OASIS是否具体说明了该问题的具体内容? Eg workflow or syntax of configuration files 例如配置文件的工作流程或语法

No, we did not. 我们没有。 PIP behavior is outside the scope of the XACML spec. PIP行为超出了XACML规范的范围。

Is there a way to make my pdp engine aware of Attribute Providers? 有没有办法让我的pdp引擎知道属性提供者? Should I just check the provided request on my own before Response response = pdp.evaluate((Request) request);? 我应该在响应响应= pdp.evaluate((请求)请求之前自己检查提供的请求);?

The PDP should be configured with PIPs. PDP应配置PIP。 The PDP will use all the PIPs it can. PDP将使用它可以使用的所有PIP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM