XACML


XACML stands for "eXtensible Access Control Markup Language". The standard defines a declarative fine-grained, attribute-based access control policy language, an architecture, and a processing model describing how to evaluate access requests according to the rules defined in policies.
As a published standard specification, one of the goals of XACML is to promote common terminology and interoperability between access control implementations by multiple vendors. XACML is primarily an attribute-based access control system, also known as a policy-based access control system, where attributes associated with a user or action or resource are inputs into the decision of whether a given user may access a given resource in a particular way. Role-based access control can also be implemented in XACML as a specialization of ABAC.
The XACML model supports and encourages the separation of enforcement from decision making from management / definition of the authorization. When access decisions are hard-coded within applications, it is very difficult to update the decision criteria when the governing policy changes and it is hard to achieve visibility or audits of the authorization in place. When the client is decoupled from the access decision, authorization policies can be updated on the fly and affect all clients immediately.

History

Version 1.0 was ratified by OASIS standards organization in 2003.
Version 2.0 was ratified by OASIS standards organization on February 1, 2005.
Version 3.0 was ratified by OASIS in January 2013.

Architecture

Terminology

Non-normative terminology
Abbr.TermDescription
PAPPolicy Administration PointPoint which manages access authorization policies
PDPPolicy Decision PointPoint which evaluates access requests against authorization policies before issuing access decisions
PEPPolicy Enforcement PointPoint which intercepts user's access request to a resource, makes a decision request to the PDP to obtain the access decision
, and acts on the received decision
PIPPolicy Information PointThe system entity that acts as a source of attribute values
PRPPolicy Retrieval PointPoint where the XACML access authorization policies are stored, typically a database or the filesystem.

Flow

  1. A user sends a request which is intercepted by the Policy Enforcement Point
  2. The PEP converts the request into a XACML authorization request
  3. The PEP forwards the authorization request to the Policy Decision Point
  4. The PDP evaluates the authorization request against the policies it is configured with. The policies are acquired via the Policy Retrieval Point and managed by the Policy Administration Point. If needed it also retrieves attribute values from underlying Policy Information Points.
  5. The PDP reaches a decision and returns it to the PEP

    Policy elements

Structural elements

XACML is structured into 3 levels of elements:
A policy set can contain any number of policy elements and policy set elements. A policy can contain any number of rule elements.

Attributes and categories

Policies, policy sets, rules and requests all use subjects, resources, environments, and actions.
XACML provides a target, which is basically a set of simplified conditions for the subject, resource, and action that must be met for a policy set, policy, or rule to apply to a given request. Once a policy or policy set is found to apply to a given request, its rules are evaluated to determine the access decision and response.
In addition to being a way to check applicability, target information also provides a way to index policies, which is useful if you need to store many policies and then quickly sift through them to find which ones apply.
When a request to access that service arrives, the PDP will know where to look for policies that might apply to this request because the policies are indexed based on their target constraints. Note that a target may also specify that it applies to any request.
Policy set, policy and rule can all contain target elements.

Conditions

Conditions only exist in rules. Conditions are essentially an advanced form of a target which can use a broader range of functions and more importantly can be used to compare two or more attributes together, e.g. subject-iddoctor-id. With conditions, it is possible to implement segregation of duty checks or relationship-based access control.

Obligations & Advice

Within XACML, a concept called obligations can be used. An obligation is a directive from the policy decision point to the policy enforcement point on what must be carried out before or after an access is approved. If the PEP is unable to comply with the directive, the approved access may or must not be realized. The augmentation of obligations eliminates a gap between formal requirements and policy enforcement. An example of an obligation could look like this:
Access control rule:
Allow access to resource MedicalJournal with attribute patientID=x
if Subject match DesignatedDoctorOfPatient
and action is read
with obligation
on Permit: doLog_Inform
on Deny : doLog_UnauthorizedLogin

The XACML's obligation can be an effective way to meet formal requirements that can be hard to implement as access control rules. Furthermore, any formal requirements will be part of the access control policy as obligations and not as separate functions, which makes policies consistent and centralization of the IT environment easier to achieve.
Obligations can be used for "break-the-glass" scenarios or trust elevation.
In addition to obligations, XACML supports advice which are identical to obligations with the difference that a PEP is not obligated to enforce the advice.

Combining algorithms

What happens in XACML if there are two rules that contradict each other? Imagine for instance a first rule that would say managers can view documents and a second rule that would say no one can work before 9am. What if the request is about Alice trying to view a document at 8am? Which rule wins? This is what combining algorithms tell us. They help resolve conflicts.
XACML defines a number of combining algorithms that can be identified by a RuleCombiningAlgId or PolicyCombiningAlgId attribute of the or elements, respectively. The rule-combining algorithm defines a procedure for arriving at an access decision given the individual results of evaluation of a set of rules. Similarly, the policy-combining algorithm defines a procedure for arriving at an access decision given the individual results of evaluation of a set of policies.
The will help you understand how combining algorithms process and combine policies.

Functions

XACML defines a long list of functions to manipulate and compare attributes to other attributes and values:
The functions and their identifiers are fully . Functions are type-specific i.e. there is a function for string equality and a different one for integer equality.

Equality, inequality and other matching functions

Arithmetic functions

  • add
  • subtract
  • multiply
  • divide
  • mod
  • abs
  • round
  • floor

    String functions

  • string-concatenate
  • string-starts-with
  • string-ends-with
  • string-contains
  • string-substring

    Logical functions (and, or, not)

Set and bag functions

Regular expression functions

XPath functions

Higher order functions

The list of higher order functions is as listed below. For a formal definition, refer to the .
  • * parameters: anyAtomicOrBag anyAtomicOrBag*
  • * return value: boolean
  • * Description: this function takes in a boolean function and 2 or more attribute values or bags. The higher-order function applies the boolean function to the remaining parameters.
  • * Example: anyOf will return true if role is single-valued, there is at least one value in the attribute bag allowedRoles equal to the value inside the single-valued attribute bag role.
  • * parameters: anyAtomicOrBag anyAtomicOrBag*
  • * return value: boolean
  • * parameters: anyAtomicOrBag anyAtomicOrBag*
  • * return value: boolean
  • * parameters: bag bag
  • * return value: boolean
  • * parameters: bag bag
  • * return value: boolean
  • * parameters: bag bag
  • * return value: boolean
  • map
  • * parameters: anyAtomicOrBag anyAtomicOrBag*
  • * return value: bag

    XACML 3.0

Schema

http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd

Data types

  • http://www.w3.org/2001/XMLSchema#anyURI
  • http://www.w3.org/2001/XMLSchema#base64Binary
  • http://www.w3.org/2001/XMLSchema#boolean
  • http://www.w3.org/2001/XMLSchema#date
  • http://www.w3.org/2001/XMLSchema#dateTime
  • http://www.w3.org/2001/XMLSchema#dayTimeDuration
  • http://www.w3.org/2001/XMLSchema#double
  • http://www.w3.org/2001/XMLSchema#hexBinary
  • http://www.w3.org/2001/XMLSchema#integer
  • http://www.w3.org/2001/XMLSchema#string
  • http://www.w3.org/2001/XMLSchema#time
  • http://www.w3.org/2001/XMLSchema#yearMonthDuration
  • urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name
  • urn:oasis:names:tc:xacml:1.0:data-type:x500Name
  • urn:oasis:names:tc:xacml:2.0:data-type:dnsName
  • urn:oasis:names:tc:xacml:2.0:data-type:ipAddress
  • urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression

    New in XACML 3.0

New profiles

XACML 3.0 introduces administrative delegation, the JSON Profile of XACML, the REST Profile of XACML, the Multiple Decision Profile of XACML, and many more.
Delegation
The implementation of delegation is new in XACML 3.0. The delegation mechanism is used to support decentralized administration of access policies. It allows an authority to delegate all or parts of its own authority or someone else's authority to another user without any need to involve modification of the root policy.
This is because, in this delegation model, the delegation rights are separated from the access rights. These are instead referred to as administrative control policies. Access control and administrative policies work together as in the following scenario:
A partnership of companies' many services are protected by an access control system. The system implements the following central rules to protect its resources and to allow delegation:
Access control rules:
Allow access
to resource with attribute WebService
if subject is Employee and action is read or write.

Administration control rules:
Allow delegation of access control rule #1
to subjects with attribute Consultant.
Conditions:
delegation must expire within 6 months,
resource must not have attribute StrictlyInternal.

When a consultant enters the corporation, a delegation can be issued locally by the consultant's supervisor, authorizing the consultant access to systems directly.
The delegator may only have the right to delegate a limited set of access rights to consultants.

Other features

Other new features of XACML 3.0 are listed at http://www.webfarmr.eu/2010/07/enhancements-and-new-features-in-xacml-3-axiomatics/
The XACML TC is also publishing a list of changes here: http://wiki.oasis-open.org/xacml/DifferencesBetweenXACML2.0AndXACML3.0

Sample policies

Date and time-based authorization in XACML

This rule implements the access control paradigm. If a user does not log in for 30 days, then they lose access.
In pseudo-code: deny if currentDateTime > lastLogin + 30 days


Use it or lose it: this policy denies access if lastLogin is more than 30 days away from today's date








P30D





Time-based authorization in XACML

This rule grants access if the current time is greater than 9am and less than 5pm.


Allow if time between 9 and 5




09:00:00







17:00:00






Sample requests and responses

XACML 3.0 request





view




doc#123




Alice



XACML 3.0 responses

XACML 3.0 sample response




NotApplicable





XACML 3.0 sample response with obligation

The following contains an Obligation block. Obligations are statements that can be returned along with a decision to enrich the decision flow. In this example, the PEP must log that access was granted.



Permit








http://www.axiomatics.com/automatic-unique-id/18a9eae9-c92b-4087-b2ac-c5a33d7ff477



The Multiple Decision Profile of XACML 3.0

By default a PDP processes a single request at a time e.g. "Can Alice view item #1?". The PDP then replies with a single decision. At times, though, it is necessary to send multiple requests in one go e.g. "Can Alice view / edit / delete items #1, #2, #3?". The allows for this use case. The PDP will typically do the product of all combinations i.e. in the example aforementioned there will be 1 x 3 x 3 = 9 decisions returned in a single response.

Sample JSON Request for the Multiple Decision Profile

The way to enable the MDP is to send an array of objects for any of the categories rather than an array of one object. For instance, AccessSubject is an object but Resource is an array of objects. The latter will trigger the MDP process in PDPs that support the profile. Note as well the use of the IncludeInResult attribute which tells the PDP to return the XACML attribute and its value in the respone so that decisions can be correlated to the relevant attribute values.

Sample JSON Response for the Multiple Decision Profile


XACML implementations

Developer orientation

In 2013 and 2014, the XACML Technical Committee focused on designing new profiles to facilitate developer integration. These include:
  • The REST profile of XACML written by Remon Sinnema of EMC
  • The JSON profile of XACML written by David Brossard of Axiomatics
  • The ALFA profile of XACML written by Pablo Giambiagi, Srijith Nair, and David Brossard of Axiomatics
All three profiles were showcased at the in Monterey, California. Using these profiles, integrating fine-grained authorization into applications becomes much easier.

The ALFA Profile of XACML

ALFA stands for Abbreviated Language for Authorization. It is a lightweight syntax used to implement policy-based access control policies. For examples refer to the main article.

The JSON Profile of XACML

The JSON profile of XACML simplifies the integration between the PEP and the PDP.

Sample JSON request


Sample JSON response


XACML and other standards

XACML and Open Policy Agent

is similar to XACML in that it provides a policy decision point, externalized authorization, and a policy language. It specializes in infrastructure authorization rather than general-purpose, API-centric, or data-centric which XACML addresses.

XACML and SAML

is an identity SSO and federation standard used for authentication. SAML is used as a common identity token format between different applications. SAML and XACML are both defined by OASIS. SAML and XACML were designed to interoperate where SAML is used to carry identity information / virtual identities and XACML is used to drive the access control logic through policies.

XACML and OAuth

is considered to be an authorization standard. It differs from XACML though in its origin, its purpose, and its applications. OAuth is about:
  • delegated access control: I, the user, delegate another user or service access to the resource I own. For instance via OAuth, I grant Twitter the ability to post on my Facebook wall.
  • handling the password anti-pattern. Whenever you want to integrate 2 services together, in a traditional, legacy model you have to provide service B with your user credentials on service A so that service B can pretend to be you with Service A. This has many risks of course. Using OAuth eliminates the issues with these patterns and lets the user control what service B can do on behalf of the user with service A.
  • HTTP-based services / resources
  • managing owner approval
XACML does not handle user approval or delegated access or password management. XACML simply provides:
  • An access control architecture with the notion of a Policy Decision Point as previously discussed and a Policy Enforcement Point.
  • a policy language with which to express a wide range of access control policies including policies that can use consents handled / defined via OAuth.
XACML and OAuth can be combined together to deliver a more comprehensive approach to authorization.