One*_*rld 2 authorization xacml pdp abac authzforce
我正在评估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!
}
}
}
Run Code Online (Sandbox Code Playgroud)
现在,根据类似[1]的文献,我不应该信任给定request-xacml-file中的属性。只要有可能,我就必须检查属性提供者(例如,患者数据库)是否确实给定属性(例如,患者出生日期)属于患者,以防止遭受攻击。
否则,攻击者可以在“请求”中使患者更年轻,以访问作为父母监护人的患者记录。
问题
Response response = pdp.evaluate((Request) request);?pdp.xml示例中的文件)使PDP引擎知道属性提供程序。根据要使用的属性提供程序,您将需要另外两个文件(XML目录和架构)。AuthzForce Core Wiki的“ 使用属性提供程序”部分对此进行了记录。| 归档时间: |
|
| 查看次数: |
179 次 |
| 最近记录: |