<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Harvesting web technologies</title>
	<atom:link href="http://www.webfarmr.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webfarmr.eu</link>
	<description>SOA, Security, Cloud, XML, XSLT, XML Security Gateways, WS-*, XACML, web services</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fine-grained access control using XACML in C# applications and the .Net framework</title>
		<link>http://www.webfarmr.eu/2012/02/fine-grained-access-control-using-xacml-in-c-applications-and-the-net-framework/</link>
		<comments>http://www.webfarmr.eu/2012/02/fine-grained-access-control-using-xacml-in-c-applications-and-the-net-framework/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 11:21:58 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=356</guid>
		<description><![CDATA[Background
When I talk to customers, I see an increase in interest in XACML for the .Net framework and the C# language. Historically, all XACML implementations have been in Java, most of them stemming from SunXACML. It is the case for instance of WSO2&#8242;s offering, SICSACML, and of course Axiomatics&#8217;  [...]]]></description>
			<content:encoded><![CDATA[<h1>Background</h1>
<p>When I talk to customers, I see an increase in interest in <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xacml">XACML</a> for the .Net framework and the C# language. Historically, all XACML implementations have been in Java, most of them stemming from <a href="http://sunxacml.sourceforge.net/" alt="SunXACML Project page at Sourceforge">SunXACML</a>. It is the case for instance of WSO2&#8242;s <a href="http://wso2.org/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform">offering</a>, <a href="http://www.sics.se/node/2465">SICSACML</a>, and of course Axiomatics&#8217; <a href="http://www.axiomatics.com/products/axiomatics-policy-server.html" alt="The world's leading XACML engine - implements XACML 3.0">Policy Server</a>.</p>
<h1>Support for XACML in C#</h1>
<p>Axiomatics and other companies have since released <a href="http://www.axiomatics.com/latest-news/161-press-release-axiomatics-releases-new-net-policy-decision-point-engine.html" alt="Fine-grained access control for .Net applications">.Net PDPs</a> and cover the space fairly well. In addition, it is possible to develop WS clients to SOAP-based PDPs regardless of the technology used.</p>
<h1>A simple tutorial</h1>
<p>The tutorial hereafter focuses on a C# example built using svcutil and the Axiomatics Policy Server&#8217;s SOAP-based PDP. With this code, it is therefore possible to invoke the Java-based SOAP-based web service from any .Net application.</p>
<h2>Pre-requisites</h2>
<p>Before you get started, you will need the .Net framework 3+ as well as the Axiomatics Policy Server. You can download them here:</p>
<ul>
<li>.Net framework: <a href="http://msdn.microsoft.com/en-us/netframework/aa569263">download</a></li>
<li>Axiomatics Policy Server: <a href="http://www.axiomatics.com/contact-axiomatics.html">request a download &#038; evaluation license</a></li>
</ul>
<h2>Generating the .Net client stub</h2>
<p>The .Net framework comes with a little utility called <a href="http://msdn.microsoft.com/en-us/library/ms733133.aspx">svcutil</a>. This utility can generate client stubs from a WSDL such as the one that comes with the Axiomatics Policy Server. Using svcutil (or the <em>add service reference&#8230;</em> option in Visual Studio), let&#8217;s generate the client stub.<br />
<div id="attachment_361" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.webfarmr.eu/wp-content/uploads/2012/01/addservicereferencedotnet.png"><img src="http://www.webfarmr.eu/wp-content/uploads/2012/01/addservicereferencedotnet-300x180.png" alt="Add Service Reference in C# .Net - MS Visual Studio" title="Add Service Reference in C# .Net - MS Visual Studio" width="300" height="180" class="size-medium wp-image-361" /></a><p class="wp-caption-text">Use the Add Service Reference to generate a C# client stub for the Axiomatics Policy Decision Point.</p></div><br />
This will bring up the following dialog where one can type in the path to a WSDL that describes any service for which one wants to create a client stub. In our case we can browse to our PDP service. In this example, the Axiomatics PDP is running locally inside an Apache Tomcat 7 web server. It is exposed as a SOAP web service.<br/><br />
The <em>Add Service Reference&#8230;</em> will scan the WSDL and display the available operations. We can inspect the different operations and eventually click on OK (after possibly changing the namespace for the newly generated client). Clicking on OK will lead to:</p>
<ul>
<li>the generation of a C# file called Reference.cs which contains the client stub and serialization code.</li>
<li>the creation of a default configuration file, <em>App.config</em>, which contains the configuration for the endpoint such as the URL, the type of security and binding as well the message formatting. You can find more information on these files at <a alt="Configuring Services Using Configuration Files" href="http://msdn.microsoft.com/en-us/library/ms733932.aspx">Microsoft</a>.</li>
</ul>
<div id="attachment_364" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.webfarmr.eu/wp-content/uploads/2012/01/discoverservicereference.png"><img src="http://www.webfarmr.eu/wp-content/uploads/2012/01/discoverservicereference-300x242.png" alt="Add a service reference and generate a client stub from a WSDL in Visual Studio 2010" title="Discovering a service reference in MS Visual Studio 2010" width="300" height="242" class="size-medium wp-image-364" /></a><p class="wp-caption-text">Use the Add Service Reference to browse to the PDP&#039;s WSDL and add a C# client stub.</p></div>
<p>We can now start writing a few lines of code to see how the client behaves. The code <em>svcutil</em> automatically generates is a direct mirror of the WSDL. This means the objects we can work with are objects defined in the WSDL. Let&#8217;s get started with a simple example. Let&#8217;s first create a standard C# class as below</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.axiomatics.sample.pep
{
    class PepC
    {
    }
}
</pre>
<p>What we now want to do is add a main method and an instance of the service reference we just added to our project. We can also call the GetVersion() method of the PDP which returns the product version (e.g. Axiomatics Policy Server 4.0.6).</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleApplication1.DelegentPDPNoSec;

namespace com.axiomatics.sample.pep
{
    class PepC
    {
        static DelegentPDPPortTypeClient client = new DelegentPDPPortTypeClient();
        static void Main(String[] args)
        {
            client = new DelegentPDPPortTypeClient();
            GetVersion gv = new GetVersion();
            client.GetVersion(gv);
        }
    }
}
</pre>
</p>
<p>Let&#8217;s now focus on the actual authorization methods. The Axiomatics Policy Server includes a XACML 3.0 PDP which expects a XACML request and sends a XACML response back. The method we need to use to send a XACML request is <em>InstanceAccessQuery3(&#8230;)</em>. We can simply add the line <code>client.InstanceAccessQuery3();</code>. However this method needs a parameter, namely the SOAP-wrapped XACML request. Let&#8217;s start from the beginning then and start creating a XACML request, bundle it inside the SOAP message and pass to our WCF SOAP client stub.</p>
<p>A XACML request is made of any number of attributes grouped into categories, typically the subject, resource, action, and environment categories. A request is simply the XACML representation of a plain old English question e.g. <em>can Alice view the document?</em> In this example:</p>
<ul>
<li>Alice would be a subject identifier and belong to the subject category.</li>
<li>View would be an action identifier and belong to the action category</li>
<li>Document would be a resource type and belong to the resource category</li>
</ul>
<p>An attribute in XACML is in fact made up of a bag of values (attributes can be multi-valued). Each value has a datatype (e.g. String, integer&#8230; Usually XML datatypes) and 1 or more values. Now, since attribute values can be any content as per the XACML 3.0 schema (see below), this means that <em>svcutil</em> generates classes that will require XML nodes to be built to set the value of an attribute. This is not particularly friendly and we will factor that away in a later part of this tutorial.</p>
<pre class="brush: xml; light: false; title: ; toolbar: true; notranslate">
	&lt;xs:complexType name=&quot;AttributeValueType&quot; mixed=&quot;true&quot;&gt;
		&lt;xs:complexContent mixed=&quot;true&quot;&gt;
			&lt;xs:extension base=&quot;xacml:ExpressionType&quot;&gt;
				&lt;xs:sequence&gt;
					&lt;xs:any namespace=&quot;##any&quot; processContents=&quot;lax&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/&gt;
				&lt;/xs:sequence&gt;

				&lt;xs:attribute name=&quot;DataType&quot; type=&quot;xs:anyURI&quot; use=&quot;required&quot;/&gt;
				&lt;xs:anyAttribute namespace=&quot;##any&quot; processContents=&quot;lax&quot;/&gt;
			&lt;/xs:extension&gt;
		&lt;/xs:complexContent&gt;
	&lt;/xs:complexType&gt;
</pre>
<p>First off, let&#8217;s create the attribute that will represent the subject id <em>Alice</em>. We will start from creating a string that contains the value Alice. In a real scenario, this value would be read from an authentication mechanism.</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 1. let's create a subject attribute
            String subjectId = &quot;Alice&quot;;
</pre>
<p>We now want to store that value inside an AttributeValue. To do that we must use the objects generated automatically by <em>svcutil</em>.</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 2. let's store the value inside an array of XmlNode[] preparing it for the SOAP call
            XmlDocument dom = new XmlDocument();
            XmlNode node = dom.CreateNode(XmlNodeType.Text, subjectId, null);
            XmlNode[] nodes = new XmlNode[1];
            // 3. let's store the XML any nodes inside an array of attribute values
            AttributeValueType1 aValue = new AttributeValueType1();
            aValue.Any = nodes;
            aValue.DataType = &quot;http://www.w3.org/2001/XMLSchema#string&quot;;
            // we use an array below since attributes in XACML can be multi-valued
            AttributeValueType1[] values = new AttributeValueType1[] { aValue };
</pre>
<p>In the code above, note that we specify the data type of Alice. Most of the XACML datatypes are directly taken from XML itself. The list is defined in the <a href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-cs-01-en.pdf" alt="Link to the XACML 3.0 specification PDF" target="another">XACML 3.0 specification</a>. Also note we use an array of AttributeValueType1 since there can be several attribute values per attribute in XACML (the multi-valued nature of XACML attributes).<br/><br />
Let&#8217;s now wrap the values inside a XACML attribute (see the <a alt="The XACML 3.0 attribute element" href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-cs-01-en.html#_Toc265751056">specification</a> for details):</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 4. create the containing attribute
            AttributeType1 attrContent = new AttributeType1();
            attrContent.Issuer = &quot;some issuer&quot;; // usually leave that blank
            attrContent.AttributeId = &quot;subject-id&quot;;
            attrContent.AttributeValue = values;
            attrContent.IncludeInResult = true;
            AttributeType1[] attrContents = new AttributeType1[] { attrContent };
</pre>
<p>In the above code, note the use of <em>IncludeInResult</em>. This relates to the ability of a PDP to return the attributes initially sent in the request along with the decision. This is useful when using the <a alt="XACML v3.0 Multiple Decision Profile Version 1.0" href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-multiple-v1-spec-en.html">Multiple Decision Profile</a>. Also note that attributes can have an <em>issuer</em>. This is used in the matching process of the evaluation of a XACML request against a XACML policy.<br/><br />
Now that we have attributes and their values, in this case subject-id and Alice, we can group them (it) inside a given category. This is what the code hereafter does.</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 5. create the category containing the attr and return
            AttributesType subjectAttr = new AttributesType();
            subjectAttr.Category = &quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot;;
            subjectAttr.Attribute = attrContents;
            // repeat the code above for any attribute e.g. actionAttr, resourceAttr...
</pre>
<p>Category identifiers are defined in the <a href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-cs-01-en.html#_Toc265751135" alt="Identifiers in the XACML 3.0 specification">XACML 3.0 specification</a>(section 10.2.6). In this case we use the subject category identifier, <em>urn:oasis:names:tc:xacml:1.0:subject-category:access-subject</em>.<br/><br />
We can now group together our different categories into an array of categories as below. We then build a XACML request from which we derive a SOAP request (merely the wrapping of the XACML request inside a SOAP message).</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 6. bundle the attributes inside the set of attributes for the XACML request
            AttributesType[] attrs = new AttributesType[] { subjectAttr, actionAttr, resourceAttr };
            // 7. build the XACML request
            RequestType1 xacmlRequest = new RequestType1();
            xacmlRequest.Attributes = attrs;
            InstanceAccessQuery3 soapRequest = new InstanceAccessQuery3();
            soapRequest.InstanceId = &quot;my-pdp-instance&quot;;
            soapRequest.Request = xacmlRequest;
</pre>
<p>The InstanceId attribute in the code above refers to which PDP instance the request should be sent to. The Axiomatics Policy Server PDP has a multi-tenancy model and the PDP instance id helps identify to which particular instance the XACML request should go.</p>
<h2>Hands on the plumbing &#038; Handling the response</h2>
<p>
In the following code, we simply pass the XACML request to the client stub method to invoke the PDP service. Notice how the answer received can contain multiple results, each of which boasts a single decision. This, again, is due to the <a alt="XACML v3.0 Multiple Decision Profile Version 1.0" href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-multiple-v1-spec-en.html">Multiple Decision Profile</a> which supports sending and receiving multiple XACML requests in a single network exchange (e.g. SOAP request/response).</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
            // 8. send the XACML request and print the response
            InstanceAccessQuery3Response response = client.InstanceAccessQuery3(soapRequest);
            foreach(ResultType1 result in response.Response){
                Console.WriteLine(result.Decision);
            }
</pre>
</p>
<h2>Refactoring the generated code</h2>
<p>The code to create a single XACML attribute is fairly lengthy and repetitive due to the automatic code generation done with <em>svcutil</em>. To get around that, let&#8217;s create a small utility method which creates the right type of attribute object from the simple building blocks of an attribute: its id, value, type, and issuer.</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
        public static AttributesType createAttribute(String id, Uri category, String value, Uri datatype, String issuer)
        {
            // 1. create the value
            AttributeValueType1 aValue = new AttributeValueType1();
            aValue.Any = createXMLBlob(value);
            aValue.DataType = datatype.ToString();
            AttributeValueType1[] values = new AttributeValueType1[]{aValue};
            // 2. create the containing attribute
            AttributeType1 attrContent = new AttributeType1();
            attrContent.Issuer = issuer;
            attrContent.AttributeId = id;
            attrContent.AttributeValue = values;
            attrContent.IncludeInResult = true;
            AttributeType1[] attrContents = new AttributeType1[] { attrContent };
            // 3. create the category containing the attr and return
            AttributesType attr = new AttributesType();
            attr.Category = category.ToString();
            attr.Attribute = attrContents;
            return attr;
        }
</pre>
<p>.<br />
With this small utility in hand, we can rewrite our example in a more efficient way. Below, I have included an entire simple SamplePEP class which you can use with the Axiomatics PDP.</p>
<pre class="brush: csharp; light: false; title: ; toolbar: true; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.axiomatics.xacml;
using System.Xml;
using ConsoleApplication1.DelegentPDPNoSec;

namespace com.axiomatics.sample.pep
{
    class SamplePEP
    {
        static DelegentPDPPortTypeClient client = new DelegentPDPPortTypeClient();
        private InstanceAccessQuery3 soapRequest;
        private RequestType1 xacmlRequest;
        static void Main2(string[] args)
        {

            SamplePEP pep = new SamplePEP();
            pep.callPDP();

        }

        public static XmlNode[] createXMLBlob(String content)
        {
            XmlDocument dom = new XmlDocument();
            XmlNode node = dom.CreateNode(XmlNodeType.Text, content, null);
            XmlNode[] nodes = new XmlNode[1];
            return nodes;
        }

        public static AttributesType createAttribute(String id, Uri category, String value, Uri datatype, String issuer)
        {
            // 1. create the value
            AttributeValueType1 aValue = new AttributeValueType1();
            aValue.Any = createXMLBlob(value);
            aValue.DataType = datatype.ToString();
            AttributeValueType1[] values = new AttributeValueType1[]{aValue};
            // 2. create the containing attribute
            AttributeType1 attrContent = new AttributeType1();
            attrContent.Issuer = issuer;
            attrContent.AttributeId = id;
            attrContent.AttributeValue = values;
            attrContent.IncludeInResult = true;
            AttributeType1[] attrContents = new AttributeType1[] { attrContent };
            // 3. create the category containing the attr and return
            AttributesType attr = new AttributesType();
            attr.Category = category.ToString();
            attr.Attribute = attrContents;
            return attr;
        }

        public void callPDP()
        {
            // 1. collect attributes
            Console.WriteLine(&quot;// 1. create attributes&quot;);
            AttributesType subjectAttr = createAttribute(&quot;subject-id&quot;, Constants.SUBJECT_CAT, &quot;Alice&quot;, new Uri(&quot;http://www.w3.org/2001/XMLSchema#string&quot;), &quot;&quot;);
            AttributesType actionAttr = createAttribute(&quot;action-id&quot;, Constants.ACTION_CAT, &quot;view&quot;, new Uri(&quot;http://www.w3.org/2001/XMLSchema#string&quot;), &quot;&quot;);
            AttributesType resourceAttr = createAttribute(&quot;resource-id&quot;, Constants.RESOURCE_CAT, &quot;Document&quot;, new Uri(&quot;http://www.w3.org/2001/XMLSchema#string&quot;), &quot;&quot;);
            AttributesType[] attrs = new AttributesType[] { subjectAttr, actionAttr, resourceAttr };
            // 2. create XACML request
            Console.WriteLine(&quot;// 2. create XACML request&quot;);
            xacmlRequest = new RequestType1();
            xacmlRequest.Attributes = attrs;
            // 3. create wrapping SOAP request
            Console.WriteLine(&quot;// 3. create wrapping SOAP request&quot;);
            soapRequest = new InstanceAccessQuery3();
            soapRequest.InstanceId = &quot;my-pdp-instance&quot;;
            soapRequest.Request = xacmlRequest;

            try
            {
                InstanceAccessQuery3Response resp = client.InstanceAccessQuery3(soapRequest);
                ResultType1[] results = resp.Response;
                foreach (ResultType1 res in results)
                {
                    DecisionType1 decision = res.Decision;
                    Console.WriteLine(decision.ToString());
                }
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
            }
        }
    }
}
</pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2012/02/fine-grained-access-control-using-xacml-in-c-applications-and-the-net-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The distance of a second</title>
		<link>http://www.webfarmr.eu/2011/11/the-distance-of-a-second/</link>
		<comments>http://www.webfarmr.eu/2011/11/the-distance-of-a-second/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 12:09:59 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=349</guid>
		<description><![CDATA[One of my side hobbies is to browse the web for nice designs and interesting ways to represent information. I really like 2 blogs in particular: Information is Beautiful and the second is Grain Edit (check out their respective web stores for neat stuff).
In addition to liking design, I also truly  [...]]]></description>
			<content:encoded><![CDATA[<p>One of my side hobbies is to browse the web for nice designs and interesting ways to represent information. I really like 2 blogs in particular: <a href="http://www.informationisbeautiful.net/" title="Information is beautiful" target="_blank">Information is Beautiful</a> and the second is <a href="http://grainedit.com/" title="Grain Edit - modern design" target="_blank">Grain Edit</a> (check out their respective web stores for neat stuff).</p>
<p>In addition to liking design, I also truly like techy stuff and in particular programming languages or declarative languages (by that I mean Java in the former instance and XML in the latter). SVG is a great standard to draw vectorial images using XML.</p>
<p>I had therefore had my first attempt at representing information in a neat way: the distance of a second (the distance an animal / human / vehicle achieves in a fixed amount of time i.e. 1/60th of a minute). And the result is below&#8230;</p>
<div id="attachment_350" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.webfarmr.eu/wp-content/uploads/2011/11/distance-of-a-second.png"><img src="http://www.webfarmr.eu/wp-content/uploads/2011/11/distance-of-a-second-300x212.png" alt="Distance of a second" title="Distance of a second" width="300" height="212" class="size-medium wp-image-350" /></a><p class="wp-caption-text">Distance of a second</p></div>
<p>I used Inkscape to design the file. I used icons from the amazing <a href="http://thenounproject.com/" title="The Noun Project" target="_blank">Noun Project</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/11/the-distance-of-a-second/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XACML 102: XPath and XACML</title>
		<link>http://www.webfarmr.eu/2011/08/xacml-102-xpath-and-xacml/</link>
		<comments>http://www.webfarmr.eu/2011/08/xacml-102-xpath-and-xacml/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 15:57:29 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=330</guid>
		<description><![CDATA[Some definitions


XPath: (see the W3C definition) query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. (source: wikipedia).

XACML: (see the OASIS definition)  [...]]]></description>
			<content:encoded><![CDATA[<h2>Some definitions</h2>
<ul>
<li>
<b>XPath</b>: (see the <a href="http://www.w3.org/TR/xpath20/">W3C definition</a>) query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. (source: <a href="http://en.wikipedia.org/wiki/XPath">wikipedia</a>).</li>
<li>
<b>XACML</b>: (see the <a href="http://www.oasis-open.org/committees/xacml/">OASIS definition</a>) access control markup language defined to provided a standardized means to express fine-grained access control. XACML includes a reference architecture, a policy language, and a request / response protocol.</li>
</ul>
<h2>Uses of XPath in XACML</h2>
<p>XPath is used in attribute selectors in XACML. Attribute selectors are defined in the specification in section 5.30. Attribute selectors contain XPath expressions that are run on the XML content that is sent within a XACML request.</p>
<h3>XPath used in a single XACML request</h3>
<p>In this use case, we want to use XPath in a policy / rule target or condition in order to use a value contained in the XML payload sent in the <Content/> element of the XACML request (NB: there can be such an element in any of the attribute categories in the XACML request).<br />
In the example here, we are sending an XML book record which contains a book title, publisher, and ISBN number. We want to be able to make an access control request based on the book title and the age of the reader. If the reader is less than 18 and if the title is equal to <em>Gulliver&#8217;s travels</em>, then the decision is a Permit.</p>
<pre class="brush: xml; light: false; title: ; toolbar: true; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;xacml3:Policy xmlns:xacml3=&quot;urn:oasis:names:tc:xacml:3.0:core:schema:wd-17&quot; PolicyId=&quot;xpath-target-single-req&quot; RuleCombiningAlgId=&quot;urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides&quot; Version=&quot;1&quot;&gt;
  &lt;xacml3:Description/&gt;
&lt;xacml3:PolicyDefaults&gt;&lt;xacml3:XPathVersion&gt;http://www.w3.org/TR/1999/REC-xpath-19991116&lt;/xacml3:XPathVersion&gt;&lt;/xacml3:PolicyDefaults&gt;
  &lt;xacml3:Target&gt;
    &lt;xacml3:AnyOf&gt;
      &lt;xacml3:AllOf&gt;
        &lt;xacml3:Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:string-equal&quot;&gt;
          &lt;xacml3:AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;Gulliver's travels&lt;/xacml3:AttributeValue&gt;
          &lt;xacml3:AttributeSelector Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot; MustBePresent=&quot;false&quot; Path=&quot;/book/title/text()&quot;/&gt;
        &lt;/xacml3:Match&gt;
        &lt;xacml3:Match MatchId=&quot;urn:oasis:names:tc:xacml:1.0:function:integer-greater-than&quot;&gt;
          &lt;xacml3:AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#integer&quot;&gt;18&lt;/xacml3:AttributeValue&gt;
          &lt;xacml3:AttributeDesignator AttributeId=&quot;age&quot; Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; DataType=&quot;http://www.w3.org/2001/XMLSchema#integer&quot; MustBePresent=&quot;false&quot;/&gt;
        &lt;/xacml3:Match&gt;
      &lt;/xacml3:AllOf&gt;
    &lt;/xacml3:AnyOf&gt;
  &lt;/xacml3:Target&gt;
  &lt;xacml3:Rule Effect=&quot;Permit&quot; RuleId=&quot;allow-read&quot;&gt;
    &lt;xacml3:Description/&gt;
    &lt;xacml3:Target/&gt;
  &lt;/xacml3:Rule&gt;
&lt;/xacml3:Policy&gt;</pre>
<p>And the corresponding XACML request:</p>
<pre class="brush: xml; light: false; title: ; toolbar: true; notranslate">&lt;xacml-ctx:Request ReturnPolicyIdList=&quot;true&quot; CombinedDecision=&quot;false&quot; xmlns:xacml-ctx=&quot;urn:oasis:names:tc:xacml:3.0:core:schema:wd-17&quot;&gt;
   &lt;xacml-ctx:Attributes Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:environment&quot; &gt;
   &lt;/xacml-ctx:Attributes&gt;
   &lt;xacml-ctx:Attributes Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:action&quot; &gt;
   &lt;/xacml-ctx:Attributes&gt;
   &lt;xacml-ctx:Attributes Category=&quot;urn:oasis:names:tc:xacml:1.0:subject-category:access-subject&quot; &gt;
      &lt;xacml-ctx:Attribute AttributeId=&quot;urn:oasis:names:tc:xacml:1.0:subject:subject-id&quot; IncludeInResult=&quot;true&quot;&gt;
         &lt;xacml-ctx:AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#string&quot;&gt;Joe&lt;/xacml-ctx:AttributeValue&gt;
      &lt;/xacml-ctx:Attribute&gt;
      &lt;xacml-ctx:Attribute AttributeId=&quot;age&quot; IncludeInResult=&quot;true&quot;&gt;
         &lt;xacml-ctx:AttributeValue DataType=&quot;http://www.w3.org/2001/XMLSchema#integer&quot;&gt;14&lt;/xacml-ctx:AttributeValue&gt;
      &lt;/xacml-ctx:Attribute&gt;
   &lt;/xacml-ctx:Attributes&gt;
   &lt;xacml-ctx:Attributes Category=&quot;urn:oasis:names:tc:xacml:3.0:attribute-category:resource&quot; &gt;
      &lt;xacml-ctx:Content&gt;&lt;book&gt;
&lt;title&gt;Gulliver's travels&lt;/title&gt;
&lt;isbn&gt;xx-yy-zz&lt;/isbn&gt;
&lt;publisher&gt;Axiomatics&lt;/publisher&gt;
&lt;/book&gt;      &lt;/xacml-ctx:Content&gt;
   &lt;/xacml-ctx:Attributes&gt;
&lt;/xacml-ctx:Request&gt;</pre>
<h3>XPath used in a multiple decision request</h3>
<p>One of the key features of XACML is to be able to define profiles for specific uses (either best practices e.g. in export control or actual technical extensions such as the delegation profile). One such profile is the Multiple Decision Profile which explains how to create a single XACML request that will in fact represent multiple access control requests. The <a href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-multiple-v1-spec-en.html">profile</a> gives 4 ways of expressing such requests one of which makes use of XPath. Here is how:<br />
Let&#8217;s assume the incoming XACML request is about reading books. There will be 2 attributes: the subject id, and the action &#8216;read&#8217;. The resource category&#8217;s XML content element will contain an XML element with multiple book children as follows:</p>
<pre class="brush: xml; light: false; title: ; toolbar: true; notranslate">&lt;books&gt;
   &lt;book&gt;
      &lt;title&gt;The Lord of the Rings&lt;/title&gt;&lt;author&gt;JRR Tolkien&lt;/author&gt;
   &lt;/book&gt;
   &lt;book&gt;
      &lt;title&gt;Pride and Prejudice&lt;/title&gt;&lt;author&gt;Jane Austen&lt;/author&gt;
   &lt;/book&gt;
   &lt;book&gt;
      &lt;title&gt;His Dark Materials&lt;/title&gt;&lt;author&gt;Philip Pullman&lt;/author&gt;
   &lt;/book&gt;
&lt;/books&gt;</pre>
<p>The XML document aforementioned lends itself well to a multiple question of the form &#8220;Can Joe read A? Can Joe read B? Can Joe read C?&#8221;. This is exactly the purpose of the use of XPath in the Multiple Decision Profile, but one has to be extremely careful in its use in order to avoid a few pitfalls.</p>
<p>In a follow-up, I will give sample policies and requests illustrating a correct use of the MDP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/08/xacml-102-xpath-and-xacml/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Axiomatics seeks serious contender &#8211; impressions of Gartner Catalyst 2011 (#CAT11) 30,000 ft up.</title>
		<link>http://www.webfarmr.eu/2011/08/axiomatics-xacml-competition-gartner-catalyst-2011/</link>
		<comments>http://www.webfarmr.eu/2011/08/axiomatics-xacml-competition-gartner-catalyst-2011/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 12:22:59 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>
		<category><![CDATA[attestation]]></category>
		<category><![CDATA[axiomatics]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[gartner]]></category>
		<category><![CDATA[oasis]]></category>
		<category><![CDATA[standard]]></category>
		<category><![CDATA[XACML Bites]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=320</guid>
		<description><![CDATA[I had the opportunity to fly with Axiomatics CEO, Babak Sadighi, on our trip back from San Diego to Stockholm. During the 15-hour journey, Babak and I shared our experience and impressions of the conference.
Gearing up to Catalyst 2011
The week of the 23rd of July turned out to be a pretty busy one  [...]]]></description>
			<content:encoded><![CDATA[<p>I had the opportunity to fly with Axiomatics CEO, Babak Sadighi, on our trip back from San Diego to Stockholm. During the 15-hour journey, Babak and I shared our experience and impressions of the conference.</p>
<h2>Gearing up to Catalyst 2011</h2>
<p>The week of the 23rd of July turned out to be a pretty busy one at <a href="http://www.axiomatics.com">Axiomatics</a>. As solutions architect, I flew over to San Diego for the much anticipated Catalyst Conference. I was keen on getting the dial tone in the Identity and Access Management space. Catalyst was to be the perfect place to catch up with <a href="http://www.gartner.com">Gartner </a>analysts as well as colleagues from partner companies.<br />
As a vendor of <a href="http://www.axiomatics.com/pure-xacml.html">XACML solutions</a> and pioneers of the XACML technology, my colleagues and I were keen on getting the opinions of analysts and end users to take those back home and enhance our offering.<br />
In the 12 months since #CAT10, we have seen a surge in sales activities: an increased number of new leads, new contracts, and repeated interactions with prospect customers. Along with the increased frequency came more breadth. 2009 / 2010 was more about a handful of verticals. Today, requirements come from twice as many verticals from health and finance to media and manufacturing. And it brings us pride to see wider-spread adoption. Traffic on our website spiked; traffic on Gerry’s blog and mine also increased phenomenally.<br />
And it’s not only customers: the company struck new partnerships with leading IAM system integrators such as <a href="http://www.firstpointglobal.com/partners">First Point Global</a> in APAC or Mycroft in the USA. New technical partnerships were announced with best-in-class vendors such as <a href="http://www.radiantlogic.com">Radiant Logic</a> (virtual directories).<br />
We saw this intense activity as a sign of market readiness. As such, we had very high expectations in San Diego. We were eager to learn about customer experiences &#8211; your experiences &#8211; as well as competitors’ experiences and lastly analysts’ views on the coming twelve months.</p>
<h2>New use cases, new opportunities</h2>
<p>In a sense, our expectations were exceeded: XACML was all over the conference (at least in the identity track). <a href="https://twitter.com/#!/bobblakley">Bob Blakley</a> and his team repeatedly mentioned the technology, its now proven maturity, the use cases, and the existing vendors such as ourselves but also promising open source alternatives such as <a href="http://wso2.org/library/identity-server/user-management/xacml">WS02 </a>or <a href="http://www.jboss.org/picketbox">PicketBox</a>.<br />
One end-user organization, Fidelity, came to talk about their deployment using XACML and how they meet with regulatory compliance. (more details on the track <a href="http://www.gartner.com/technology/summits/na/catalyst/track-1-identity.jsp">here</a>)<br />
In a separate track, <a href="https://twitter.com/#!/iglazer">Ian Glazer</a> talked about the importance of high-quality data for IAM (<a href="http://agendabuilder.gartner.com/CATUS2/WebPages/SessionDetail.aspx?EventSessionId=897">How IAM Depends On Hi-Fi Data… And Doesn&#8217;t Know It Yet</a>). This is what we call making smart decisions with trustworthy attributes.<br />
Axiomatics was also in the headlines as its CEO signed a new partnership agreement with <a href="http://www.idmworks.com/blog/axiomatics-announces-partnership-with-idmworks">IDMWorks</a> to strengthen the brand’s presence in the cloud.<br />
And speaking of cloud, Axiomatics partnered with <a href="http://www.radiantlogic.com">Radiant Logic</a> to implement a cloud-based demonstrator using the Axiomatics Policy Server combined with RadiantOne VDS Context Edition to deliver fine-grained access control on a sales application.<br />
In another instance, Axiomatics partnered with <a href="http://www.layer7tech.com">Layer 7 Tech</a> to deliver fast, secure, and context-aware SOA security for any type of applications again hosted inside an Amazon instance.<br />
It really felt like we were on par and that 2011 was year 1 of widespread XACML adoption. There was even a lunch session entirely dedicated to XACML.<br />
This leads me to conclude that to those skeptics, XACML is now a reality.</p>
<h2>Where’s the competition?</h2>
<p>In a thriving market, one would expect a wide range of competitors to react and strengthen their offering; to act responsibly and deliver better products. In that sense, we were a bit led down. It’s a well-known fact that the driving forces behind the XACML standard are IBM, Oracle, and Axiomatics. I would like to stress that Axiomatics in particular has fueled the efforts in the last 6 years with its CTO, Erik Rissanen, taking the editorial responsibility for XACML 3.0. But the larger organizations, as often, are now lagging behind a handful of smaller, faster players such as Axiomatics.<br />
In fact there was a single other small vendor at Catalyst 2011 with a XACML offering but they have yet to take part in the innovation effort.<br />
For instance, we would love to see more industry engagement in the XACML technical committee. It’s not just about engagement. It’s also about endorsement: the reason XACML 3.0 has not become a standard is because it has not been attested by 3 different vendors and/or end-users. <a href="http://markmail.org/message/5lr7vvl54b2rzjvf">Axiomatics has attested</a> to the latest implementation of the standard and several other profiles. We are still waiting for other vendors to follow suit. It would do the standard good if more enterprise-ready implementations stood up to the challenge.<br />
<div id="attachment_321" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.webfarmr.eu/wp-content/uploads/2011/08/stats.png"><img src="http://www.webfarmr.eu/wp-content/uploads/2011/08/stats-300x203.png" alt="Axiomatics involvement in the XACML TC: CTO Erik Rissanen is the 2nd most prolific contributor." title="XACML TC Mailing List statistics" width="300" height="203" class="size-medium wp-image-321" /></a><p class="wp-caption-text">Axiomatics involvement in the XACML TC: CTO Erik Rissanen is the 2nd most prolific contributor.</p></div><br />
If you want to know more about contributions, the history of the XACML TC, and the current work, check out the <a href="http://markmail.org/search/xacml+list:org.oasis-open.lists.xacml">TC mailing list</a> and the <a href="http://markmail.org/search/xacml+list:org.oasis-open.lists.xacml-dev">XACML dev list</a>.</p>
<h2>Fact or fiction?</h2>
<p>When I look at the offering in the security space, my head almost always ends up spinning. There are many different vendors to choose from (quite a few were at Catalyst) and they offer many different standards-based solutions. Some of my customers struggle to understand the difference between authentication and authorization. The messaging we give out is of critical importance and we should make sure we state verifiable facts.<br />
In the XACML space, many vendors claim some level of implementation. How complete is their implementation? Others claim to be the fastest. Are they really? Have they compared? I wrote a <a href="http://www.webfarmr.eu/2011/07/the-worlds-fastest-xacml-engine/">post</a> on this very topic pointing readers to areas that need serious investigation. Caution is the key word here.<br />
This is where we would need a serious report from the analyst community &#8211; a health check if you like &#8211; on the state of fine-grained access control today. A magic quadrant perhaps?</p>
<h2>Outlook</h2>
<p>We are pretty excited at <a href="http://www.axiomatics.com">Axiomatics</a> about the future. New customers are knocking on our doors and our teams are expanding (sales; engineering; drop me a line if you are keen on joining us). Yet we want to make sure that the one standard we believe in, the reference for fine-grained access control doesn’t get tarnished by false marketing claims. We want the competition to rise to the challenge of XACML 3.0. We can only grow through a healthy debate between vendors that offer comparable products. And we want you, the customer, to reap the benefits.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/08/axiomatics-xacml-competition-gartner-catalyst-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The world&#8217;s fastest XACML engine</title>
		<link>http://www.webfarmr.eu/2011/07/the-worlds-fastest-xacml-engine/</link>
		<comments>http://www.webfarmr.eu/2011/07/the-worlds-fastest-xacml-engine/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 15:08:46 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>
		<category><![CDATA[XACML Bites]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=304</guid>
		<description><![CDATA[In the last few months, I have been reading statements from a wide variety of vendors / open-source XACML implementations that they have the world&#8217;s fastest 100% XACML standards-based engine.
This reminds me of heated debates that involved national pride and engineering feats when the French and  [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few months, I have been reading statements from a wide variety of vendors / open-source XACML implementations that they have the world&#8217;s fastest 100% XACML standards-based engine.</p>
<p>This reminds me of heated debates that involved national pride and engineering feats when the French and Japanese were head-to-head in designing the world&#8217;s fastest trains. And the Chinese have since then caught up. The Wikipedia <a href="http://en.wikipedia.org/wiki/High-speed_rail#Definition_of_high-speed_rail">article</a> is a trove of trivia when it comes to speed and how records were achieved (or what they actually mean). In the table summary, I can spot quite a few &#8216;current world record&#8217; labels&#8230; If by the time you finish reading the article, your head is not spinning one way or the other, then you&#8217;re ready to take on the &#8216;fatest XACML engine&#8217; claim.</p>
<p>So who&#8217;s the fastest? How can one claim to be the fastest? After all what does it mean? Don&#8217;t you need to compare to other engines? To date, only one such comparison has been done by academics on open-source engines [1].</p>
<p>In pure absolute terms, the fastest engine is the one that can process the most XACML access control requests in a given time, usually brought down to a second for comparison purposes. The statement however should raise a few questions:</p>
<ol>
<li><u>Are these live access control requests?</u><br />
    The requests being sent are live requests. There is no caching involved (no decision caching, no attribute caching). The PDP engine is processing each and every request and is returning a decision.</li>
<li><u>Are the requests actually using XACML?</u><br />
    The request should be XACML-conformant. Sadly, not many implementations out there claim to conform with the XACML 2.0 standard or XACML 3.0 specification. Check that the solution you go for does. If a solution manages high levels of access control requests by cutting corners or not respecting the standard, the solution will fall apart when scaling or when evolving towards new, more demanding scenarios.<br/></li>
<li><u>How are the requests being transported?</u><br />
    The form factor of the request: in a performance test or benchmark used to create those figures, any form factor can be used. If one uses XACML expressed in its XML form inside a SAML assertion inside a SOAP message, I would bank the figures would rate poorly. SOAP&#8217;s middle name is not &#8216;<a href="http://en.wikipedia.org/wiki/Speedy_Gonzales">Speedy Gonzales</a>&#8216;. Typically, a performance test would therefore be achieved using XACML&#8217;s representation in code (Java, C, C#, depending again on the implementation. SunXACML uses Java).<br/></li>
<li><u>Do the requests &#038; policies used in benchmarks accurately represent business complexity?</u>
<p>    The request and the policies should be meaningful and represent a varying level of complexity. When you are presented with a benchmark, ask to see how the results were computed and real-world complexity was simulated. A fellow vendor likes to use his kids in examples. I don&#8217;t have any so I&#8217;ll use my niece as an example &#8211; she can splutter out &#8216;no&#8217; so fast that I&#8217;d reckon she might well be the fastest decision engine in the world. True, she&#8217;s not XACML-conformant and besides she&#8217;s got a deny-all policy. That&#8217;s not very useful. So remember, ask how complex a request is and how large the policy set being evaluated is.<br/></li>
<li><u>What is the architecture being used?</u><br />
    Performance can be impacted or enhanced depending on several architectural considerations: how many engines are used? How are engines combined together? Can engines scale horizontally? Vertically?<br/></li>
<li><u>Do performance figures represent real production data?</u><br/>Have they simply been estimated in a lab environment? In the end, performance needs to be proven in real-time and in real-world use case scenarios. What actual experience and evidence from production systems have you been given?</li>
</ol>
<p>It&#8217;s easy to claim one is the fastest. But one should tread carefully and check the face value of any such statement. Ask to understand how performance levels are achieved. Ask how such performance levels can be sustained and made resilient to different attacks or simply highly volatile levels of traffic.</p>
<p>The good news is <a href="http://www.axiomatics.com/pure-xacml.html">XACML</a> provides a very clean and decoupled architecture that makes it easy to address these concerns. It&#8217;s just a matter to make sure whether the solution you go for does respect the XACML architecture. As an architect at <a href="http://www.axiomatics.com">Axiomatics</a>, I&#8217;m proud to say we do. And that&#8217;s business sense. Respecting the standard is a first stepping stone to a future-proof solution but it is not enough: performance is critical. Our products reach extremely high levels of performance through years of research &#038; innovation &#8211; and we prove this on a daily basis in the world&#8217;s largest deployments &#8211; be it in terms of users, services, data, or simply throughput.</p>
<p>PS: don&#8217;t forget to come visit us at <a href="http://www.axiomatics.com/component/rsevents/event/36-gartner-catalyst-conference.html">Gartner</a> in San Diego later this month where we will illustrate fine-grained access control in the cloud with best-of-breed vendors <a href="http://www.radiantlogic.com/">Radiant Logic</a> (attribute virtualization) and <a href="http://www.layer7tech.com/">Layer 7</a> (SOA security &#8211; see their flyer here: http://www.layer7tech.com/beachparty/).</p>
<p><em>[1] Fatih Turkmen and Bruno Crispo. 2008. Performance evaluation of XACML PDP implementations. In Proceedings of the 2008 ACM workshop on Secure web services (SWS &#8217;08). ACM, New York, NY, USA, 37-44. DOI=10.1145/1456492.1456499 http://doi.acm.org/10.1145/1456492.1456499 </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/07/the-worlds-fastest-xacml-engine/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Coarse-grained vs. fine-grained access control &#8211; part I</title>
		<link>http://www.webfarmr.eu/2011/05/coarse-grained-vs-fine-grained-access-control-part-i/</link>
		<comments>http://www.webfarmr.eu/2011/05/coarse-grained-vs-fine-grained-access-control-part-i/#comments</comments>
		<pubDate>Sat, 28 May 2011 21:46:40 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>
		<category><![CDATA[ABAC]]></category>
		<category><![CDATA[access control]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[RBAC]]></category>
		<category><![CDATA[XACML Bites]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=284</guid>
		<description><![CDATA[A few weeks ago, Baljinder Wadhwa, a consultant at HP, started an interesting thread on coarse-grained vs. fine-grained access control trying to figure out what the differences were between the two. His question generated a high level of great answers that went in different directions. This post  [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, <a href="http://www.linkedin.com/pub/baljinder-wadhwa/17/589/824">Baljinder Wadhwa</a>, a consultant at HP, started an interesting <a href="http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&#038;discussionID=54004267&#038;gid=66476&#038;commentID=39410764&#038;goback=.amf_66476_58160476&#038;trk=NUS_DISC_Q-subject#commentID_39410764">thread</a> on coarse-grained vs. fine-grained access control trying to figure out what the differences were between the two. His question generated a high level of great answers that went in different directions. This post aims at summarizing those answers, bringing in my own view, and producing a structured answer to Baljinder&#8217;s question. Here goes&#8230;</p>
<h2>Vocabulary definition</h2>
<ul>
<li>Coarse: (1) composed of relatively large parts or particles &lt;coarse sand&gt; (2) : loose or rough in texture &lt;coarse cloth&gt; </li>
<li>Fine: (1) very thin in gauge or texture <fine thread> (2) : not coarse &lt;fine sand&gt; (3) : very small <fine print> (4) : keen &lt;a knife with a fine edge> (5) : very precise or accurate &lt;a fine adjustment&gt; &lt;trying to be too fine with his pitches&gt; </li>
</ul>
<p><em>Definitions from the <a href="http://m-w.com">Merriam-Webster</a></em><br />
The definitions start to hint at what the differences might be: fine-grained access control will work on smaller items whereas coarse-grained access control will work on larger items.<br />
Granularity can apply to the message being intercepted or the information being considered for access control. Ultimately, the rules being define will allow for more or less granular AC. Examples:</p>
<ul>
<li>Coarse: Employees can open the door.</li>
<li>Fine: Employees based in the US can open or close the door during office hours.</li>
<li>Finer: Employees in the Engineering department and based in the US can open or close the door during office hours if they are assigned to an active project.</li>
</ul>
<h2>A little history of access control</h2>
<p>In application security, there are grossly speaking 3 types of access control:</p>
<ul>
<li><strong>Access control lists</strong> (ACL): with access control lists, once a user is authenticated, that user is allowed to access an application or not depending on whether that user&#8217;s id is on a list of authorized users (white list) or blocked users (black list). This mode is either all-in or all-out. It is extremely coarse-grained from that perspective. It is also coarse-grained in the sense that it only considers one dimension, that of the user, ignoring resources, actions, and context. However, it is extremely fine-grained in the sense that it becomes a user-specific rule. In the previous examples, John is the user id that would be on the ACL for the <em>open door</em> action.</li>
<li><strong>Role-based access control</strong> (RBAC): sometimes, though, it is not who you are but rather what role(s) you embody. For instance, a person might be allowed to open a door. That right (or permission) is granted because that person has the role <u>employee</u>, not because of who they are. Typically, in RBAC, a user can have multiple roles to which different permissions can be granted. Take wordpress for instance, the popular blogging platform. WordPress lets users define roles and associate permissions to roles and then roles to users therefore transitively granting users permissions. But roles have their limits too. How do you express other conditions or parameters? What if you want to express a permission of the following form: &#8220;only employees can open the door between 9AM and 5PM&#8221;. With RBAC, you can express employee + open door. But you cannot really express the time constraint. In addition, what if you want employees who can only close doors? You would need to define employee_open and a employee_close role. This leads to role explosion.</li>
<li><strong>Attribute-based access control</strong>(ABAC): to address this, one needs to be more discriminate, finer in terms of what information is considered to define a rule. Instead of defining permissions based on roles only, one should be able to use attributes. Attributes are any bit of data, or label, that describes a user, resource, target, object, environment, or action. Anything from an apple, its color, and weight to a person eating that apple, the location of the apple&#8230; With ABAC, you can mix and match attributes to define extremely targeted (fine-grained) rules e.g. employees can open the door between 9AM and 10AM or close the door after 5PM if and only if the employee belongs to the &#8216;door opener&#8217; group.</li>
</ul>
<h2>Standards for access control</h2>
<p>In the previous paragraph, we looked at some broadly used and accepted access control models: ACL, RBAC, and ABAC (yes, access control is for acronym lovers). Let&#8217;s check out standards that back these models.</p>
<ul>
<li><strong><a href="http://webstore.ansi.org/RecordDetail.aspx?sku=ANSI+INCITS+359-2004">ANSI INCITS 359-2009</a> RBAC Role-Based Access Control</strong>: this standard defines role-based access control and its model.</li>
<li><strong>XACML</strong>: this OASIS-driven <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xacml">standard</a> defines a policy language, request/response protocol, and architecture that implement <a href="http://www.axiomatics.com/attribute-based-access-control.html">ABAC</a>.</li>
</ul>
<p>The NIST has a <a href="http://csrc.nist.gov/groups/SNS/rbac/standards.html">webpage dedicated to RBAC</a> which summarizes extremely well the different RBAC standards existing and their variations / applicability.</p>
<p>In addition to the ANSI RBAC and the OASIS XACML standards, there are standards for ACL but these tend to be OS-specific.</p>
<p>Of all the standards out there, XACML is the one providing the finest granularity.</p>
<h2>Defining access control granularity</h2>
<p>The granularity of an access control framework can be defined from two different angles:</p>
<ul>
<li><strong>the expressiveness of the grammar used to express access control rules</strong>:the more flexible a grammar and the more information it can cater for, the finer grained the resulting access control will be. XACML can consider attributes about users, resources, actions, and the environment. This makes it very fine-grained. RBAC implementations typically focus on the user role and the target application therefore losing a bit of granularity since it won&#8217;t be able to make access control decisions based on actions, other subject attributes, or the context.</li>
<li><strong>the ability of the &#8216;agents&#8217; to see more or less information</strong>: in order to make fine-grained access control decisions, there is a need for agents or interceptors to be able to inspect business messages flowing through them. If, for instance, an agent can only see the URI of an HTTP message and the user principal name, then it can (most likely) only make decisions based on that. On the other hand, if the agent is capable of inspecting the entire message, including all HTTP headers plus the payload of the message, then more fine-grained AC requests can be generated. This is why there are firewalls which typically look at TCP packets, XML gateways which look at SOAP/REST messages, and many other types of gateways / interceptors in between. Interceptors can be business app-specific e.g. interceptors for Sharepoint or SAP which enable fine-grained access control.</li>
</ul>
<p>In a second instalment, I will focus on the issues of scale around granularity of access control. I will also list some product categories and vendors that address different levels of granularity. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/05/coarse-grained-vs-fine-grained-access-control-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gluecon 2011 &#8211; day 1 &#8211; Axiomatics Interview: fine-grained access control for your APIs using XACML</title>
		<link>http://www.webfarmr.eu/2011/05/gluecon-2011-day-1-axiomatics-interview-fine-grained-access-control-for-your-apis-using-xacml/</link>
		<comments>http://www.webfarmr.eu/2011/05/gluecon-2011-day-1-axiomatics-interview-fine-grained-access-control-for-your-apis-using-xacml/#comments</comments>
		<pubDate>Thu, 26 May 2011 14:47:16 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=282</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="560" height="349" src="http://www.youtube.com/embed/3db677gXL4I" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/05/gluecon-2011-day-1-axiomatics-interview-fine-grained-access-control-for-your-apis-using-xacml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gluecon 2011 &#8211; Impressions of Day 1 &#8211; Waste Management Through Security Automation</title>
		<link>http://www.webfarmr.eu/2011/05/gluecon-2011-impressions-of-day-1-waste-management-through-security-automation/</link>
		<comments>http://www.webfarmr.eu/2011/05/gluecon-2011-impressions-of-day-1-waste-management-through-security-automation/#comments</comments>
		<pubDate>Thu, 26 May 2011 12:51:43 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=280</guid>
		<description><![CDATA[Gluecon started off with an amazing video / presentation on a mind-nubbingly large screen. It felt like the Oscars of IT. After the usual round of intros led by Eric Norlin, we moved on to the core of the topic: APIs and all their applications today including, of course, within cloud.
Chris Hoff of  [...]]]></description>
			<content:encoded><![CDATA[<p>Gluecon started off with an amazing video / presentation on a mind-nubbingly large screen. It felt like the Oscars of IT. After the usual round of intros led by Eric Norlin, we moved on to the core of the topic: APIs and all their applications today including, of course, within cloud.<br />
<a href="http://twitter.com/#!/beaker">Chris Hoff</a> of Cisco started with an analogy with toiletry / plumbing over the centuries pointing out that in the last 10 years, we had seen radical innovation in toilets, a millenium-old technology. Apply that to software dev and cloud, and we should see some serious innovation coming our way. (Side note: the indispensable toilet paper was not invented until quite a few centuries after toilets were. It makes you ponder what they were using before).<br />
Chris&#8217;s talk focused on security mainly. He pointed out to a model where he clearly separates concerns between different layers:</p>
<ul>
<li>Infostructure: info security applies here</li>
<li>Applistructure: application security applies here</li>
<li>Metastructure</li>
<li>Infrastructure: physical &#038; network security</li>
</ul>
<p>The importance of pointing out to these different layers is that it highlights the different security concerns and the different stakeholders. In order for cloud and next-generation IT to function properly, all stakeholders must act together in a coordinated fashion.<br />
It is very true: all too often, we will see a secure system being taken down because of one under-estimated area or because of those boundaries between 2 different secure layers: this goes back to what Theo Dimitrakos, head of Security Architectures at BT, used to repeat to me: the juxtaposition / interconnection of 2 secure systems rarely leads to one global secure system. Attackers will always try to attack the border where the two systems are joined.<br />
And Chris to conclude in his talk that what we really need is:</p>
<blockquote><p><strong>Kick-aas automated security</strong></p></blockquote>
<p>(aas = as a service).<br />
This goes through automated  / standardized means of communication between different layers and through collaboration between different stakeholders: dev + ops + security = make nice to put it in Chris&#8217;s own formula.</p>
<p>More on Gluecon later&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/05/gluecon-2011-impressions-of-day-1-waste-management-through-security-automation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XACML 3.0 wins award at the European Identity Conference 2011 #EIC11</title>
		<link>http://www.webfarmr.eu/2011/05/xacml-3-0-wins-award-at-the-european-identity-conference-2011-eic11/</link>
		<comments>http://www.webfarmr.eu/2011/05/xacml-3-0-wins-award-at-the-european-identity-conference-2011-eic11/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:42:58 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>
		<category><![CDATA[XACML Bites]]></category>
		<category><![CDATA[award]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[EIC]]></category>
		<category><![CDATA[identity]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=271</guid>
		<description><![CDATA[Today was a great day at EIC 2011 where Axiomatics is currently demoing its fine-grained authorization capabilities based on the latest version of the XACML standard, XACML 3.0.
It ended with the usual ceremony awards where Tim Cole et al. handed out awards to various projects in the identity space  [...]]]></description>
			<content:encoded><![CDATA[<p>Today was a great day at EIC 2011 where <a href="http://www.axiomatics.com">Axiomatics</a> is currently demoing its fine-grained authorization capabilities based on the latest version of the XACML standard, XACML 3.0.<br />
It ended with the usual ceremony awards where <a href="http://blogs.kuppingercole.com/cole/">Tim Cole</a> et al. handed out awards to various projects in the identity space (cloud security, IAM, entitlements management).<br />
A special award was handed to the XACML Technical Committee for its outstanding work on the latest version of XACML, <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xacml#CURRENT">XACML 3.0</a>. Hal Lockart of Oracle and co-chair of the TC stepped up to accept the award and thanked the entire TC for a great group effort. He also thanked the editor of the XACML 3.0 specification, Erik Rissanen, CTO Axiomatics, for leading the effort and major contributions.<br />
XACML 3.0 brings many new things to the table among which advice, variables inside obligations, and perhaps close to Erik&#8217;s heart, delegation. More on new features of <a href="http://www.webfarmr.eu/2010/07/enhancements-and-new-features-in-xacml-3-axiomatics/">XACML 3.0</a> here.<br />
The XACML TC will be hosting a free webinar on XACML in early June. Details can be found <a href="https://www1.gotomeeting.com/register/541497913">here</a>.</p>
<p>Hereafter the video of the award ceremony and Hal going on stage:<br />
<iframe width="425" height="349" src="http://www.youtube.com/embed/hqWVU26wC-E" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/05/xacml-3-0-wins-award-at-the-european-identity-conference-2011-eic11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When OpenID meets XACML: externalize authentication and authorization from your business apps</title>
		<link>http://www.webfarmr.eu/2011/05/when-openid-meets-xacml-externalize-authentication-and-authorization-from-your-business-apps/</link>
		<comments>http://www.webfarmr.eu/2011/05/when-openid-meets-xacml-externalize-authentication-and-authorization-from-your-business-apps/#comments</comments>
		<pubDate>Mon, 02 May 2011 17:23:40 +0000</pubDate>
		<dc:creator>David Brossard</dc:creator>
				<category><![CDATA[Identity & Access Management]]></category>
		<category><![CDATA[AuthN]]></category>
		<category><![CDATA[AuthZ]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[Ping Federate]]></category>
		<category><![CDATA[SAML]]></category>
		<category><![CDATA[XACML Bites]]></category>

		<guid isPermaLink="false">http://www.webfarmr.eu/?p=262</guid>
		<description><![CDATA[Background
About a year ago, a few months into my new job at Axiomatics, I pulled together a web-based app using J2EE (JSF, servlets, POJOs) and Icefaces (AJAXfied JSF) to illustrate fine-grained access control for web applications and portals.
To secure the application, I used Tomcat&#8217;s  [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>About a year ago, a few months into my new job at <a href="http://www.axiomatics.com">Axiomatics</a>, I pulled together a web-based app using J2EE (JSF, servlets, POJOs) and Icefaces (AJAXfied JSF) to illustrate fine-grained access control for web applications and portals.<br />
To secure the application, I used Tomcat&#8217;s authentication mechanism (its implementation of the HTTP FORM-based authentication protocol) and <a href="http://www.axiomatics.com">Axiomatics</a>&#8216;s off-the-shelf <a href="http://www.axiomatics.com/products/axiomatcis-policy-enforcement-points-pep.html">Authorization filter</a> for <a href="http://java.sun.com/products/servlet">servlets</a>.<br />
What I then got &#8211; at zero development effort &#8211; was a sturdy, secure, finely-grained controlled web app where users could access certain pages and/or parts of pages based on the set of attributes a given user had potentially combined with attributes of the targeted resource (the page, the portlet, the individual GUI element of the page&#8230;), the action the user wanted to run (HTTP GET? HTTP POST?), and possibly environment values (time, encryption type?). We were pretty much cruising down XACML Lane, picking all the benefits of Attribute-Based Access Control.</p>
<h2>Out goes FORM-based AuthN, in comes Open ID</h2>
<p>However, I was not really satisfied with the authentication side of things. I had gone for the easy path &#8211; to use Tomcat&#8217;s native tool (a list of users inside a configuration file called tomcat-users.xml) which I had extended to include other user attributes. But it didn&#8217;t seem overly realistic in an enterprise scenario. I had thought of using LDAP but had never found the time to configure Tomcat to use LDAP instead.<br />
That&#8217;s when I bumped into <a href="http://www.travisspencer.com/">Travis Spencer</a> of <a href="http://www.pingidentity.com/">Ping Identity</a>. A few weeks ago, Travis came over for a visit in our Stockholm offices. Then and there, Travis introduced me to Ping&#8217;s capabilities in terms of (a) externalizing authentication and (2) bridging between different authentication sources and protocols. I wasn&#8217;t restricted to Tomcat&#8217;s FORM-based authentication anymore. I could choose from a plethora of identity providers, typically OpenID-based providers such as Google or Yahoo, but also Facebook Connect.<br />
The source of authentication and the ease of integration are not the only winning factors here. Considering XACML &#8211; in the authorization phase &#8211; uses attributes extensively, one of the key points is to be able to retrieve such attributes. And that&#8217;s where OpenID, SAML, and Ping come into play. It is indeed possible to authenticate with an IDP and retrieve attributes about the user the IDP might be maintaining.</p>
<h2>The best of both worlds: achieving externalized authentication &#038; authorization</h2>
<p>With that in mind, Travis and I drew up a plan for a new demo integrating Ping Identity&#8217;s Ping Federate and <a href="http://www.axiomatics.com/products/axiomatics-policy-server.html">Axiomatics&#8217;s Policy Server</a>. Travis also describes the architecture on his <a href="http://travisspencer.com/blog/2011/04/federation-and-entitlement-man.html">blog</a>.<br />
In addition to inserting the Axiomatics Servlet Authorization Filter, I now added an Authentication filter responsible for redirecting users to the authentication form of their favorite IDP e.g. Google via Ping Federate. From my app&#8217;s perspective, and in particular the filter&#8217;s perspective, that amounted to an HTTP 302 redirect to Ping Federate which in turn redirected to the relevant IDP. What&#8217;s interesting to note is that PF might talk different protocols with different providers but ultimately always returns the same pre-agreed token format to the authentication filter. In our case, we opted for an encrypted cookie which contained additional attributes about the user.<br />
The authentication filter can then decrypt the token, extract the attributes, create a user session, and add those attributes to the session. Next comes the Authorization filter which can read those attributes from the session and use them to build a <a href="http://www.axiomatics.com/pure-xacml.html">XACML</a> request to be sent to the APS. It can also add contextual attributes such as the time of the request. Lastly, it is capable of extracting additional information from the <a href="http://download.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html">HTTPServletRequest</a> object itself, typically the targeted URI and the HTTP method (GET? POST?)<br />
Based on the attributes it is given, the APS can then reach different decisions (either Permit or Deny). In this demonstrator, we opted for a resource-centric access control model where we defined different policies grouped together in a policy set. Each policy focuses on a separate resource (or web page as is the case here). Policies can contain rules which can focus on finer-grained aspects of the resource e.g. a GUI element (a button? a menu item?). Lastly, because multiple sources of authentication are potentially used, it is possible for APS to reach decisions based on the origin of the user token. Administrators can then author access control policies of the like: </p>
<blockquote><p>Only allow users that have authenticated with Google.</p></blockquote>
<h2>Richer business flows with XACML obligations</h2>
<p>One of the neat features XACML offers is the use of obligations. Obligations are statements that a PDP can return to a PEP along with a decision e.g.</p>
<blockquote><p>Yes Permit, provided the PEP logs the fact the user has requested this resource in the corporate logging system.</p></blockquote>
<p>In this demo, obligations are particularly handy. We chose to implement a banking scenario where certain pages require different levels of authentication (from none to OpenID to internal enterprise authentication). Should a user authenticated with Google try to access a page which requires stronger authentication, the PDP can deny access and ask the PEP to redirect the user to a page where the user will have the option to either log in using an enterprise account or create a new account.<br />
This sort of scenario is recurrent with our banking customers: imagine a retail bank webapp where users authenticate using their normal credentials (e.g. username/password). The bank lets them view their balance. However, for more advanced functions e.g. money transfers, the bank requires stronger authentication. XACML obligations can implement this type of flow very naturally.</p>
<h2>A sneak peek at the demo</h2>
<p>This short video demo illustrates the use of Ping Federate with Google OpenID and Axiomatics Policy Server.<br />
<iframe width="425" height="349" src="http://www.youtube.com/embed/yCaIueUbxyQ" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfarmr.eu/2011/05/when-openid-meets-xacml-externalize-authentication-and-authorization-from-your-business-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

