<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Simplified Access Control Policies for XML Databases</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Loreto</forename><surname>Bravo</surname></persName>
							<email>lbravo@udec.cl</email>
							<affiliation key="aff0">
								<orgName type="institution">Universidad de Concepcin</orgName>
								<address>
									<country key="CL">Chile</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Ricardo</forename><surname>Segovia</surname></persName>
							<email>risegovia@udec.cl</email>
							<affiliation key="aff0">
								<orgName type="institution">Universidad de Concepcin</orgName>
								<address>
									<country key="CL">Chile</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Simplified Access Control Policies for XML Databases</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">B8E7351DB654A85CAF5BEFB5424857C9</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T19:37+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>When defining Access Control Policies for XML Databases administrators need to make sure that they are not inconsistent, this is, that it is not possible to perform a forbidden operation through a sequence of allowed operations. This problem has been studied before for policies defined using authorizations based in insert, delete, replace and replaceVal types to control updates in documents that conform to structured DTDs and chain DTDs. For those policies, consistency can be checked in polynomial time, but the problem of minimally restoring consistency is np-hard. In this article we show how the administration of authorization can be simplified by considering only insert and delete permissions, while still being able to control access of replace updates, in such a way that they can be checked for consistency and repaired if they are not in polynomial time. Also, this simplified policies allow to control a more general class of updates than the ones previously studied.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>XML documents are increasingly being used not only to share data but also to store it in that format, i.e. XML Databases. For this reason, it has become important to provide ways to control the way in which different users read and modify this data. There's been work on access control techniques for both read <ref type="bibr" target="#b0">[1,</ref><ref type="bibr" target="#b4">[5]</ref><ref type="bibr" target="#b5">[6]</ref><ref type="bibr" target="#b6">[7]</ref><ref type="bibr" target="#b7">[8]</ref><ref type="bibr" target="#b9">10]</ref> and write <ref type="bibr" target="#b1">[2]</ref><ref type="bibr" target="#b2">[3]</ref><ref type="bibr" target="#b3">[4]</ref> queries over XML data.</p><p>For write queries, a special type of vulnerability has been studied: the possibility that a policy specification enables a user to simulate a forbidden update through a sequence of allowed updates in the same policy. These "inconsistent" policies open up security problems and as such, need to be properly detected and repaired before being enforced.</p><p>Example 1. The US National Library of Medicine developed Journal Publishing Tags to describe the content and metadata of journal articles. A fragment of its schema is shown in Fig. <ref type="figure" target="#fig_1">1</ref> <ref type="foot" target="#foot_0">1</ref> and a sample document in Fig. <ref type="figure">2</ref>. Consider, for example, a policy that allows a user to insert and remove elements of type sub-article but does not allow him/her to insert new journal-id elements. This policy has an inconsistency, since it is possible to add a journal-id by first removing the element sub-article, and then inserting a new one that includes the extra journal-id. For example, it shouldn't be possible to obtain document D 2 (in Figure <ref type="figure" target="#fig_0">5</ref>) from document D 0 (in Figure <ref type="figure">2</ref>) since inserting journal-id elements is forbidden. However, this can be achieved by first removing from D 0 the sub-article element, which results in document D 1 in Figure <ref type="figure" target="#fig_3">3</ref>, and then inserting the new sub-article element shown in Figure <ref type="figure">4</ref> below the front element of document D 1 . Thus, through two allowed updates such as deleting an inserting a sub-article element, it is possible obtain a document D 2 that is also the result of applying a forbidden update.  In <ref type="bibr" target="#b1">[2]</ref> the authors defined inconsistencies in XML access control policies for write operations, studied the problem of identifying such policies for structured DTDs, showed that finding repairs to those policies is np-complete and provided approximation algorithms to compute them. Later, in <ref type="bibr" target="#b3">[4]</ref>, authors extended those results to deal with a general kind of DTD called Chain Extended DTDs (CEDTDs for short), like the one in Fig. <ref type="figure" target="#fig_1">1</ref>, imposing some restriction over the type of updates that were considered. For instance, it only considered updates that replaced element types belonging to a disjunction without +, * or ?. Thus, in the Journal Publishing example, the only valid replace updates would be between element types front and front-stub. In this setting, the problem of repairing inconsistent policies was shown to be np-complete.</p><formula xml:id="formula_0">2</formula><p>In this article, we show how an access control policy can be defined for XML databases that conform to CEDTDs in such a way that: (i) it deals with insert, delete and replace updates between any two distinct element types, (ii) policy consistency can be checked in polynomial time, (iii) repairs to inconsistent policies can be found in polynomial time. The cost to achieve this is that it cannot express some policies that can be defined in <ref type="bibr" target="#b3">[4]</ref>. However, the type of policies that cannot be expressed are not common in practice. This document is structured as follows. The definitions of XML documents, schemas and updates are provided in Section 2. Section 3 defines access control policies for CEDTDs. Next, in Section 4 the consistency of those policies in analyzed and for the cases in which they are inconsistent, the repair problem is studied in Section 5. Finally, the conclusions are provided in Section 6.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminaries</head><p>An extended DTD (EDTD) is an abstraction of the two main schema definition languages for XML <ref type="bibr" target="#b8">[9]</ref>, namely DTDs and XSDs, and represented by a quintuple (Ele, Types, Rg, rt, µ) where i) Ele is a finite set of element names ii) Types is a finite set of element types iii) rt is a distinguished element name in Ele and in Types called the root iv) µ is a mapping from Types to Ele such that µ(rt) = rt, and v) Rg defines the element types: that is, Rg : Types → Reg Types , where Reg Types is a set of regular expressions r over Types, considering concatenation, disjunction, element repetition and optionality, empty and string elements. Given a type A we will refer to Rg(A) as its production rule. An element type B i that appears in the production rule of an element type A is called a subelement type of A. Given an EDTD D, we write A ≤ D B for the transitive, reflexive closure of the subelement relation.</p><p>A structured EDTD is an EDTD such that its regular expressions are defined using the grammar:</p><formula xml:id="formula_1">str | | B 1 , . . . , B n | B 1 + • • • + B n | B * ,</formula><p>where ",", "+" and " * " stand for concatenation, disjunction and Kleene star respectively, for the EMPTY element content, str for text values and B ∈ Types.</p><p>A Chain EDTDs consists of an EDTD whose regular expressions are: (i) a sequence of terms (A</p><formula xml:id="formula_2">1 + • • • + A n ) q ,</formula><p>where q is an optional qualifier of the form +, * , or ?; (ii) a string str; or (iii) empty <ref type="bibr" target="#b10">[11]</ref>. Every structured EDTD is a Chain EDTD.</p><p>Example 2. The Journal Publishing Schema in Fig. <ref type="figure" target="#fig_1">1</ref> is a chain EDTD but it is not a structured EDTD. For example, element article contains either a front or front-stub element, optionally a body element and zero or more repetitions of sub-articles or response elements. 2</p><p>We will model an XML document as rooted unordered trees which conforms to a schema if it validates against its regular expressions. The XML document in Fig. <ref type="figure" target="#fig_1">1</ref> conforms to the chain EDTD in Fig. <ref type="figure">2</ref>.</p><p>Example 3. Let t 0 be the XML document shown in Figure <ref type="figure">6</ref>(b), also represented by the tree in Figure <ref type="figure">6</ref>(c). Let D 0 be the chain EDTD rooted in A shown in Figure <ref type="figure">6</ref>(a). Document t 0 conforms to schema D 0 . 2</p><formula xml:id="formula_3">A→(B+C) + ,D * ,(E+F+G) B → H,I C → str D → str E → str F → str G → str H → str I → (a) CEDTD D0 &lt;A&gt; &lt;B&gt; &lt;H&gt;Hello&lt;/H&gt; &lt;I&gt;&lt;/I&gt; &lt;/B&gt; &lt;C&gt;World&lt;/C&gt; &lt;E&gt;!!&lt;/E&gt; &lt;/A&gt; (b) Document t0 A B H "Hello" I C "World" E "!!"</formula><p>(c) Tree representation of t0 Fig. <ref type="figure">6</ref>. CEDTD D0 with a document t0 that conforms to it</p><p>We consider the following updates:</p><formula xml:id="formula_4">op ::= delete(n) | insert(n, t) | replace(n, t) | replaceVal(n, s).</formula><p>A delete(n) will remove node n and all its descendants. An insert(n, t) operation will add a tree t as a child node below n. A replace(n, t) operation will replace the subtree with root n by the tree t. A replaceVal(n, s) operation will replace the text value of node n with string s. An update operation is said to be valid for t and D if the result of applying it over t results in a document that conforms to D. For example, the update delete(E) would not be valid over t0, because the resulting document would not conform to D.</p><p>In what follows we consider only valid updates. We denote by [[op]](t, D) the resulting XML document obtained by applying update operation op on tree t that conforms to schema D.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Access Control Policies</head><p>We use the notion of update access type to specify the access authorizations. Intuitively, each of these UATs controls the operations that insert or delete an element of type B or operations that replace a string. The relation uat valid in D, which indicates that a base update access type uat is valid for the EDTD D, is constrained by the following inference rules:</p><formula xml:id="formula_5">replaceVal valid in str U valid in t U valid in t * U valid in t U valid in t + U valid in t U valid in t? insert(Bi) valid in (B1 + • • • + Bn) delete(Bi) valid in (B1 + • • • + Bn) U valid in fi U valid in f1, . . . , fn U valid in Rg(A) (A, U ) valid in D</formula><p>The set of valid base UATs for a given EDTD D is denoted by valid We want to enforce restriction over the applications of insert, delete and replace update operations, but the policies, as we have defined so far, allow or forbid only insertions and deletions. Thus, we need to deduce from our policies update access types to control replacements. In order to enforce a policy P on updates, an expanded version P ↑ is inferred from P , adding certain replace operations that are allowed. For instance, replace(B i , B j ) is considered an inferred update access type, for which the permissions are obtained from the allowed and forbidden base UATs such as insert, delete and replaceVal.</p><formula xml:id="formula_6">(D) = {uat | uat valid in D}. Example 4. (example 3 cont.) Given schema D 0 , valid(D 0 ) = {(A, insert(B)), (A, delete(B)), (A, insert(C)), (A, delete(C)), (A, insert(D)), (A, delete(D)), (A, insert(E)), (A, delete(E)), (A, insert(F)), (A, delete(F)), (A, insert(G)), (A, delete(G)),(C, replaceVal), (D, replaceVal), (E, replaceVal), (F, replaceVal), (G, replaceVal), (H, replaceVal)}<label>2</label></formula><p>Since we can apply over a document only updates that result in a new document that conforms to the DTD, we need to define replace UATs only in the cases where the replace could take place.</p><p>Example 6. For the production rule A → (B+C) + ,D * ,(E+F+G) of the ongoing example, elements E, F and G can only be replaced between them, since a replacement of an element E by an B, for example, would result in a document that does not conform to the DTD. On the other hand, elements B, C and D can only be replaced between them. 2</p><p>As the previous example shows, factor of the form (B 1 + • • • + B n ) impose restrictions over the type of elements that can be replaced.</p><p>Definition 4. An XOR factor in A is a factor of the form (B </p><formula xml:id="formula_7">1 + • • • + B n ) in the production rule of A. Let XOR(A) = {{B 1 , • • • , B n }|(B 1 + • • • + B n ) is</formula><p>In the policies defined in <ref type="bibr" target="#b3">[4]</ref> updates that replaced an independent element by another were not considered. </p><p>Intuitively, an UAT in P ↑ represents a set of atomic update operations. More specifically, for t an instance of CEDTD D, op an atomic update and uat an update access type we say that op matches uat on t (op matches t uat) if one of the following inference rules applies:</p><formula xml:id="formula_10">η(n) = A t ∈ ID(B) insert(n, t ) matchest (A, insert(B)) η(n) = B η(parent t (n)) = A delete(n) matchest (A, delete(B)) η(n) = B t ∈ ID(B ) η(parent t (n)) = A replace(n, t ) matchest (A, replace(B, B )) η(n) = str η(parent t (n)) = A replaceVal(n, s) matchest(A, replaceVal)</formula><p>Function η corresponds to the unique mapping from each node in t to the element type associated to it. This uniqueness follows from the assumption that D is unambiguous.</p><p>As we said before, we will restrict only to valid update operation which given a document t and a CEDTD D the result of applying it over t results in a document that conforms with D. Since the problem of validity and authorization are orthogonal, we assume that all the operations to checked by the policy are valid.</p><p>The set of operations that are allowed by a policy P on an XML tree t in an CEDTD D, denoted by [ </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Consistency of Policies</head><p>A policy is said to be consistent if it is not possible to simulate a forbidden update through a sequence of allowed updates. More formally: Definition 6. [2] Consider a policy P defined over schema D. An inconsistency in P for D consists of an allowed run t 0 op1 − − → t 1 . . . We say that nothing is forbidden below an element type A in a policy P defined over D if for every B i such that A ≤ D B i and every (B i , x) ∈ valid(D), (B i , x) ∈ P .</p><p>If A has any replace operations in valid(D), then we define the replace graph</p><formula xml:id="formula_11">G P A = (V A , E A ) where i) V A is the set of subelements of A and ii) (B i , B j ) ∈ E A if there exists (A, replace(B i , B j )) ∈ P ↑ .</formula><p>Theorem 1. A policy P defined over a CEDTD D is consistent if and only if for every production rule:</p><p>1. If (A,insert(B))∈ P ↑ and (A,delete(B))∈ P ↑ , then nothing is forbidden below</p><formula xml:id="formula_12">B 2. If for every i ∈ [1, . . . n], if B i is contained in a cycle in G P A then nothing is forbidden below B i .</formula><p>Proof Sketch: Policy P and schema D can be transformed into a new policy P struct defined over a new structured schema D struct in such a way that P is consistent over D if and only if P struct is consistent over D struct . In <ref type="bibr" target="#b1">[2]</ref> the authors identify three cases in which a policy defined over a structured schema is consistent: insert/delete, negative-cycle and forbidden-transitivity. Because of the characteristics of P struct only the first two can occur. By reversing the transformations, we get the conditions for CEDTDs that correspond to insert/delete and negative cycle inconsistencies.</p><p>2</p><p>The conditions in Theorem 1 are defined over the expanded policy P ↑ . In order to simplify the consistency checking problem, it is better to see how these conditions can be checked in P instead of P ↑ . Proposition 1. A policy P defined over a CEDTD D is consistent if and only if for every element types A, B and C in D:</p><formula xml:id="formula_13">1. If B is independent in A and {(A, insert(B)), (A, delete(B))} ⊆ P then nothing is forbidden below B. 2. If B and C are alternates in A and {(A, insert(B)), (A, delete(B)), (A, insert(C)), (A, delete(C))} ⊆ P then nothing is forbidden below B and C.<label>2</label></formula><p>It is possible to check if conditions in Proposition 1 hold for a policy using standard polynomial-time graph algorithms over the DTD. Thus, the problem of deciding policy consistency with respect to CEDTDs is in ptime. Example 9. (example 8 cont) Policy P D0 has several inconsistencies. First, by having both (A, insert(B)) and (A, delete(B)) allowed for an independent element type B under A, but forbidding (H, replaceVal). Another one is given by having (A, insert(E)), (A, delete(E)), (A, insert(F)) and (A, delete(F)) as allowed operations under alternate types E and F, but forbidding (F, replaceVal). Finally, given by having (A, insert(F)), (A, delete(F)), (A, insert(G)) and (A, delete(G)) as allowed operations under alternate types F and G, but forbidding (F, replaceVal).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Repairing Inconsistent Policies</head><p>If a policy is inconsistent, we would like to suggest possible minimal ways of modifying it in order to restore consistency. In other words, we would like to find repairs that are as close as possible to the inconsistent policy. We would like this repairs to be more restrictive than the original, this is, a repair should provide less access to the user.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 7. [2]</head><p>A policy P is a repair of a policy P defined over a DTD D if and only if: i) P is defined over D, ii) P is consistent, and iii) P ⊆ P . Furthermore a repair P of P is a minimum-repair if there is no repair P such that |P | &lt; |P |. <ref type="foot" target="#foot_1">2</ref>2</p><p>In other words a repair is a new policy over the same schema, which is consistent and contains a subset of the allowed UAT in P . For this repair to be minimal, we require that it contains the maximum number of allowed UATs or, equivalently, that a minimal number of UATs has been removed from P .</p><p>The problem of computing a minimum-repair can be solved in ptime. In what follows we describe an algorithm to do so. By Proposition 1 we have that we need to solve two types of inconsistencies: Because of minimality of repairs, repairs of inconsistencies of Type 1 can be solved independently by removing either (A, insert(B)) or (A, delete(B)). This is not the case for inconsistencies of Type 2, since there might be more than one such inconsistency involving shared types.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Example 10. (example 9 continued)</head><p>There is an inconsistency of Type 2 between E and F since (F, replaceVal) ∈ P . To solve this inconsistency, we need to forbid either (A, insert(E)),(A, delete(E)),(A, insert(F)) or (A, delete(F)). However, choosing to forbid (A, insert(E)) or (A, delete(E)) will not result in a minimal repair since element F is involved in another inconsistency of Type 2 with G since (F, replaceVal) ∈ P . Thus, when there are several inconsistencies of Type 2 it is necessary to choose carefully to ensure that a minimal repair is found. In this case, either (A, insert(F)) or (A, delete(F)) need to be forbidden. The policy also has a inconsistency of Type 1 that can be solved by forbidding either (A, insert(B)) or (A, delete(B)) from our policy. Thus, a minimum-repair for P is P = P \ {(A, insert(B)), (A, delete(F))}. Even though finding a single minimum-repair can be done in polynomial time, there might an exponential number of them.</p><p>Proposition 2. Given a policy P over a CEDTD D, a minimum-repair of it can be computed with Algorithm 1 in O(n + m) where n is the number of types in D and m is the number edges in the tree that represents D. All the repairs can be computed in</p><formula xml:id="formula_14">O(n × 2 n ).<label>2</label></formula><p>In most of the cases m is O(n) and thus a minimum repair can be found in linear time on the number of types in the DTD. In the worst case m is O(n 2 ). Even thought computing all the repairs requires exponential time, it is also possible to show in linear time all the inconsistencies to the designer of the policy so that he can choose how to solve each of them.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusions</head><p>We have provided an access control policy definition language based in basic update access types, that simplifies the administration of authorization, since it only requires that the policy manager defines whether the user should be able to insert or delete elements of the DTD, and automatically deduct replace authorizations from such permissions. For these type of policies, consistency checking and repair computation problems can be solved in polynomial time. We also provided efficient algorithms that, given an inconsistent policy, computes a consistent one that is as close as possible to the inconsistent one in terms of forbidden UATs.</p><p>These policies are an improvement over the ones defined in <ref type="bibr" target="#b3">[4]</ref>, since the repair computation problem for those is np-hard. This is achieved by instead of defining policies in terms of insert, delete and replace UATs, we here define policies using only insert and delete UATs and deducing from them the replace permissions. In terms of expressive power they are not comparable since we can define policies that they cannot and vice-versa. For example, consider a DTD with the production rule A → B * , C * and B and C containing text. A policy P = {insert(C), delete(B)} with P ↑ = {insert(C), delete(B), replace(B, C)} cannot be expressed in policies defined in <ref type="bibr" target="#b3">[4]</ref> since they do not consider replace between elements that do not belong to an XOR factor. On the other hand, we cannot write a policy P for which P ↑ = {(A, replace(B, C)), (B, replaceVal), (C, replaceVal)} even though P ↑ is a consistent policy in <ref type="bibr" target="#b3">[4]</ref>. We believe that the gain in expressive power outweighs the loss since being able to provide permissions for replacements outside of XOR factors is a useful feature and the policies that cannot be expressed do not seem useful in practice. Thus, the policies here introduced can be used as a simple, but powerful, way to provide consistent access control to XML databases.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 5 .</head><label>5</label><figDesc>Fig. 5. Document D2 obtained from D0 after inserting a new journal-ID element.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Definition 1 .</head><label>1</label><figDesc>Given a CEDTD D, a base update access type (base UAT) is an expression of the form (A, ut) where ut ::= insert(B) | delete(B) | replaceVal and A and B are types from D. 2</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Definition 2 . 2 Example 5 .</head><label>225</label><figDesc>A policy P defined over an EDTD D, is represented by the set of allowed update access types defined over D such that P ⊆ valid(D). The set of forbidden UAT of a policy P defined over D are F(P, D) = valid(D) P . (example 4 cont.) A policy for D 0 is P D0 ={(A,insert(B)),(A,delete(B)), (A, insert(C)), (A, delete(C)), (A, insert(E)), (A, delete(E)),(A, insert(F)),(A, delete(F)), (A, insert(G)), (A, delete(G)), (C, replaceVal), (E, replaceVal), (G, replaceVal)}. The set of UATs that are forbidden by P D0 are F(P D0 , D 0 ) = (A, delete(D)), (A, insert(D)), (D, replaceVal), (F, replaceVal), (H, replaceVal)}.2</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Definition 3 .</head><label>3</label><figDesc>Given a CEDTD D, an update access type (UAT) defined over D is a base UAT or an expression of the form (A, replace(B, C)) and A, B, C are types from D. 2</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Example 7 . 2 Example 8 .</head><label>728</label><figDesc>The production rule A → (B+C) + ,D * ,(E+F+G) has one XOR factor, namely (E+F+G). The alternates in A are {E,F}, {E, G} and {F, G}. The independent types in A are B, C and D. (example 4 cont.) The set of extended valid UATs valid(D) ↑ = {(A,insert(B)), (A,insert(C)), (A,insert(D)), (A,delete(B)), (A,delete(C)), (A,delete(D)), (A, replace(E, F)),(A,replace(E, G)), (A, replace(F, E)), (A,replace(F, G)),(A,replace(G, E)), (A,replace(G, F)),(A,replace(B,C)),(A,replace(C,B)),(A,replace(C,D)),(A,replace(D,C)), (A, replace(B,D)), (A, replace(D, B)), (C, replaceVal), (D, replaceVal), (E, replaceVal), (F, replaceVal), (G, replaceVal), (H, replaceVal)}. It differs from valid(D) since it adds all the replace UATs and removes some insert and delete. The set of extended valid UATs represent the types of updates that could result in a document that conforms to schema D 0 . The extended policy P ↑ D0 = {(A, insert(B)), (A, insert(C)), (A, delete(C)), (A, replace(C, B)), (A, delete(B)), (A, replace(B, C)), (A,replace(E,F)), (A,replace(F,E)),(A,replace(G,E)), (A,replace(E,G)), (A,replace(F,G)), (A,replace(G,F)),(C, replaceVal),(E,replaceVal), (G,replaceVal)}. The UATs that are forbidden by the policy correspond to valid(D) ↑ P ↑ D .</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head></head><label></label><figDesc>[P ]](t, D), is the union of the atomic valid update operations matching each UAT in P ↑ . More formally, [[P ]](t, D) = {op | op matches t uat and uat ∈ P ↑ }. Analogously, the forbidden operations are [[F]](t, D) = {op | op matches t uat, and uat ∈ (valid(D) \ P ↑ )}. A safe run t 0 op1 − − → t 1 . . . opn − − → t n is allowed w.r.t. P and D if for every i we have op i ∈ [[P ]](t i−1 , D).</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head></head><label></label><figDesc>opn− − → t n and an update op 0 ∈ [[F]](t 0 , D) such that t n = [[op 0 ]](t 0 , D). A policy P is consistent for D if there are no inconsistencies.2</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_7"><head>Algorithm 1 : 5 U 8 if ∇ ∈ S then 9 S ← S {∇} 10 else 11 Let</head><label>15891011</label><figDesc>PolicyRepairInput : CEDTD D = (Ele, Types, Rg, rt, µ), Policy P Output : set toRemove of UATs to remove to restore consistency of P 1 (T1, T2) ← DetectInconsistencies(D, P ) 2 toRemove ← ∅ 3 for A ∈ Types do 4 for B ∈ T1(A) do ← either (A, insert(B)) or (A, delete(B)) (choose randomly) 6 toRemove ← toRemove ∪ {U } 7 for S ∈ T2(A) do E be a randomly chosen element in S 12 S ← S {E} 13 for C ∈ S do 14 U ← either (A, insert(B)) or (A, delete(B)) (choose randomly) 15 toRemove ← toRemove ∪ {U } 16 S ← S {C} 17 return toRemove</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>sub-article → (front + front-stub), body? response → (front + front-stub), body? journal-meta → journal-id + , issn + , isbn * , publisher?, notes? article-meta → article-id * ,author + ,pub-date + , volume?, issue? sec → title?, (fig + p + list + tex-math) * , sub-sec * fig → object-id * , label?, caption?, graphic, (attrib + permissions) * list → label?, title?, list-item + sub-sec → title?, (address + fig + p + list + tex-math) *</figDesc><table><row><cell>Fig. 1. Journal Publishing Schema</cell></row><row><cell>&lt;article&gt;</cell></row><row><cell>&lt;front&gt;</cell></row><row><cell>&lt;journal-meta&gt;</cell></row><row><cell>&lt;journal-id&gt;BMJ&lt;/journal-id&gt;</cell></row><row><cell>&lt;issn&gt;0959-8138&lt;/issn&gt;</cell></row><row><cell>&lt;publisher&gt;BMJ&lt;/publisher&gt;</cell></row><row><cell>&lt;/journal-meta&gt;</cell></row><row><cell>&lt;article-meta&gt;</cell></row><row><cell>&lt;article-id&gt;jBMJ&lt;/article-id&gt;</cell></row><row><cell>&lt;article-id&gt;1508&lt;/article-id&gt;</cell></row><row><cell>&lt;author&gt;Freeman,George&lt;/author&gt;</cell></row><row><cell>&lt;pub-date&gt;13-4-2002&lt;/pub-date&gt;</cell></row><row><cell>&lt;volume&gt;324&lt;/volume&gt;</cell></row><row><cell>&lt;issue&gt;7342&lt;/issue&gt;</cell></row><row><cell>&lt;/article-meta&gt;</cell></row><row><cell>&lt;/front&gt;</cell></row><row><cell>&lt;sub-article&gt;</cell></row><row><cell>&lt;front-stub&gt;</cell></row><row><cell>&lt;journal-meta&gt;</cell></row><row><cell>&lt;journal-id&gt;SMN&lt;/journal-id&gt;</cell></row><row><cell>&lt;issn&gt;7225-4139&lt;/issn&gt;</cell></row><row><cell>&lt;publisher&gt;SMN&lt;/publisher&gt;</cell></row><row><cell>&lt;/journal-meta&gt;</cell></row><row><cell>&lt;/front-stub&gt;</cell></row><row><cell>&lt;/sub-article&gt;</cell></row><row><cell>&lt;/article&gt;</cell></row><row><cell>Fig. 2. Journal Publishing XML Document D0</cell></row></table><note>article → (front + front-stub), body?, (sub-article + response) * front → journal-meta, article-meta, notes? front-stub → journal-meta?, article-meta?, notes? body → (address + fig + p + list) * , sec *</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_2"><head></head><label></label><figDesc>an XOR factor in A}. Types B i and B j are alternates in A if both B i and B j belong to the same XOR factor in A. A types B i is independent in A if it does not belong to any XOR factor in A.</figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_3"><head></head><label></label><figDesc>Type 1: if B is independent in A, {(A, insert(B)), (A, delete(B))} ⊆ P and something is forbidden below B. Type 2: if B and C are alternates in A,{(A,insert(B)),(A,delete(B)),(A,insert(C)), (A, delete(C))} ⊆ P and something is forbidden below B or below C.</figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_4"><head>2</head><label></label><figDesc>Algorithm PolicyRepair, takes a policy P defined over a CEDTD D and returns a set of UATs to remove from P to restore consistency. The algorithm first calls Algorithm DetectInconsistencies that computes with the recursive Algorithm NodeInconsistency the inconsistencies of Type 1 and Type 2 and stores them in two functions T 1 and T 2 using depth-first search over schema D. Function T 1 : Types → 2 Types , returns for every type A the set of Types B such that {(A, insert(B)), (A, delete(B))} ⊆ P and something is forbidden below B. These inconsistencies are solved by either deleting (A, insert(B)) or (A, delete(B)) (lines 4-6 of Algorithm PolicyRepair). Function T 2 : Types → 2 2 Types , returns for every type A, a set of subsets of Types in such a way that if S ∈ T 2 (A), then every B ∈ S belongs to the same XOR factor below A and {(A, insert(B)), (A, delete(B))} ⊆ P and something is forbidden below B. Also, if ∇ ∈ S it means there is a type C in the same XOR factor such that {(A, insert(C)), (A, delete(C))} ⊆ P but everything is allowed below C. It is easy to check that in order to solve the inconsistencies of Type 2, for every S ∈ T 2 (A) we need to delete either (A, insert(B)) or (A, delete(B))</figDesc><table /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">Each element is defined using regular expressions. We assume that all the elements that are not defined correspond to text(#PCDATA).</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">|P | denotes the cardinality of set P</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Acknowledgements: This work is funded by FONDECYT grant 11080260 and CONICYT grant PSD-57. We would like to thank Irini Fundulaki and James Cheney for useful discussions.</p></div>
			</div>

			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Definition 5. Given a set of UATs U , the expanded version U ↑ is obtained from U using the following inference rules:</p><p>(A, delete(Bi)) ∈ U, (A, insert(Bj)) ∈ U, i = j, and Bi, Bj are independent in A (A, replace(Bi, Bj)) ∈ U ↑ (A, delete(Bi)) ∈ U , (A, insert(Bj)) ∈ U , i = j, and Bi, Bj are alternates in A</p><p>Given a schema D and a policy P , the set of extended valid UATs corresponds to valid(D) ↑ and the expanded policy to P ↑ . 2</p><p>This expanded policy can be used to check if an update is allowed or forbidden by a policy. </p><p>To solve the only inconsistency of Type 1, it chooses from either (A, insert(B)) or (A, delete(B)) and adds it to the toRemove set. Next, for sets in T 2 (A), it loads them into a variable S and checks if ∇ ∈ S. If such element is in the set, it means that there are cycles inside the XOR factor involving elements that do not have something forbidden below them. In this case, the algorithm erases ∇ from S. Then the algorithm proposes to add either (A, insert(F)) or (A, delete(F)) to the toRemove set. So, by choosing one UAT from each combination shown, and changing them from allowed to forbidden, consistency is restored. 2</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Secure and Selective Dissemination of XML Documents</title>
		<author>
			<persName><forename type="first">E</forename><surname>Bertino</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Ferrari</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM TISSEC</title>
		<imprint>
			<biblScope unit="volume">5</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="290" to="331" />
			<date type="published" when="2002">2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Repairing Inconsistent XML Write-Access Control Policies</title>
		<author>
			<persName><forename type="first">L</forename><surname>Bravo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Cheney</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Fundulaki</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">DBPL</title>
		<imprint>
			<biblScope unit="page" from="97" to="111" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">ACCOn: Checking Consistency of XML Write-Access Control Policies</title>
		<author>
			<persName><forename type="first">L</forename><surname>Bravo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Cheney</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Fundulaki</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">EDBT&apos;08</title>
				<imprint>
			<publisher>Demo</publisher>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Consistency and Repair for XML Write-Access Control Policies</title>
		<author>
			<persName><forename type="first">L</forename><surname>Bravo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Cheney</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Fundulaki</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Segovia</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">VLDB Journal. Accepted</title>
		<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">A Fine-grained Access Control System for XML Documents</title>
		<author>
			<persName><forename type="first">E</forename><surname>Damiani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">D C</forename><surname>Di Vimercati</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Paraboschi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Samarati</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM TISSEC</title>
		<imprint>
			<biblScope unit="volume">5</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="169" to="202" />
			<date type="published" when="2002">2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Secure XML Querying with Security Views</title>
		<author>
			<persName><forename type="first">W</forename><surname>Fan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">Y</forename><surname>Chan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Garofalakis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ACM SIGMOD</title>
				<imprint>
			<date type="published" when="2004">2004</date>
			<biblScope unit="page" from="587" to="598" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Specifying Access Control Policies for XML Documents with XPath</title>
		<author>
			<persName><forename type="first">I</forename><surname>Fundulaki</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Marx</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">SACMAT</title>
		<imprint>
			<biblScope unit="page" from="61" to="69" />
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Generalized XML Security Views</title>
		<author>
			<persName><forename type="first">G</forename><surname>Kuper</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Massacci</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Rassadko</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">SAC-MAT</title>
		<imprint>
			<biblScope unit="page" from="77" to="84" />
			<date type="published" when="2005">2005</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Expressiveness and Complexity of XML Schema</title>
		<author>
			<persName><forename type="first">W</forename><surname>Martens</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Neven</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Schwentick</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">J</forename><surname>Bex</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Trans. Database Syst</title>
		<imprint>
			<biblScope unit="volume">31</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="770" to="813" />
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">XML Access Control Using Static Analysis</title>
		<author>
			<persName><forename type="first">M</forename><surname>Murata</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Tozawa</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Kudo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Hada</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM TISSEC</title>
		<imprint>
			<biblScope unit="volume">9</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="290" to="331" />
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">DTDs versus XML Schema: A Practical Study</title>
		<author>
			<persName><forename type="first">J</forename><surname>Van Den Bussche</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Neven</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">J</forename><surname>Bex</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">WebDB&apos;04</title>
				<meeting><address><addrLine>Paris, France</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
