1) Introducing Apache OpenAz
The XACML functionality in Apache CXF is based on OpenSAML, which provides support for XACML 2.0. However, XACML 3.0 is an OASIS standard as of January, 2013. A new project in the Apache Incubator called Apache OpenAz addresses this gap. The source code is broken down into the following modules:
- openaz-xacml - API + common functionality.
- openaz-xacml-rest - Some common functionality used by the RESTful API interfaces
- openaz-xacml-pdp - A PDP implementation
- openaz-xacml-pdp-rest - An implementation of the XACML 3.0 RESTful Interface for the PDP
- openaz-xacml-pap-rest - An implementation of the XACML 3.0 RESTful Interface for the PAP
- openaz-xacml-test - Some testsuites
- openax-pep - The PEP (Policy Enforcement Point) implementation.
The testcases are available here:
- cxf-sts-xacml: This project contains a number of tests that show how to use XACML with CXF to authorize a client request. It contains both XACML 2.0 tests and XACML 3.0 tests.
The service endpoint is configured in Spring as follows, registering a XACML3AuthorizingInterceptor (which in turn contains a reference to the co-located PDP):
The XACML3AuthorizingInterceptor is configured with a implementation to create a XACML 3.0 request using the SAML 2.0 profile of XACML 3.0, which is subsequently converted into JSON + sent to the PDP. The PDP is configured with "root" and "reference" policies, that state that a user of role "boss" has permission to "execute" the Web Service Operation "{http://www.example.org/contract/DoubleIt}DoubleItService#DoubleIt". For example:
A sample authorization request looks like:
If you are interested in XACML 3.0 please get involved with the Apache OpenAz project! Once the project gets more mature, the PEP code in my project will probably make it over to Apache CXF so that users have the option of supporting XACML 2.0 or 3.0 (and XML or JSON) with their web services.
This comment has been removed by the author.
ReplyDeleteGreate sample, but I can't get it running because it complains that it can not find the openaz 0.0.1-snapshot in the mvn repository.
ReplyDeleteIt should be fine now: http://repository.apache.org/content/groups/snapshots/org/apache/openaz/
DeleteThanks for the test cases. They are very useful to demonstrate PEP-PDP features in a real-world use case. For your information, I have adapted them for another XACML 3.0 implementation called AuthzForce. I made two test cases actually:
ReplyDelete1) One similar test case using a remote AuthzForce PDP as a REST service (the PEP-like CXF interceptor uses a JAX-RS client to call the RESTful PDP with XACML 3.0 requests);
2) Another test case using an embedded (Java) AuthzForce PDP (the PEP-like CXF interceptor uses a Java API to call the PDP instead of XACML 3.0 requests, but the policies are still standard XACML 3.0 policy documents).
Pretty cool, thanks for posting that.
ReplyDelete