the security view, where a security view is based on
the user view DTD and a function defined via XPath
queries. In (Mandhani and Suciu, 2005), Mandhani
and Suciu proposed a novel technique to cache XPath
views for XML. An algorithm was designed to deter-
mine whether a view can answer a new query. When
it does, a composing query will be computed and ap-
plied to the result of the view to answer the new query.
3 SYSTEM ARCHITECTURE
The SQS system uses a multi-level access control
model. The security levels are specified using non-
negative integers. The access control rule is simple,
yet robust, which requires that the security level of the
query should be no less than that of the data in order
to be granted access. The access control specifications
are defined at the document level. In the XML docu-
ments, attribute
SecurityLevel
is added to each el-
ement to indicate its security level. In an XML tree,
the security level is only allowed to increase mono-
tonically from the root to a leaf, which means that no
element has a higher security level than any of its de-
scendants. The system requires that the security level
of each node should be annotated. Although this will
bring the needs for additional space and extra work by
the document owner, it would be acceptable if secure
query evaluations can be improved.
We choose to use XPath query language to navi-
gate down the XML tree and retrieve data. The system
recognizes the XPath queries defined by the following
grammar:
p ::= e | p / p | p // p | p [ q ]
∗
(1)
e is an element name, and predicate q can be equali-
ties, comparisons, or paths.
schema
...
data
query engine
query shredder cache
query
result
Figure 1: The SQS system architecture.
Figure 1 illustrates the architecture of the system. At
first, a new query Q is parsed by the query shredder.
Then, the cache will be looked up to check whether
there is a cached view V that answers the query. If
a cache hit, a composing query C is computed based
on Q and V, then C is evaluated on the result of V by
the query engine; if a cache miss, Q is rewritten into
a secure query Q
0
. Then Q
0
is sent to the query engine
and evaluated on the XML document.
4 METHODS
4.1 Query Rewriting
For a non-secure XPath query Q issued by a user at se-
curity level n, we rewrite it into a secure one by adding
a predicate
[@SecurityLevel <=
n
]
to each node in
Q. However, since in our access control model, the
security level increases monotonically along a path,
we may only need to add the above predicate to each
node appearing after the last axis in the XPath query.
In the system, if the original user query cannot be
answered using the cached views, it will be rewritten
as above and sent to the query engine; if a cached view
can answer the query, the composing query is then
rewritten and evaluated on the cached query result.
4.2 Cache Structure
In the system, a cache is used to store materialized
views and their security information. The cache is
maintained using RDBMS. We selectively adopt the
cache tables in (Mandhani and Suciu, 2005). We also
add columns to indicate query security level, result in-
formation, as well as auxiliary query information that
is used for cache replacement. Therefore, the cache of
the SQS system consists of the following two tables:
• View(viewID, prefix, predicate, all-predicates,
comparison-tags, query-security-level, result-
flag, usage-count, timestamp)
• XMLData(viewID, data)
The columns viewID, prefix, predicate, all-predicates,
comparison-tags provide the same information as in
(Mandhani and Suciu, 2005). Query-security-level
stores an integer which is the security level of the
query issuer. Result-flag is TRUE or FALSE, which
is an indicator of whether there is non-empty result
associated with the view. Usage-count records the
number of times that this view has been used to an-
swer new queries. Timestamp indicates the time when
the view is last used.
4.3 Cache Lookup
To process a query, we need to find a view in the
cache that not only answers the query, but also com-
plies with the access control rules. Note that there
might be a few views in the cache that satisfy the two
constraints. To select the best cached view to answer
query Q at security level S, we develop the following
algorithm based on (Mandhani and Suciu, 2005):
ICEIS 2008 - International Conference on Enterprise Information Systems
414