在 PDP 中,XACML-request 的 double-check 属性与 Attribute-Providers 在哪里?

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

我正在评估 PDP 引擎,现在我尝试 AuthzForce Core。到目前为止,通过 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!
                    }
    }
}

现在,根据像 [1] 这样的文献,我不应该相信给定 request-xacml-file 中的属性。只要有可能,我必须检查属性提供者(例如患者数据库)如果给定的属性(例如患者生日)实际上属于患者以防止攻击。

否则,攻击者可以在请求中使患者年龄更小,以便作为 parent 监护人访问患者的记录。

问题

  1. 检查针对属性提供者的请求是 PDP 的任务还是另一个实体的任务?
  2. OASIS 是否具体说明了该问题?例如。配置文件的工作流程或语法
  3. 有没有办法让我的 pdp 引擎知道属性提供程序?
  4. 我是否应该在 Response response = pdp.evaluate((Request) request); 之前自行检查提供的请求?
  1. 我不知道其他 XACML 实现,但关于 AuthzForce,属性提供程序在官方 XACML 术语中扮演 PIPs 的角色(参见 [=11 中 PIP 的定义) =] 仔细地,您注意到为 PDP 调用 PIP 的实际实体是所谓的 上下文处理程序 。实际上,这是一个实现问题, context handler 可以采用多种形式。在 AuthzForce 中,它只是 PDP 的一个子组件,但您可能在 PEP 端也有一个特定于应用程序的组件,尤其是在典型的 ABAC/XACML 从 PEP 的角度来看 PDP 是远程服务的场景,并且 PDP 可能与完全不同的应用程序环境中的许多 PEP 对话。
  2. 如前所述,对于工作流,请查看 XACML core spec 中的第 3.1 节 数据流模型。对于语法,XACML 核心规范定义了策略、授权决策请求和响应的语法,此时没有其他内容。您可能会在 XACML 配置文件中找到其他内容,但据我所知,没有配置语法之类的东西。
  3. 在 AuthzForce 中,PDP 引擎通过 PDP 配置了解属性提供程序,即示例中的 pdp.xml 文件。根据您要使用的属性提供程序,您还需要另外两个文件(XML 目录和架构)。这记录在 Using Attribute Providers section of AuthzForce Core's wiki.
  4. 你的代码对我来说似乎是测试代码,因为你从本地文件获取 xacml 请求,所以你似乎可以完全控制它,所以不需要进一步检查。更一般地说,这取决于实际用例,真的,没有通用的规则。一些属性(如身份验证产生的主题 ID)是特定的,只有 PEP 在其自己的应用程序环境中知道,因此它们是 PEP 的责任。如果可以集中解决某些其他属性(例如公司目录或其他类型的身份存储库中的属性),则更可能由 PDP(通过属性提供者)负责。

除了@cdan 的精彩回复,这里还有几点建议:

Is checking Requests against Attribute Providers the task of a PDP or of another entitiy?

PDP 始终信任它从 PEP 或 PIP 收到的信息(属性)。因此,PDP 不需要通过检查 PIP 来验证它从 PEP 接收到的值。这适得其反,效率低下。如果您不相信 PEP 会发送正确的值,您怎么能相信它会执行正确的决定?

Did OASIS specify anything concrete about that issue? E.g. workflow or syntax of configuration files

不,我们没有。 PIP 行为超出了 XACML 规范的范围。

Is there a way to make my pdp engine aware of Attribute Providers? Should I just check the provided request on my own before Response response = pdp.evaluate((Request) request);?

PDP 应配置 PIP。 PDP 将尽可能使用所有 PIP。