Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/221595847

XEngine: a fast and scalable XACML policy evaluation engine

Conference Paper · January 2008


Source: DBLP

CITATIONS READS
79 178

4 authors, including:

Jeehyun Hwang Tao Xie


North Carolina State University University of Illinois, Urbana-Champaign
20 PUBLICATIONS   406 CITATIONS    289 PUBLICATIONS   8,374 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Pex - Automatic Test Generation View project

Mobile Web View project

All content following this page was uploaded by Tao Xie on 01 December 2014.

The user has requested enhancement of the downloaded file.


XEngine: A Fast and Scalable
XACML Policy Evaluation Engine

Alex X. Liu Fei Chen JeeHyun Hwang Tao Xie


Dept. of Computer Science and Engineering Dept. of Computer Science
Michigan State University North Carolina State University
East Lansing, MI 48824-1266, U.S.A. Raleigh, NC 27695, U.S.A.
{alexliu, feichen}@cse.msu.edu {jhwang4, xie}@csc.ncsu.edu

ABSTRACT 1. INTRODUCTION
XACML has become the de facto standard for specifying ac- Access control mechanisms use user specified policies to
cess control policies for various applications, especially web determine which principal can access which resources in what
services. With the explosive growth of web applications de- manner. The eXtensible Access Control Markup Language
ployed on the Internet, XACML policies grow rapidly in (XACML) [9] is an XML-based language standardized by
size and complexity, which leads to longer request process- the Organization for the Advancement of Structured Infor-
ing time. This paper concerns the performance of request mation Standards (OASIS). XACML was designed to re-
processing, which is a critical issue and so far has been over- place application-specific and proprietary access-control pol-
looked by the research community. In this paper, we propose icy languages. Prior to XACML, every application vendor
XEngine, a scheme for efficient XACML policy evaluation. had to create its own proprietary method for specifying ac-
XEngine first converts a textual XACML policy to a nu- cess control policies, and these applications could not un-
merical policy. Second, it converts a numerical policy with derstand each other’s language. Currently, XACML has be-
complex structures to a numerical policy with a normalized come the de facto standard for specifying access control poli-
structure. Third, it converts the normalized numerical pol- cies. It has been widely supported by all the main platform
icy to tree data structures for efficient processing of requests. vendors and extensively used in a variety of applications.
To evaluate the performance of XEngine, we conducted ex- Typical XACML based access control works as follows.
tensive experiments on both real-life and synthetic XACML A subject (e.g., a professor) wants to perform an action
policies. The experimental results show that XEngine is or- (e.g., modify) on a protected resource (e.g., student grade).
ders of magnitude more efficient than Sun PDP, and the per- The subject submits this request to the Policy Enforcement
formance difference between XEngine and Sun PDP grows Point (PEP) that manages the protected resource. The
almost linearly with the number of rules in XACML policies. PEP formulates such a request using the XACML request
For XACML policies of small sizes (with hundreds of rules), language. Then, the PEP sends the XACML request down
XEngine is one to two orders of magnitude faster than the to the Policy Decision Point (PDP), which stores a user
widely deployed Sun PDP. For XACML policies of large sizes specified access control policy written in the XACML policy
(with thousands of rules), XEngine is three to four orders of language. The PDP checks the request with its XACML
magnitude faster than Sun PDP. policy and determines whether the XACML request should
be permitted or denied. Finally, the PDP formulates the
decision in XACML response language and sends it to the
Categories and Subject Descriptors PEP, which enforces the decision.
D.4.6 [Security and Protection]: Access controls This paper concerns the process of checking whether a
request satisfies a policy, which we call policy evaluation.
We refer to a PDP as a policy evaluation engine. Specifi-
General Terms cally, this paper concerns the performance of XACML pol-
Algorithm, Performance, Security icy evaluation engines. With the wide adoption of XACML,
especially in online applications running on web servers, the
performance of XACML policy evaluation engines becomes
Keywords a critical issue. When a web server needs to enforce an
XACML, access control, policy evaluation, web server, pol- XACML policy with a large number of rules, its XACML
icy decision point (PDP), policy enforcement point (PEP) policy evaluation engine may easily become the performance
bottleneck for the server. As the number of resources and
users managed by web servers grows rapidly, XACML poli-
cies grow correspondingly in size and complexity. To enable
Permission to make digital or hard copies of all or part of this work for an XACML policy evaluation engine to process simultane-
personal or classroom use is granted without fee provided that copies are ous requests of large quantities in real time, especially in
not made or distributed for profit or commercial advantage and that copies
bear this notice and the full citation on the first page. To copy otherwise, to
face of a burst volume of requests, an efficient XACML pol-
republish, to post on servers or to redistribute to lists, requires prior specific icy evaluation engine is necessary.
permission and/or a fee. However, commercial implementations of XACML policy
SIGMETRICS’08, June 2–6, 2008, Annapolis, Maryland, USA. evaluation engines such as Sun XACML PDP [1], which per-
Copyright 2008 ACM 978-1-60558-005-0/08/06 ...$5.00.

265
forms brute force searching by comparing a request with all mentation of XACML evaluation engines. It has become
the rules in an XACML policy, still represent the state-of- the industrial standard. Second, Sun PDP is open source.
the-art. To our best knowledge, there is no prior research To eliminate the performance factor of implementation lan-
work on improving the performance of XACML policy eval- guages, we implemented XEngine in Java because Sun PDP
uation engines. This paper represents the first step in ex- is written in Java. We conducted extensive experiments on
ploring this unknown space. By this paper, we hope to at- real-life XACML policies collected from various sources as
tract some attention from the research community on this well as synthetic policies of large sizes. The experimental
important, yet challenging, problem. results show that XEngine is orders of magnitude more effi-
Making XACML policy evaluation more efficient is diffi- cient than Sun PDP, and the performance difference between
cult from many aspects. First, XACML policies have com- XEngine and Sun PDP grows almost linearly with the num-
plex structures. For example, XACML policies can be spec- ber of rules in XACML policies. For real-life XACML poli-
ified recursively. An XACML policy consists of a policy set cies (of small sizes with hundreds of rules), the experimental
and a policy set consists of a sequence of policies or policy results show that XEngine is two orders of magnitude faster
sets. Second, an XACML policy often has conflicting policies than Sun PDP for single-valued requests and one order of
or rules, and they are resolved by four possible mechanisms: magnitude faster than Sun PDP for multi-valued requests.
First-Applicable, Only-One-Applicable, Permit-Overrides, a- For synthetic XACML policies (of large sizes with thou-
nd Deny-Overrides. It is natural for an XACML policy eval- sands of rules), the experimental results show that XEngine
uation engine to examine all the rules in an XACML policy is three to four orders of magnitude faster than Sun PDP
before making the correct decision for a request. Third, for both single-valued and multi-valued requests.
in XACML policies, the predicates that a request needs to As the core of access control systems, the correctness of
be checked upon are scattered. Every policy set, policy, or XEngine is critical. Thus, we not only formally prove that
rule has its own predicate. Fourth, in XACML, a request XEngine makes the correct decision for every request based
could be multi-valued. For example, the subject of a re- on the XACML 2.0 specification [9], but also empirically
quest could be a principal who is both a professor and a validate the correctness of XEngine in our experiments. The
student. Last but not least, in XACML policies, a rule may correctness proof of XEngine is not included in this version
be multi-valued. For example, a rule in an XACML policy due to the space issue, but it is included in our technical
may specify that the subject must be both a professor and report [2], which is available online. In our experiments, we
a student. In retrospect, the high complexity of XACML first randomly generate 100,000 single-valued requests and
policies makes brute force searching appear to be the natu- 100,000 multi-valued requests; we then feed each request to
ral way of processing requests. XEngine and Sun PDP and compare their decisions. The
In this paper, we present XEngine, a fast and scalable experimental results confirmed that XEngine and Sun PDP
XACML policy evaluation engine. XEngine has three key are functionally equivalent.
ideas. First, XEngine converts all string values in an XACML The rest of the paper is organized as follows. We first
policy to numerical values. In processing requests, XEngine review related work in Section 2. In Section 3, we briefly
also converts the string values in a request to their corre- introduce XACML. In Section 4, we describe the policy nu-
sponding numerical values. We call this technique XACML mericalization and normalization techniques. We present
policy numericalization. Second, XEngine converts a nu- the core algorithms for processing requests in Section 5. In
mericalized XACML policy with a hierarchical structure and Section 6, we present our experimental results. Finally, we
multiple complex conflict resolution mechanisms into an equ- give concluding remarks in Section 7.
ivalent XACML policy with a flat structure and only one
conflict resolution mechanism, which is First-Applicable. We 2. RELATED WORK
call this technique XACML policy normalization. Third,
We are not aware of prior work on optimizing XACML
XEngine further converts a numericalized and normalized
policy evaluation. Since XACML 1.0 was standardized by
policy to a tree structure, and uses it to efficiently process
OASIS in February 2003, a significant amount of research
numericalized requests.
work has been done on XACML. However, most of the re-
Intuitively, XEngine outperforms the standard XACML
search focus on modeling, verification, analysis, and testing
policy evaluation engines (such as Sun PDP) for three ma-
of XACML policies (e.g., [4, 6–8, 11]). In other words, the
jor reasons. First, in checking whether a request satisfies
focus of prior work on XACML is the correctness of XACML
a predicate, XEngine uses efficient numerical comparison
policies while the focus of this paper is on the performance
thanks to the XACML policy numericalization technique.
of XACML policies. The only XACML analysis work that
Second, when it receives a request, XEngine can find the
can be used to improve the performance of XACML evalu-
correct decision without comparing the request with every
ation is the recent work on detecting and removing redun-
rule in the policy due to the XACML policy normalization
dant XACML rules [6]. In [6], Kolovski formalizes XACML
technique. Third, XACML numericalization and normal-
policies with description logics (DL), which are a decidable
ization open many new opportunities for building efficient
fragment of the first-order logic, and exploit existing DL ver-
data structures for fast request processing. In this paper,
ifiers to conduct policy verification. Their policy verification
we present two approaches to fast processing of requests:
framework can detect redundant XACML rules. Kolovski et
the decision diagram approach and the forwarding table ap-
al. also point out that the XACML change impact frame-
proach.
work developed by Fisler et al. [4] could be exploited to
To evaluate the performance of XEngine, we compare it
detect redundant rules as well because a rule is redundant
with the standard Sun PDP implementation. We choose
if and only if removing the rule does not change the seman-
Sun PDP in our experiments for two main reasons. First,
tics of the policy, although it may not be an efficient way
Sun PDP is the first and the most widely deployed imple-
to remove redundant rules. Removing redundant rules from

266
XACML policies may potentially improve the performance is returned if any rule (or policy) evaluation returns permit;
of XACML policy evaluation. However, this hypothesis is deny is returned if all rule (or policy) evaluations return
yet to be validated. deny. For all of these combining algorithms, NotApplicable
One area related to XACML policy evaluation is packet is returned if no rule (or policy) is applicable.
classification (e.g., [3, 10]), which encompasses a large body
of research. Packet classification concerns the performance
1<PolicySet PolicySetId="n" PolicyCombiningAlgId="Permit-Overrides">
of checking a packet against a packet classifier, which con- 2 <Target/>
sists of a sequence of rules. Although similar in spirit, packet 3 <Policy PolicyId="n1" RuleCombinationAlgId="Deny-Overrides">
4 <Target/>
classification and XACML policy evaluation have several 5 <Rule RuleId=“1" Effect="Deny">
major differences. First, packet classification rules are speci- 6 <Target>
fied using ranges and prefixes, while XACML rules are spec- 7 <Subjects><Subject> Student </Subject>
8 <Subject> Secretary </Subject></Subjects>
ified using application specific string values. Second, the 9 <Resources><Resource> Grades </Resource></Resources>
structure of packet classifiers is flat and there is only one rule 10 <Actions><Action> Change </Action></Actions>
combining algorithm (i.e., First-Applicable); in contrast, the 11 </Target>
12 </Rule>
structure of XACML policies is hierarchical and there are 13 <Rule RuleId=“2" Effect="Permit">
four rule/policy combination algorithms. Third, the num- 14 <Target>
ber of possible values that a packet field can be is big (e.g., 15 <Subjects><Subject> Professor </Subject>
16 <Subject> Lecturer </Subject>
232 ), while the number of possible values that a request at- 17 <Subject> Secretary </Subject></Subjects>
tribute can be is much smaller. These differences render 18 <Resources><Resource> Grades </Resource>
directly applying prior packet classification algorithms to 19 <Resource> Records </Resource></Resources>
20 <Actions><Action> Change </Action>
XACML policy evaluation impossible. Our procedures of 21 <Action> Read </Action></Actions>
XACML policy numericalization and normalization seem to 22 </Target>
be a necessary step in bridging the two fields. Although 23 </Rule>
24 </Policy>
packet classification and XACML policy evaluation concern 25 <Policy PolicyId="n2" RuleCombinationAlgId="First-Applicable">
access control in different domains (one in the network level 26 <Target/>
27 <Rule RuleId=“3" Effect="Permit">
and one in the application level), they share essential char- 28 <Target>
acteristics. We hope this paper will inspire more research 29 <Subjects><Subject> Student </Subject></Subjects>
on XACML policy evaluation from the systems community. 30 <Resources><Resource> Records </Resource></Resources>
31 <Actions><Action> Change </Action>
32 <Action> Read </Action></Actions>
3. BACKGROUND 33 </Target>
34 </Rule>
An XACML policy consists of a policy set and a policy 35 </Policy>
combining algorithm. A policy set consists of a sequence of 36</PolicySet>
policies or policy sets, and a target. A policy consists of a
target, a rule set, and a rule combining algorithm. A target
Figure 1: An example XACML policy
is a predicate over the subject (e.g., professor), the resource
(e.g., grades), and the action (e.g., assign) of access requests,
specifying the type of requests to which the policy or policy Figure 1 shows an example XACML policy set whose pol-
set can be applied. If a request satisfies the target of a icy combining algorithm is Permit-Overrides. This policy
policy, then the request is further checked against the rule set includes two policies. The first policy has two rules and
set of the policy; otherwise, the policy is skipped without its rule combining algorithm is Deny-Overrides. The sec-
further examining its rules. The target of a policy set works ond policy has one rule and its rule combining algorithm
similarly. A rule set is a sequence of rules. A rule consists is First-Applicable. In the first policy, lines 5-12 define the
of a target, a condition, and an effect. Similar to the target first (deny) rule, whose meaning is that a student or sec-
of a policy, the target of a rule specifies whether the rule is retary cannot change grades; lines 13-23 define the second
applicable to a request by setting constraints on the subject, (permit) rule, whose meaning is that a professor, lecturer, or
the resource, and the action of requests. The condition in a secretary can change or read grades or records. In the second
rule is a boolean expression that refines the applicability of policy, lines 27-34 define its (permit) rule, whose meaning is
the rule beyond the predicates specified by its target, and is that a student can change or read records.
optional. Given a request, if it matches both the target and
condition of a rule, the rule’s effect (i.e., permit or deny) is
4. XACML POLICY NUMERICALIZATION
returned as a decision; otherwise, NotApplicable is returned.
XACML supports four rule (or policy) combining algo- AND NORMALIZATION
rithms: First-Applicable, Only-One-Applicable, Deny-Overr- The process of XACML policy numericalization is to con-
ides, and Permit-Overrides. For a First-Applicable policy vert the string values in an XACML policy into integer val-
(or policy set), the decision of the first applicable rule (or ues. This numericalization technique enables our XACML
policy) is returned. For an Only-One-Applicable policy (or policy evaluation engine to use the efficient integer compar-
policy set), the decision of the only applicable rule (or pol- ison, instead of the inefficient string matching, in process-
icy) is returned; indeterminate (which indicates an error) ing XACML requests. The process of XACML policy nor-
is returned if there are more than one applicable rule (or malization is to convert an XACML policy with a hierar-
policy). For a Deny-Overrides policy (or policy set), deny chical structure into an equivalent policy with a flat struc-
is returned if any rule (or policy) evaluation returns deny; ture and at the same time to convert an XACML policy
permit is returned if all rule (or policy) evaluations return with four rule/policy combining algorithms into an equiva-
permit. For a Permit-Overrides policy (or policy set), permit lent policy with only one rule combining algorithm, which is

267
First-Applicable. This normalization technique enables our 4.2 Recursive Specification
XACML policy evaluation engine to process an XACML re- Problem: A policy of the sequential range rule represen-
quest without comparing the request against all the rules in tation has a flat structure as a sequence of rules. However,
an XACML policy. an XACML policy is specified recursively and therefore has
After XACML policy numericalization and normalization, a hierarchical structure. In XACML, a policy set contains a
an XACML policy becomes a sequence of range rules. Such sequence of policies or policy sets, which may further contain
representation is called the sequential range rule representa- policies or policy sets.
tion. The format of a range rule is hpredicate i → hdecisioni. Solution: We parse and model an XACML policy as a tree,
A request has d attributes F1 , · · · , Fd , where the domain of where each terminal node represents an individual rule, each
each attribute Fi , denoted D(Fi ), is a range of integers. The nonterminal node whose children are all terminal nodes rep-
hpredicate i defines a set of requests over the attributes F1 resents a policy, and each nonterminal node whose children
through Fd . The hdecisioni defines the action (permit or are all nonterminal nodes represents a policy set. Because
deny) to take upon the requests that satisfy the predicate. this tree represents the structure of the XACML policy, we
The predicate of a rule is specified as F1 ∈ S1 ∧ · · · ∧ Fd ∈ Sd call it the structure tree of the policy. At each nonterminal
where each Si is a range of integers and Si is a subset of the node of a structure tree, we store the range of the sequence
domain of Fi . The semantics of a sequence of rules follows numbers of the rules that are included in the policy or the
First-Applicable (i.e., first-match), that is, the decision for policy set corresponding to the nonterminal node. We also
a request is the decision of the first rule that the request store the combining algorithm and the target of the corre-
matches. To serve as a security policy, a sequence of range sponding policy or policy set.
rules must be complete, which means that for any request, Example: Figure 3 shows an XACML policy with a hi-
whose Fi value is in D(Fi ), there is at least one matching erarchical structure (with details elided), which has three
rule. layers. The first layer contains a policy and a policy set,
There are many technical challenges in XACML policy nu- and the policy combining algorithm of this layer is First-
mericalization and normalization: non-integer values, recur- Applicable. In the second layer, the aforementioned pol-
sive specification, scattered predicates, multi-valued rules, icy contains two rules R1 and R2 , and the rule combin-
multi-valued requests, all-match to first-match conversion, ing algorithm is Deny-Overrides. The policy set contains
unifying rule/policy combining algorithms, and complex XA- two policies, and the policy combining algorithm is Permit-
CML functions. Next, for each challenge, we formulate the Overrides. The third layer contains two policies. One con-
problem, present our solution, and give an illustrating ex- tains two rules R3 and R4 with Deny-Overrides as its com-
ample. bining algorithm; the other contains two rules R5 and R6
with Only-One-Applicable as its combining algorithm.
4.1 XACML Policy Numericalization
Problem: In sequential range rules, the constraints on each First-Applicable
attribute are specified using integers. However, in XACML
rules, the constraints on each attribute are specified using Deny-Overrides
ASCII strings. R1 permit
Solution: For each attribute (typically subject, resource, R2 deny
or action), we first map each distinct value of the attribute Permit-Overrides
that appears in an XACML policy to a distinct integer, Deny-Overrides
and all the mapped integers of that attribute should form a
R3 deny
range. Then, we add rule R−1 : true → NotApplicable as the
R4 permit
last rule to make the sequence of range rules complete. We
denote this last rule as R−1 for the purpose of distinguishing Only-One-Applicable
it from the original XACML rules. R5 permit
Example: Taking the XACML policy in Figure 1 as an R6 deny
example, we map each distinct attribute value to a distinct
integer as shown in Figure 2(a). The converted rules after Figure 3: An example XACML policy
mapping are shown in Figure 2(b).
Figure 4 shows the structure tree of the three-layered
XACML policy in Figure 3. In the root, range [1,6] indi-
Subject Resource Action
Student: 0 cates that the XACML policy consists of rules R1 to R6 ,
Secretary: 1 Grades: 0 Change: 0 (a) First-Applicable is the combining algorithm of the XACML
Professor: 2 Records: 1 Read: 1 policy, and t1 is the target of the policy set.
Lecturer: 3
4.3 Scattered Predicates
R1 :S ∈ [0, 1] ∧ R ∈ [0, 0] ∧ A ∈ [0, 0] → d Problem: In the sequential range rule representation, whet-
R2 :S ∈ [1, 3] ∧ R ∈ [0, 1] ∧ A ∈ [0, 1] → p her a request matches a rule is determined solely by whether
(b)
R3 :S ∈ [0, 0] ∧ R ∈ [1, 1] ∧ A ∈ [0, 1] → p
R−1 :S ∈ [0, 3] ∧ R ∈ [0, 1] ∧ A ∈ [0, 1] → na the request satisfies the predicate of the rule. However, in
XACML policies, checking whether a request matches a rule
Figure 2: Numericalization table for the XACML requires checking whether the request satisfies a series of
policy in Figure 1 and the numericalized rules predicates. This is because a rule in an XACML policy may
be encapsulated in a policy, the policy may be further en-
closed in multiple policy sets, and each policy or policy set
has its own applicability constraints (i.e., targets).

268
[1,6]
First-Applicable
singled-valued request matches. Let Q be a multi-valued re-
Target t1 quest and Q1 , · · · , Qk be the resulting single-valued requests
decomposed from Q. For each Qi , we use O(Qi ) to denote
the set of all the original XACML rules that Qi matches.
[1,2] [3,6]
Thus, ∪ki=1 O(Qi ) is the set of all the original XACML rules
Deny-Overrides Permit-Overrides
that the multi-valued request Q matches. The algorithm for
Target t2 Target t3
finding all the original XACML rules that a single-valued re-
quest matches is discussed in Section 4.6. After we compute
[3,4] [5,6] ∪ki=1 O(Qi ), we use the structure tree of the given XACML
R1 R2 Deny-Overrides Only-One-Applicable policy to resolve the final decision for the multi-valued re-
Target t4 Target t5 quest Q in a bottom-up fashion. The pseudocode of the
resolution algorithm is in Algorithm 1.

R3 R4 R5 R6 Algorithm 1: ResolveByStructureTree(O,V )
Figure 4: Structure tree of the policy in Figure 3 Input: (1) A set O of original XACML rules
O = {Ra1 , · · · , Rah }, where a1 < · · · < ah (h ≥ 1).
(2) A resolution tree rooted at node V and V has m
children V1 , · · · , Vm .
Solution: In the structure tree of an XACML policy, each Output: An original XACML rule R whose decision is the
node may have a target that specifies some constraints on the resolved decision.
subject, resource, and action of requests. A request matches 1 S = ∅;
a rule if and only if the request satisfies all the targets along 2 for i := 1 to m do
the path from the root to the terminal node that corresponds 3 Oi := {Rx |Vi .lef t ≤ x ≤ Vi .right};
4 if Oi 6= ∅ then
to the rule. For each rule Ri , let t1 , · · · , tk denote all the 5 S := S∪ ResolveByStructureTree(Oi , Vi );
targets along the path from the root to the terminal node
that corresponds to Ri and c denote the condition of Ri , we 6 /*Suppose S = {Rb1 , · · · , Rbg }, where b1 < · · · < bg (g ≥ 1)*/
replace the target of Ri by t1 ∧ · · · ∧ tk ∧ c. Note that c is 7 if V.algorithm = First-Applicable then
true if rule Ri does not have a condition. 8 return Rb1 ;
Example: In normalizing the XACML policy in Figure 4, 9 else if V.algorithm = Only-One-Applicable then
we replace the target of R6 by t1 ∧ t3 ∧ t5 ∧ tR6 ∧ cR6 , where 10 if |S| > 1 then return error;
11 else return Rb1 ;
tR6 is the target of R6 and cR6 is the condition of R6 .
12 else if V.algorithm = Permit-Overrides then
13 if ∃i, 1 ≤ i ≤ g, Rbi ’s decision is permit then
4.4 Multi-valued Rules 14 return Rbi ;
Problem: In the sequential range rule representation, rules 15 else return Rb1 ;
are specified under the assumption that each attribute in a 16 else if V.algorithm = Deny-Overrides then
request has a singular value. However, in XACML policies, a 17 if ∃i, 1 ≤ i ≤ g, Rbi ’s decision is deny then
rule may specify that some attributes must be multi-valued. 18 return Rbi ;
For example, the constraints on the subject attribute may 19 else return Rb1 ;
be “a person who is both a professor and a student”.
Solution: We solve this problem by modelling the combi-
nations of distinct values that appear in multi-valued rules More precisely, in processing an XACML policy whose
in an XACML policy as a new distinct value. combining algorithm is First-Applicable, for a single-valued
Example: Suppose a rule requires the subject to be “a per- request decomposed from a multi-valued request, we do not
son who is both a professor and a student”. We add one more need to compute all the original XACML rules that the
distinct value for the subject, that is, “professor&student”. single-valued request matches; instead, we only need to com-
pute the first original XACML rule that the single-valued re-
4.5 Multi-valued Requests quest matches. The reason is as follows. Let X = hX1 , · · · ,
Problem: In the sequential range rule representation, each Xn i be a policy (or policy set) whose combining algorithm
attribute in a request has a singular value. However, an is First-Applicable. Let Q be a multi-valued request, and
attribute in an XACML request may have multiple values. Q1 , · · · , Qk be the resulting single-valued requests decom-
For example, the subject in an XACML request may be “a posed from Q. For each i, let O(Qi ) be the set of all
person who is both a professor and a student”. the original XACML rules that Qi matches, and F(Qi )
Solution: We solve this problem by breaking a multi- be the first original XACML rules that Qi matches. Be-
valued request into multiple single-valued requests. For ex- cause the XACML rule with the smallest sequence num-
ample, if a request is “a person who is both a professor and a ber in ∪ki=1 O(Qi ) is the same as the XACML rule with the
student wants to assign grades”, we break it into two single- smallest sequence number in {F(Q1 ), · · · , F(Qk )}, this rule
valued requests: “a professor wants to assign grades” and “a is essentially the XACML rule that determines the decision
student wants to assign grades”. Note that if we have a dis- for Q. Therefore, for each Qi , we only need to compute the
tinct value “professor&student” due to some multi-valued first original XACML rule that Qi matches.
rules, we add one more single-valued request: “a profes- Example: Suppose a multi-valued (one-dimensional) re-
sor&student wants to assign grades”. quest Q is “a person who is both a professor and a stu-
To compute the final decision for the original multi-valued dent wants to access a system”, and the structure tree of the
request, for each decomposed singled-valued request, our ba- XACML policy to be evaluated upon is in Figure 5. We first
sic idea is to find all the original XACML rules that this decompose this multi-valued request into two single-valued

269
requests, Q1 : “a professor wants to access the system”, and icy decision diagrams (similar to firewall decision diagrams
Q2 : “a student wants to access the system”. Second, we in [5]) as the core data structure. A Policy Decision Di-
compute the set of all the original XACML rules that Q1 agram (PDD) with a decision set DS and over attributes
or Q2 matches. This set is O = {R1 , R2 , R3 , R4 }. Next, F1 , · · · , Fd is an acyclic and directed graph that has the fol-
we use this set and the structure tree in Figure 5 to find lowing five properties: (1) There is exactly one node that has
the final decision for request Q. First, R1 and R2 are re- no incoming edges. This node is called the root. The nodes
solved at node V2 and the “winning” decision at this level is that have no outgoing edges are called terminal nodes. (2)
R1 ’s decision; R3 and R4 are resolved at node V3 and the Each node v has a label, denoted F (v). If v is a nonterminal
“winning” decision at this level is R3 ’s decision. Second, R1 node, then F (v) ∈ {F1 , · · · , Fd }. If v is a terminal node,
and R3 are resolved at node V1 ; because the decisions of then F (v) ∈ DS. (3) Each edge e:u → v is labeled with a
R1 and R3 are all deny and the combining algorithm at V1 nonempty set of integers, denoted I(e), where I(e) is a sub-
is Permit-Overrides, the final “winning” decision is R1 ’s (or set of the domain of u’s label (i.e., I(e) ⊆ D(F (u))). (4) A
R3 ’s) decision, which is deny. Thus, Q’s decision is deny. directed path from the root to a terminal node is called a de-
V1 cision path. No two nodes on a decision path have the same
[1,4]
Permit-Overrides
label. (5) The set of all outgoing edges of a node v, denoted
E(v), satisfies the following two conditions: (a) consistency:
I(e) ∩ I(e′ ) = ∅ forSany two distinct edges e and e′ in E(v);
V3
V2 [1,2] [3,4] (b) completeness: e∈E(v) I(e) = D(F (v)).
First-Applicable First-Applicable
Let hX1 , · · · , Xn i be a policy (or policy set). For each i, let
Xi′ be the normalization result of Xi . Let hR1 , · · · , Rg i de-
note hX1′ | · · · |Xn′ i, where each Ri ∈ Xhi 1 ≤ i ≤ g. We first
R1: Professor deny R2: Student permit R3: Student deny R4: Professor permit
convert the all-match rule set hR1 , · · · , Rg i to an equivalent
Figure 5: An example structure tree partial PDD. A partial PDD has all the properties of a PDD
except the completeness property. An all-match rule set
4.6 All-match to First-match Conversion hR1 , · · · , Rg i and a partial PDD are equivalent if and only
Problem: For each single-valued request decomposed from if the following two conditions hold. First, for each Ri de-
a multi-valued request, we may need to compute all the orig- noted as (F1 ∈ S1 )∧· · ·∧(Fd ∈ Sd ) → OB and each decision
inal XACML rules that the single-valued request matches. path P denoted as (F1 ∈ S1′ ) ∧ · · · ∧ (Fd ∈ Sd′ ) → OB ′ , either
To avoid scanning the entire rule list, our idea is to con- Ri and P are non-overlapping (i.e., ∃1 ≤ j ≤ d, Sj ∩Sj ′ = ∅)
vert a rule sequence following the all-match semantics to or P is a subset of Ri (i.e., ∀1 ≤ j ≤ d, Sj ′ ⊆ Sj ); in the
an equivalent sequence of rules following the first-match se- second case, Ri ’s origin block is included in P’s terminal
mantics. More formally, given a policy (or policy set) X = node. In P’s terminal node, we define the source of Ri ’s
hX1 , · · · , Xn i where each Xi has been normalized to Xi′ , origin block to be hi (to indicate that Ri ∈ Xhi ). Second,
and X’s combining algorithm A is either Permit-Overrides using P (or Ri ) to denote the set of requests that match P
or Deny-Overrides, we want to convert hX1′ | · · · |Xn′ i, which (or Ri ), the union of all the rules in hR1 , · · · , Rg i is equal
is denoted as hR1 , · · · , Rg i following the all-match seman- to the union of all the paths in the partial PDD.
tics, to a sequence of range rules Y = hy1 , · · · , ym i fol- After a partial PDD is constructed, we generate a rule
lowing the first-match semantics such that for each single- from each decision path. As the generated rules are non-
valued request Q, the decision of the first matching rule in overlapping, the order of the generated rules is immaterial.
Y should contain two components. First, it should contain For each generated rule, let OB denote its origin block, we
the decisions of all the rules that Q matches in hR1 , · · · , Rg i. first classify the origin blocks in OB based on their sources;
Such information is needed when we process multi-valued re- second, we combine all the origin blocks in the same group
quests. Second, it should contain the decision that X makes into one origin block whose winning decision is the decision
for Q. Such information is needed when we process single- of the block with the smallest source because the rules in
valued requests. This problem is particularly challenging each Xi′ follow the first-match semantics; third, we com-
because of the multi-dimensionality of XACML rules. That pute the winning decision for OB based on the combining
is, each rule has multiple attributes. algorithm of hX1 , · · · , Xn i. Finally, the resulting sequence
Solution: We design the decision of each first-match rule of generated rules is the sequence of first-match rules. The
using a new data structure called an origin block. The ori- pseudocode of the all-match to first-match conversion algo-
gin block ϕdec of a rule consists of two components ϕ and rithm is in Algorithm 2. Note that in this paper we use e.t
dec, where ϕ consists of either one original XACML rule to denote the node that e points to.
or a set of origin blocks, and dec is the winning decision of Example: Figure 6 shows the partial PDD converted from
ϕ. The winning decision of a rule’s origin block is the deci- the all-match rule sequence hR1 , R2 i in Figure 2(b), and
sion that the rule makes for any single-valued request that Figure 7 shows the corresponding first-match rules generated
matches the rule. Thus, for a single-valued request (that is from Figure 6.
not decomposed from a multi-valued request), the winning 4.7 Unifying Rule/Policy Combining Algorithms
decision is used to compute the final decision for the request; Problem: In the sequential range rule representation, there
for a single-valued request decomposed from a multi-valued is only one rule combining algorithm, which is First-Applicable.
request, the original XACML rules are used to compute the However, XACML supports four rule (or policy) combining
final decision for the multi-valued request. An example ori- algorithms: First-Applicable, Only-One-Applicable, Deny-
gin block is [[R3 ]d , [[R5 ]p , [R8 ]d ]p ]p , where d denotes deny Overrides, and Permit-Overrides. The key challenging is-
and p denotes permit. sue in XACML policy normalization is how to unify these
To convert all-match rules to first-match rules, we use pol- combining algorithms.

270
Algorithm 2: AllMatch2FirstMatch(hX1′ , · · · , Xn′ i, [0, 0] S [2, 3]
[1, 1]
A)
R R R
Input: (1) hX1′ , · · · , Xn

i where Xi′ is the normalization result [0, 0] [0, 0] [1, 1] [0, 1]
of Xi where hX1 , · · · , Xn i is a policy (or policy set)
(2) A, which is the combining algorithm of hX1 , · · · , A A A A
Xn i, A ∈ {Permit-Overrides, Deny-Overrides}. [0, 0] [0, 0] [1, 1] [0, 1] [0, 1]
Output: An equivalent sequence of first-match range rules.
′ ′ ′ [R1]d [R1]d, [R2]p [R2]p [R2]p [R2]p
1 Let hR1 , · · · , Rg i denote hX1 | · · · |Xn i, where each Ri ∈ Xhi
1 ≤ i ≤ g;
2 build a decision path with root v from rule R1 , and add the
Figure 6: The partial PDD converted from hR1 , R2 i
origin block of R1 to the terminal node of this path; in Figure 2(b)
3 for i := 2 to g do Append(v, i, Ri );
4 for each path in the partial PDD do generate a range rule; S ∈ [0, 0] ∧ R ∈ [0, 0] ∧ A ∈ [0, 0] → [R1 ]d
5 Let hy1 , · · · , ym i be the generated range rules; S ∈ [1, 1] ∧ R ∈ [0, 0] ∧ A ∈ [0, 0] → [ [R1 ]d , [R2 ]p ]d
6 for i := 1 to m do S ∈ [1, 1] ∧ R ∈ [0, 0] ∧ A ∈ [1, 1] → [R2 ]p
7 OB := yi ’s origin block; S ∈ [1, 1] ∧ R ∈ [1, 1] ∧ A ∈ [0, 1] → [R2 ]p
8 classify OB’s origin blocks into groups based on their S ∈ [2, 3] ∧ R ∈ [0, 1] ∧ A ∈ [0, 1] → [R2 ]p
sources, and then combine all the origin blocks in the same
group into one block whose winning decision is the decision Figure 7: The first-match rule sequence generated
of the block with the smallest source; Let [OB1 , from the PDD in Figure 6
· · · , OBk ]dec be yi ’s resulting origin block after grouping;
9 if A = Permit-Overrides then policy or a policy set. For each i, let Xi′ be the normaliza-
10 if ∃j ∈ [1, k] such that OBj ’s winning decision is
permit then dec := permit;
tion result of Xi . We present our normalization algorithm
11 else dec := deny; based on the following four cases of A.
12 else if A = Deny-Overrides then
13 if ∃j ∈ [1, k] such that OBj ’s winning decision is deny 1. A=First-Applicable: In this case, the output is the
then dec := deny; concatenation of the n sequences X1′ , · · · , Xn′ in the
14 else dec := permit; order from 1 to n. Formally, using “|” to denote con-
15 return hy1 , · · · , ym i; catenation, we have X ′ = hX1′ | · · · |Xn′ i.
16 Append(v, i, Fm ∈ Sm ∧ · · · ∧ Fd ∈ Sd → OB) 2. A=Only-One-Applicable: This case is similar to the
17 /*F (v) = Fm and E(v) = {e1 , · · · , ek }*/
18 if (Sm − (I(e1 ) ∪ · · · ∪ I(ek ))) 6= ∅ then First-Applicable case, except that we first need to make
19 add to v an outgoing edge ek+1 with label sure that for any two sequences Xi′ and Xj′ (1 ≤ i 6=
Sm − (I(e1 ) ∪ · · · ∪ I(ek )); j ≤ n), no rule in Xi′ overlaps with any rule in Xj′ .
20 build a decision path P from rule Fm+1 ∈ Sm+1 ∧ · · · ∧ Fd
∈ Sd → OB, and make ek+1 point to the first node of P; Otherwise, there exists at least a request that more
21 OB’s source := hi ; than one policy or policy set in hX1 , · · · , Xn i are appli-
22 add OB to the terminal node of P; cable to the request, which indicates a potential error
23 if m < d then in the original policy.
24 for j := 1 to k do
25 if I(ej ) ⊆ Sm then 3. A=Permit-Overrides: In this case, we need to treat
26 Append(ej .t, i,
Fm+1 ∈ Sm+1 ∧ · · · ∧ Fd ∈ Sd → OB); hX1′ | · · · |Xn′ i as all-match rules and convert them to
27 else if I(ej ) ∩ Sm 6= ∅ then first-match rules using the AllMatch2FirstMatch algo-
28 add to v an outgoing edge e with label I(ej ) ∩ Sm ; rithm.
29 make a copy of the subgraph rooted at ej .t, and
make e points to the root of the copy; 4. A=Deny-Overrides: This case is handled similar to
30 replace the label of ej by I(ej ) − Sm ; the Permit-Overrides case.
31 Append(e.t, i,
Fm+1 ∈ Sm+1 ∧ · · · ∧ Fd ∈ Sd → OB);
The pseudocode of the XACML normalization algorithm
32 else if m = d then is shown in Algorithm 3. Recall that we add rule R−1 :
33 for j := 1 to k do true → NotApplicable as the last rule to make the sequence
34 if I(ej ) ⊆ Sm then
35 OB’s source := hi ; of range rules complete.
36 add OB to the terminal node ej .t; Example: Considering the XACML policy in Figure 1,
37 else if I(ej ) ∩ Sm 6= ∅ then which is a policy set that consists of two policies hR1 , R2 i
38 add to v an outgoing edge with label I(ej ) ∩ Sm ; and hR3 i, the normalization result hR1 , R2 i′ consists of the
39 make a copy of the subgraph rooted at ej .t, and sequence of rules listed in Figure 7 and the normalization
make e points to the root of the copy;
40 replace the label of ej by I(ej ) − Sm ; result hR3 i′ is S ∈ [0, 0] ∧ R ∈ [1, 1] ∧ A ∈ [0, 1] → [R3 ]p .
41 OB’s source := hi ; Because the policy combining algorithm of the policy set is
42 add OB to the terminal node e.t; Permit-Overrides, we need to convert all the rules in Figure
7 and hR3 i′ to a rule sequence following the first-match se-
mantics. After we add the last rule true → NotApplicable
denoted as R−1 , the final sequence of range rules, which is
equivalent to the example XACML policy in Figure 1, is
shown in Figure 8. We use na to denote NotApplicable.
Solution: We design the algorithm for normalizing XACML
policies to be recursive because of the recursive nature of 4.8 Complex XACML Functions
XACML policies (i.e., a policy set may contain other poli- Problem: In the sequential range rule representation, the
cies or policy sets). Let X = hX1 , · · · , Xn i be a policy set predicate of each rule is uniformly specified as the con-
with a policy combining algorithm A, where each Xi is a junction of member of a finite set predicates. However, in

271
Algorithm 3: XACML Policy Normalization Example: Suppose R1 in Figure 2(b) has a function f (),
Input: An XACML policy X. that is, the predicate of R1 is S ∈ [0, 1] ∧ R ∈ [0, 0] ∧ A ∈
Output: A sequence of range rules that is equivalent to X. [0, 0] ∧ f () → d. If so, we treat R1 as S ∈ [0, 1] ∧ R ∈
1 rewrite each XACML rule’s decision as an origin block; [0, 0] ∧ A ∈ [0, 0] → (if f () then deny ).
2 R−1 := true → First-Applicable;
3 return h Normalize(X, X’s combining algorithm) |R−1 i; 4.9 Correctness of XACML Normalization
4 Normalize(hX1 , · · · , Xn i, A)
5 if A = First-Applicable then The correctness of XACML policy numericalization is ob-
6 output = hi; vious. The correctness of XACML policy normalization fol-
7 for i := 1 to n do lows from Lemma 4.1, Lemma 4.2, Theorem 4.1, and The-
8 if Xi is a rule then
9 Xi′ := range rule converted from Xi ; orem 4.2. The proofs of these lemmas and theorems are
10 else if Xi is a policy or policy set then
elided in this paper due to space limitations, but they are
11 Xi′ :=Normalize(Xi , Xi ’s combining algorithm); available in [2].
12 output := output|Xi′ ;
13 return output;
Lemma 4.1. Given an XACML policy (or policy set) X
with combining algorithm A, where A ∈ {Permit-Overrides,
14 else if A = Only-One-Applicable then
15 output = hi; Deny-Overrides}, for any request Q, the origin block of the
16 for i := 1 to n do first rule that Q matches in AllMatch2FirstMatch(X, A)
17 if Xi is a rule then consists of all the rules that Q matches in X.
18 Xi′ := range rule converted from Xi ;
19 else if Xi is a policy or policy set then Lemma 4.2. Given an XACML policy (or policy set) X
20 Xi′ :=Normalize(Xi , Xi ’s combining algorithm);
with combining algorithm A, where A ∈ {Permit-Overrides,
21 output := output|Xi′ ;
Deny-Overrides}, for any request Q, using OB(Q) to de-
22 for every pair 1 ≤ i 6= j ≤ n do note the origin block of the first rule that Q matches in
23 for every rule r in Xi ′ do
24 for every rule r ′ in Xj ′ do AllMatch2FirstMatch(X, A), the winning decision of OB(Q)
25 if r and r ′ overlap then report error; is the same decision that X makes for Q.

26 return output; Theorem 4.1. Given an XACML policy X and its nor-
27 else if A = Permit-Overrides or Deny-Overrides then malized version Y , for any single-valued request Q, X and
28 for i := 1 to n do
29 if Xi is a rule then
Y have the same decision for Q.
30 Xi′ :=range rule converted from Xi ;
31 else if Xi is a policy or policy set then Theorem 4.2. Given an XACML policy X and its nor-
32 Xi′ :=Normalize(Xi , Xi ’s combining algorithm); malized version Y , for any multi-valued request Q, X and
Y have the same decision for Q.
33 return AllMatch2FirstMatch(hX1′ , · · · , Xn

i, A);

5. THE POLICY EVALUATION ENGINE


r1 : S ∈ [0, 0] ∧ R ∈ [0, 0] ∧ A ∈ [0, 0] → [R1 ]d After converting an XACML policy to a semantically equiv-
r2 : S ∈ [1, 1] ∧ R ∈ [0, 0] ∧ A ∈ [0, 0] → [ [R1 ]d , [R2 ]p ]d alent sequence of range rules, we need an efficient approach
r3 : S ∈ [1, 1] ∧ R ∈ [0, 0] ∧ A ∈ [1, 1] → [R2 ]p to search the decision for a given request using the sequence
r4 : S ∈ [1, 1] ∧ R ∈ [1, 1] ∧ A ∈ [0, 1] → [R2 ]p of range rules. In this section, we describe two approaches to
r5 : S ∈ [2, 3] ∧ R ∈ [0, 1] ∧ A ∈ [0, 1] → [R2 ]p
r6 : S ∈ [0, 0] ∧ R ∈ [1, 1] ∧ A ∈ [0, 1] → [R3 ]p efficiently processing single-valued requests, namely the de-
r7 : S ∈ [0, 3] ∧ R ∈ [0, 1] ∧ A ∈ [0, 1] → [R−1 ]na cision diagram approach, and the forwarding table approach.
We further discuss methods for choosing the appropriate ap-
Figure 8: The final sequence of range rules con- proach in real applications.
verted from the XACML policy in Figure 1
5.1 The Decision Diagram Approach
XACML policies, the condition of a rule could be a com- The decision diagram approach uses the policy decision
plex boolean function that operates on the results of other diagram converted from a sequence of range rules to improve
functions, literal values, and attributes from requests. There the efficiency of decision searching operation. Constructing
are no side effects to function calls and the final result is a a PDD from a sequence of first-match rules is similar to the
boolean value indicating whether or not the rule applies to algorithm for constructing a PDD from a sequence of all-
the request. An example condition of a rule in an XACML match rules. Figure 9 shows the PDD constructed from the
policy could be “salary > 5000 or date > January 1, 1900”. sequence hr1 , r2 , r3 , r4 , r5 , r6 , r7 i in Figure 8.
How to model complex functions of XACML policies in the
sequential range rule representation is a challenging issue.
Solution: For a rule that has a condition specified using [0, 0] S
[2, 3]
XACML functions, we treat such a condition as part of the [1, 1]

decision of the rule. More formally, for a rule P ∧ f () → R R R


[0, 0] [1, 1] [0, 0] [1, 1] [0, 1]
permit, we convert it to rule P → (if f () then permit). In
dealing with rules, we treat the decision (if f () then permit) A A A A A
as a distinct decision. In dealing with rule/policy combining [0, 0] [1, 1] [0, 1] [0, 0] [1, 1] [0, 1] [0, 1]
algorithms, we treat the decision (if f () then permit) as a [R1]d [R-1]na [R3]p [[R1 ] d, [R2]p] d [R2]p [R2]p [R2]p
special type of a permit decision. Our idea applies similarly
to deny rules. Figure 9: The PDD constructed from the sequence
of range rules in Figure 8

272
The algorithm for processing a single-valued request con- Algorithm 4: Construct Forwarding Tables
sists of two steps. First, we numericalize the request using Input: A PDD.
the same numericalization table in converting the XACML Output: Forwarding tables T1 , · · · , Td .
policy to range rules. For example, a request (Professor, 1 put the root into queue Q;
Grade, Change) will be numericalized as a tuple of three 2 while Q 6= ∅ do
3 sum := 0;
integers (2, 0, 0). Second, we search the decision for the 4 for j := 0 to sizeof(Q) − 1 do
numericalized request on the constructed PDD. Note that 5 remove node v from Q;
every terminal node in a PDD is labeled with an origin 6 /*Suppose F (v) is Fh and v has k outgoing edges
e0 , e1 , · · · , ek−1 .*/
block and the winning decision of the block is the decision 7 if Fh 6= Fd then
of the single-valued requests that match the decision path 8 for i := 0 to |D(Fi )| − 1 do
that contains the terminal node. 9 if i ∈ I(eg ) then Th [i, j] := sum + g;
To speed up the decision searching, for each nonterminal 10 sum := sum + k;
node v with k outgoing edges e1 , · · · , ek , we sort the ranges 11 for g := 0 to k − 1 do
12 put eg .t in Q;
in I(e1 ) ∪ · · · ∪ I(eg ), i.e., all the ranges that appear on the
outgoing edges of v, in an increasing (or decreasing) order. 13 else
In the sorted list, for each range I, assuming I ∈ I(ej ), is 14 for i := 0 to |D(Fi )| − 1 do
15 for g := 0 to k − 1 do
associated with a pointer that points to the target node that 16 if i ∈ I(eg ) then
ej points to. Such sorting allows us to perform binary search 17 Td [i, j] := F (eg .t);
on each nonterminal node.

5.2 The Forwarding Table Approach 18 return T1 , · · · , Td ;

The forwarding table approach is based on the PDD that


constructed in the decision diagram approach. The basic
idea of the forwarding table approach is to convert a PDD single-valued request. The pseudocode of the algorithm for
to d tables, which we call forwarding tables, such that we can processing single-valued requests is in Algorithm 5.
search the decision for each single-valued request by travers- Taking the example forwarding tables in Figure 10, sup-
ing the forwarding tables in d steps. pose we have a request (1, 1, 0). We first use 1 to find the
5.2.1 Constructing Forwarding Tables value T1 [1] = 1. Second, we use 1 to find the value T2 [1, 1] =
For ease of presentation, we assume that each decision 3. Third, we use 0 to find the decision T3 [0, 3] = [R2 ]p for
path in the constructed PDD contains d nodes that are la- the request, which means the decision is permit, the corre-
beled in the order of F1 , · · · , Fd from the root to the ter- sponding origin is R2 and the winning decision is permit.
minal node. Given a PDD, we construct forwarding tables The searching operation for request (1, 1, 0) is in Figure 10.
as follows. First, for each nonterminal node v, suppose v is
labeled Fi and v has k outgoing edges e1 , · · · , ek , we create Algorithm 5: Process Requests With Forwarding
a one-dimensional array T of size |D(Fi )|. Considering an Tables
arbitrary value m in D(Fi ), suppose m ∈ I(ej ). If the tar- Input: (1) A single-valued request (m1 , · · · , md ).
get node pointed by ej is a nonterminal node, say v ′ , then (2) Forwarding tables T1 , · · · , Td .
T [m] is the pointer of the table corresponding to v ′ . If the Output: The origin block for the single-valued request.
target node pointed by ej is a terminal node, then T [m] 1 j := 0;
2 for i := 1 to d do
is the label of the terminal node, which includes the origin 3 if i = d then return Td [md , j];
block of the path containing the terminal node. Second, for 4 else if i = 1 then j := T1 [m1 ];
each attribute Fi , we compose all the tables of the nodes 5 else j := Ti [mi , j];
with label Fi into one two-dimensional array named Ti . If
we use Mi to denote the total number of Fi nodes in the A request T1 0 0
(

PDD, then the array Ti is a |D(Fi )| × Mi two dimensional 1 1 1


array. Note that every element in Ti is a value in the range 1 2 2
0
[0, Mi+1 − 1], which is the pointer to a column in the next 3 2
)

forwarding table Ti+1 . The pseudocode of the algorithm for


constructing forwarding tables from a PDD is in Algorithm 0 1 2
T2
4. The forwarding tables T1 , T2 , T3 constructed from the ex- 0 0 2 4
1 1 3 4
ample PDD in Figure 9 are all shown in Figure 10. Note
that eg .t denotes the target node that edge eg points to,
and F (eg .t) denotes the label of eg .t. T3
0 1 2 3 4
0 [R1]d [R3]p [ [R1]d, [R2]p ] d [R2]p [R2]p
5.2.2 Processing Single-valued Requests 1 [R-1]na [R3]p [R2]p [R2]p [R2]p
Given a single-valued request (m1 , · · · , md ), we can find
the correct decision for this request in d steps. First, we use Figure 10: Forwarding tables for PDD in Figure 9
m1 to find the value T1 [m1 ]. Second, we use m2 to find the
value T2 [m2 , T1 [m1 ]]. Third, we use m3 to find the value 5.3 Comparing the Two Approaches
T3 [m3 , T2 [m2 , T1 [m1 ]]]. This process continues until we find Comparing the two approaches in terms of memory space
the value in Td , which contains the origin block for the given and request processing time, the decision diagram approach
request. Similar to the PDD approach, we use the winning requires a smaller amount of memory and a larger amount
decision of the origin block as the final decision for that of processing time; the forwarding table approach requires a

273
7
PDD
Table
6

Pre−processing Time(s)
Processing Time (ms) 5
# of Preprocessing Time (ms)
Policy Single-valued Requests Multi-valued Requests
Rules
PDD Table PDD Table Sun PDP PDD Table Sun PDP 4
1 (codeA) 2 14 16 59 44 2677 296 255 2579
2 (codeB) 3 14 16 65 44 3152 287 249 3302
3
3 (codeC) 4 21 23 58 46 3267 306 236 3267
4 (codeD) 5 18 20 62 40 3405 274 236 3441
2
5 (continue-a) 298 282 293 107 55 5875 553 353 7586
6 (continue-b) 306 210 216 101 54 6001 619 357 7522
7 (pluto) 21 48 51 76 55 14969 304 238 19457 1

average 87 91 75 48 5620 377 274 6736


0
400 800 1200 1600 2000 2400 2800 3200 3600 4000
Number of Rules
Figure 11: Experimental results on real-life XACML policies
Figure 12: The preprocessing time
on synthetic XACML policies
5 5 5
10 10 x 10
15
PDD PDD
Sun PDP − PDD
Table Table
Total Processing Time(ms)

Total Processing Time(ms) Sun PDP − Table


Sun PDP Sun PDP

Processing time difference(ms)


4 4
10 10

10
3 3
10 10

2 2
10 10

1 1
10 10

0 0
10 10 0
1 2 3 4 5 6 7 1 2 3 4 5 6 7 400 800 1200 1600 2000 2400 2800 3200 3600 4000
Policy Policy Number of Rules

Figure 13: Total processing time Figure 14: Total processing time Figure 15: The processing time
for 100,000 single-valued requests for 100,000 multi-valued requests difference between Sun PDP and
on real-life XACML policies on real-life XACML policies XEngine

larger amount of memory and a smaller amount of processing (of large sizes with thousands of rules), the experimental re-
time. sults show that XEngine is three to four orders of magnitude
Choosing which approach to use depends on the proper faster than Sun PDP for both single-valued and multi-valued
tradeoff between memory space and processing time. In requests.
a real application, we can pre-compute the exact memory We also measured the preprocessing time of XACML poli-
space required by each approach, and then choose the more cies for XEngine. The preprocessing time of an XACML
efficient approach that satisfies the memory requirement of policy includes the time for numericalizing the policy, the
the application. time for normalizing the policy, and the time for building
the internal data structure (of a PDD or forwarding table).
For a real-life XACML policy (of small sizes with hundreds
6. EXPERIMENTAL RESULTS of rules), the preprocessing takes less than a second. For
We implemented XEngine using Java 1.6.3. Our experi- synthetic XACML policies (of large sizes with thousands of
ments were carried out on a desktop PC running Windows rules), the preprocessing takes a few seconds. For example,
XP SP2 with 3G memory and dual 3.4GHz Intel Pentium numericalizing and normalizing an XACML policy of 4000
processors. We evaluated the efficiency and effectiveness of rules takes about 6 seconds on average.
XEngine on both real-life and synthetic XACML policies. In terms of effectiveness, we compared the decisions made
In terms of efficiency, we measured the request processing by XEngine and Sun PDP for each request. In our experi-
time of XEngine in comparison with that of Sun PDP [1]. ments, we first generated 100,000 random single-valued re-
For XEngine, the processing time for a request includes the quests and 100,000 random multi-valued requests; and then
time for numericalizing the request and the time for finding fed each request to both XEngine and Sun PDP and com-
the decision for the numericalized request. For Sun PDP, the pared their decisions. The experimental results show that
processing time for a request is the time for finding the deci- XEngine and Sun PDP have the same decision for every
sion. The experimental results show that XEngine is orders request.
of magnitude more efficient than Sun PDP, and the per-
formance difference between XEngine and Sun PDP grows 6.1 Performance on Real-life policies
almost linearly with the number of rules in XACML policies. In our experiments, we used seven real-life XACML poli-
For real-life XACML policies (of small sizes with hundreds cies collected from three different sources. Among these
of rules), the experimental results show that XEngine is two policies, codeA, codeB, codeC, codeD, continue-a, and conti-
orders of magnitude faster than Sun PDP for single-valued nue-b are XACML policies used by Fisler et al. [4]; continue-
requests and one order of magnitude faster than Sun PDP a and continue-b are designed for a real-world web applica-
for multi-valued requests. For synthetic XACML policies tion that supports Conf. management; pluto is used in the

274
8 8
10 10
7
10 Sun PDP Sun PDP
Sun PDP PDD PDD
7 7
PDD 10 Table 10 Table

Total Processing Time(ms)

Total Processing Time(ms)


6 Table
10
Total Processing Time(ms)

6 6
10 10
5
10
5 5
10 10

4
10 4 4
10 10

3 3 3
10 10 10

2
2 2
10 10 10

1 1
1 10 10
10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
400 800 1200 1600 2000 2400 2800 3200 3600 4000
Number of Layers Number of Layers
Number of Rules

Figure 16: Effect of number of Figure 17: Effect of number of lay- Figure 18: Effect of number of lay-
rules for single-valued requests ers for single-valued requests un- ers for multi-valued requests un-
der 1000 rules der 1000 rules
8 8
10 10
7
10 Sun PDP Sun PDP
Sun PDP PDD PDD
7 7
PDD 10 Table 10 Table
Total Processing Time(ms)

Total Processing Time(ms)


6 Table
10
Total Processing Time(ms)

6 6
10 10
5
10
5 5
10 10

4
10 4 4
10 10

3 3 3
10 10 10

2 2 2
10 10 10

1 1
1 10 10
10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
400 800 1200 1600 2000 2400 2800 3200 3600 4000
Number of Layers Number of Layers
Number of Rules

Figure 19: Effect of number of Figure 20: Effect of number of lay- Figure 21: Effect of number of lay-
rules for multi-valued requests ers for single-valued requests un- ers for multi-valued requests un-
der 3000 rules der 3000 rules

ARCHON system (http://archon.cs.odu.edu/). We used consistent with our analysis in Section 5. On average, the
the request-generation technique in [7] to generate random forwarding table approach is 35% faster than the PDD ap-
requests. For each policy, we conducted two experiments to proach for single-valued requests; and the forwarding table
evaluate the processing time of single-valued requests and approach is 27% faster than the PDD approach for multi-
that of multi-valued requests respectively. In each experi- valued requests. We also observe that XEngine’s processing
ment, we generated 100,000 random single-valued or multi- time for multi-valued requests is approximately four times
valued requests to simulate a large volume of requests. For more than that for single-valued requests. The reason is that
each multi-valued request, we assign two distinct values to for a multi-valued request, XEngine evaluates each decom-
the subject, two distinct values to the object, and one value posed single-valued request individually, and resolving de-
to the action. cisions for the single-valued requests costs additional time.
For each of the seven XACML policies, Figure 11 shows Recall that in our experiments, each multi-valued request
the preprocessing time of the policy, and the total processing corresponds to four single-valued requests according to our
time for the 100,000 single-valued or multi-valued requests. methods for generating multi-valued requests. Therefore, in
Note that here we use “PDD” to denote the XEngine scheme XEngine, there is an almost linear correlation between the
using the PDD approach, and “Table” to denote the XEngine processing time of a multi-valued request and the number of
scheme using the forwarding table approach. Figures 13 and single-valued requests decomposed from the multi-valued re-
14 show the total processing time of 100,000 single-valued quest. Furthermore, we observe that the performance of Sun
requests and that of multi-valued requests respectively for PDP for multi-valued requests is not highly dependent on
both XEngine and Sun PDP. Note that the vertical axes of the number of single-valued requests decomposed from the
Figures 13 and 14 are in logarithmic scales in terms of mil- multi-valued requests. This is not surprising, because Sun
liseconds. These experimental results show that for XACML PDP compare each request with all the rules in the policy.
policies of small sizes (with hundreds of rules), XEngine is
one or two orders of magnitude faster than Sun PDP. For 6.2 Performance on Synthetic policies
single-valued requests, on average, the forwarding table ap- It is difficult to get a large number of real-life XACML
proach and the PDD approach are 117 and 75 times faster policies, as access control policies are often deemed confi-
than Sun PDP. For multi-valued requests, on average, the dential. To further evaluate the performance and scalability
forwarding table approach and the PDD approach are 24 of XEngine, we generated random synthetic XACML poli-
and 18 times faster than Sun PDP. cies of large sizes. We generate multi-layered policies in a
From the above figures, we observe that the forwarding hierarchical fashion. A multi-layered policy has a root pol-
table approach is faster than the PDD approach, which is icy set that includes multiple layers of sub-policy sets and

275
sub-policies. Each policy has a sequence of rules. Each pol- of layers, for multi-valued requests, the forwarding table ap-
icy element has a randomly selected combining algorithm. proach is constantly about 5000 times faster than Sun PDP,
Each rule holds randomly selected attribute id-value pairs and the PDD approach is constantly about 3000 times faster
from our predefined domain that linearly increases with the than Sun PDP.
number of rules. Single-valued requests and multi-valued re-
quests are generated randomly in the same way as for real- 7. CONCLUSIONS
life XACML policies. In our experiments, we evaluated the This paper represents the first effort on improving XACML
impact of the policy size in terms of the number of rules and policy evaluation engines. We make two key contributions in
the impact of the policy structure in terms of the number of this paper. First, we present a procedure for numericalizing
layers. and normalizing XACML policies. This procedure is useful
Figure 12 shows the preprocessing time of XEngine versus beyond this paper. Second, we present two algorithms for
the number of rules in a three-layered policy for XEngine. processing requests using the normalized numerical policy.
We observe that there is an almost linear correlation be- We empirically demonstrated XEngine’s efficiency and effec-
tween the preprocessing time of XEngine and the number tiveness on real-life XACML policies collected from various
of rules, which demonstrates that XEngine is scalable in the sources as well as large synthetic XACML policies. The ex-
preprocessing phrase. perimental results show that XEngine is orders of magnitude
Figure 15 shows the difference between Sun PDP and faster than the widely deployed Sun PDP.
XEngine for the total processing time of the 100,000 ran-
domly generated single-valued requests. This figure shows 8. REFERENCES
[1] Sun’s XACML implementation.
that XEngine is orders of magnitude more efficient than Sun
http://sunxacml.sourceforge.net/, 2005.
PDP, and the performance difference grows almost linearly
with the number of rules in XACML policies. [2] XEngine: A Fast and Scalable XACML Policy
Figures 16 and 19 show the experimental results as a func- Evaluation Engine. Technical Report MSU-CSE-08-2,
tion of the number of rules in a three-layered policy for pro- Department of Computer Sciences and Engineering,
cessing single-valued requests and multi-valued requests, re- Michigan State University, East Lansing, Michigan,
spectively. Figures 17 and 20 show the experimental results March 2008. http://www.cse.msu.edu/~alexliu/
as a function of the number of layers for processing single- publications/xengine/xengtech.pdf
valued requests in two three-layered policies, which consist [3] Q. Dong, S. Banerjee, J. Wang, D. Agrawal, and
of 1000 rules and 3000 rules respectively. Figures 18 and A. Shukla. Packet classifiers in ternary CAMs can be
21 show the evaluation results as a function of the number smaller. In Proc. of SIGMETRICS, pages 311–322,
of layers for processing multi-valued requests in two three- 2006.
layered policies, which consist of 1000 rules and 3000 rules [4] K. Fisler, S. Krishnamurthi, L. A. Meyerovich, and
respectively. Note that the vertical axes of these six figures M. C. Tschantz. Verification and change-impact
are in logarithmic scales. analysis of access-control policies. In Proc. of the 27th
These figures demonstrate that XEngine is highly scalable Int. Conf. on Software(ICSE-05), pages 196–205, 2005.
and efficient in comparison with Sun PDP. For single-valued [5] M. G. Gouda and A. X. Liu. Firewall design:
requests, under different numbers of rules, say 400, 2000, consistency, completeness and compactness. In Proc.
and 4000 rules in a three-layered policy, the forwarding table of the IEEE Int. Conf. on Distributed Computing
approach is 3594, 18639, 34408 times faster than Sun PDP Systems (ICDCS), pages 320–327, March 2004.
respectively, and the PDD approach is 1405, 6210, 10873 [6] V. Kolovski, J. Hendler, and B. Parsia. Analyzing web
times faster than Sun PDP respectively. For multi-valued access control policies. In Proc. of the Int. Conf. on
requests, under different numbers of rules, say 400, 2000, World Wide Web (WWW), pages 677–686, 2007.
and 4000 rules in a three-layered policy, the forwarding ta- [7] E. Martin, T. Xie, and T. Yu. Defining and measuring
ble approach is 634, 3325, 6057 times faster than Sun PDP policy coverage in testing access control policies. In
respectively, and the PDD approach is 447, 2087, 3699 times Proc. of the 8th Int. Conf. on Information and
faster than Sun PDP respectively. Our experimental results Communications Security (ICICS-06), pages 139–158,
also show that the impact of the structure of XACML poli- 2006.
cies in terms of the number of layers on the performance of [8] P. Mazzoleni, E. Bertino, and B. Crispo. Xacml policy
XACML policy evaluation is not remarkable. For XACML integration algorithms: not to be confused with xacml
policies with 1000 rules but with various number of layers, policy combination algorithms. In ACM Symposium
for single-valued requests, the forwarding table approach is on Access Control Models and Technologies
constantly about 9000 times faster than Sun PDP, and the (SACMAT), 2006.
PDD approach is constantly about 4000 times faster than [9] OASIS eXtensible Access Control Markup Language
Sun PDP. For XACML policies with 1000 rules but with var- (XACML) V2.0 Specification Set
ious number of layers, for multi-valued requests, the forward- http://www.oasis-open.org/committees/xacml/. 2007.
ing table approach is constantly about 2000 times faster than [10] L. Qiu, G. Varghese, and S. Suri. Fast firewall
Sun PDP, and the PDD approach is constantly about 1500 implementations for software-based and
times faster than Sun PDP. For XACML policies with 3000 hardware-based routers. In Proc. the 9th Int. Conf. on
rules but with various number of layers, for single-valued Network Protocols (ICNP), 2001.
requests, the forwarding table approach is constantly about
[11] M. C. Tschantz and S. Krishnamurthi. Towards
26000 times faster than Sun PDP, and the PDD approach
reasonability properties for access-control policy
is constantly about 12000 times faster than Sun PDP. For
languages. In ACM Symposium on Access Control
XACML policies with 3000 rules but with various number
Models and Technologies (SACMAT), 2006.

276

View publication stats

You might also like