<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Solution to Change Security Policies on-the-fly</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ricardo Ferraz Tomaz</string-name>
          <email>Ricardo.Ferraz-Tomaz@malix.univ-paris1.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M. Mehdi Ben Hmida</string-name>
          <email>Benhmida.mehdi@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valérie Monfort</string-name>
          <email>valerie.Monfort@malix.univ-paris1.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Université Paris 1 - Panthéon - Sorbonne Centre de Recherche en Informatique</institution>
          ,
          <addr-line>90 rue de Tolbiac 75634 Paris cedex 13</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Université Paris IX Dauphine LAMSADE Place du Maréchal de Lattre Tassigny</institution>
          ,
          <addr-line>Paris Cedex 16</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Although Web Services are not the only way to design the Service paradigm, they are likely to be one of the major technologies used to achieve both the interoperability and loose coupling required for Service Oriented Architecture (SOA). However, there is still much to be done in order to get a genuinely flawless Web Service. Our research work consists on finding new service based solutions to increase flexibility and adaptability to SOAbased applications. In this paper we introduce an engine named Aspect Service Weaver (ASW) that enables to weave and un-weave new behavior (such as security) to a SOAbased application at runtime. We explain our approach through a concrete scenario where we replace an existing Kerberos policy for a Digital Certificate policy.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Service-Oriented Architecture (SOA) is an
architectural style whose goal is to achieve loose
coupling among interacting software entities in order
to facilitate the integration of software components
into distributed applications.</p>
      <p>SOA-based applications are usually composed of
simple Web Services that are offered by different
providers. This scenario gets worse because services
are, usually, shared by multiple applications. Each
application has its own requirements that can demand
specialization of a service behavior. If the
specialization is performed by modifying the service,
then the change may conflict with the requirements of
other application.</p>
      <p>So, the services providers have a serious problem
to change their Web Services behaviors, because a
simple changing can affect many applications.</p>
      <p>To solve this problem the system administrators
must be able to selectively apply different
specializations to the same service depending on the
caller or other environmental condition.</p>
      <p>Usually, security policies vary depending on the
nature of the environment - internal or external
network - and the nature of the application – e.g.
financial applications require high security level.</p>
      <p>Enterprise security policies can be changed
depending on the types of data and applications that
need to be accessed by various parties. Policy must
be set for internal departments and users, extranet
partners, remote-access users and customers.</p>
      <p>In addition, new security policies are proposed
overtime and the systems administrators may, simply,
want to change their security policies to be up-to-date
with technology innovations. Tearing down a
service for reconfiguration is often undesirable.</p>
      <p>In order to solve this problem, we propose an
engine named Aspect Service Weaver (ASW). The
ASW enables to weave and un-weave new behaviors
to a service at runtime without affecting the other
applications that share the service.</p>
      <p>
        Our approach is based on Aspect Oriented
Programming (AOP) [
        <xref ref-type="bibr" rid="ref1 ref3">1,2</xref>
        ]. The ASW interposes
itself between the client caller and the service callee
and uses the AOP weaving time (before or after the
service invocation) to insert new behaviors to the
original web service.
      </p>
      <p>In this paper we present a concrete scenario where
our approach can be used to change the security
policy of a service-based system at runtime without
side effect for the other applications that share the
service.</p>
      <p>In the next section, we present the basic ideas
behind AOP. The section 3 presents our approach and
its applicability to a concrete case study. The section
4 draws some conclusions.
AOP is about structure and problem decomposition.
More specifically, AOP is about separation of
concerns. Aspect Oriented Software Development
(AOSD) advocates the separation of concerns and
their implementation in separated modules or
components that are, posteriorly, woven to compose
an application.</p>
      <p>According to AOSD, the problem should be
decomposed into modules such that each module has
one concern. However, some concerns cannot be
easily separated, and we are forced to map such
concerns over many modules. This is called
crosscutting. A crosscutting concern is a serious
problem since it is harder to understand, reuse,
extend, adapt and maintain the concern because it is
spread over several places.</p>
      <p>AOP allows encapsulating the crosscutting code
into separate module - known as advices - and then
applying the code where it is needed. We achieve
application of the crosscutting code by defining
specific places - known as join point - in our object
model. The Crosscutting code is injected at the
specified join point by a tool named weaver. Another
important concept in AOP is the pointcut. A pointcut
is a set of join points that enables the weaver to inject
an advice in several places. The weaver inserts the
advices “before”, “after” or “around” the join points.</p>
    </sec>
    <sec id="sec-2">
      <title>3. Aspect Service Weaver (ASW)</title>
      <sec id="sec-2-1">
        <title>3.1Overview</title>
        <p>
          The ASW intercepts the SOAP (Simple Object
Access Protocol) [
          <xref ref-type="bibr" rid="ref4">3</xref>
          ] messages between the Web
Services that compose a Service based application,
and then redirects these messages for other Web
Services (Aspect Services) that performs the new
requirements.
        </p>
        <p>We use the AOP weaving time to intercept and
redirect the messages. The ASW intercepts a
message “before” or “after” an Original Web Service
invocation and then redirects the SOAP message for
the appropriated Aspect Service (in charge of
implementing the new behavior).</p>
        <p>Our platform infrastructure is based on an XML
language to register and deploy (XML file descriptor)
both Original Web Services and Aspects Services.
The engine invokes the Aspects Services at runtime
to change the original Web Service behavior.</p>
        <p>
          The ASW architecture is composed by two
engines: XQuery Engine [
          <xref ref-type="bibr" rid="ref6">5</xref>
          ] and XQuery Module
Generator (XMG).
        </p>
        <p>
          The XQuery Engine can be anyone ready-to-use
tool equipped with a transport layer to generate
http/SOAP messages such as XQuery Stylus Studio
[
          <xref ref-type="bibr" rid="ref7">6</xref>
          ], TigerLogic [
          <xref ref-type="bibr" rid="ref8">7</xref>
          ] and Liquid Data [
          <xref ref-type="bibr" rid="ref9">8</xref>
          ]. So, we can
use any off-the-shelf software component.
        </p>
        <p>The XMG receives as input the XML file
descriptor and the WSDL file (to obtain the Original
Method and Service Advice signatures) and then
translates them to an XQuery script. Finally, the
XQuery script is submitted to the XQuery engine that
generates the http/SOAP messages to the
appropriated Services Advices.</p>
        <p>
          Since the file descriptor and the WSDL file are
both XML documents, XPath [
          <xref ref-type="bibr" rid="ref5">4</xref>
          ] is the natural choice
as the pointcut language. In an Aspect described in
the XML file descriptor, the pointcut element is an
XPath Expression selecting all Original Web Service
methods where the execution of new crosscutting
behavior will be introduced.
        </p>
        <p>Let us now explain the ASW through a more
realistic scenario taken from one of our industrial
projects.</p>
      </sec>
      <sec id="sec-2-2">
        <title>3.2 Concrete Scenario</title>
        <p>A company aims to develop automatons to analyze
blood plasma, which means patient data information
has to be highly reliable and correct. In order to
support consequent evolution and successive reuse of
the machines, the company decided to define and to
promote a flexible and adaptable architecture
according to the new emerging requirements. We
decided to use Web Services technology to
implement this architecture.</p>
        <p>The Application must display specific Human
Machine Interface (HMI) according to profile and
maturity level of the user. Access is allowed or
denied according to user profile and protected from
unauthenticated usage.</p>
        <p>Consider the hypothetical scenario where an
original Web Service has an authentication policy
like Kerberos token and, that after a while, the
company resolves to replace this authentication
policy for a digital certificate security policy.</p>
        <p>Using a classical approach, considering that a
change is required in the authentication method
signature, the programmer must identify all
authenticated methods and rewrite the authentication
invocation.</p>
        <p>Using the ASW engine, the programmer can, for
instance, develop a Service Advice called
digital_certificate and specify, on the XML file
descriptor, that before the invocation of the
authenticated methods in the Original Web Service
the engine must invoke the Service advice
digital_certificate.</p>
        <p>This way, on the next Original Web Service
invocation the engine will be aware of the rules
specified on the XML file descriptor and will
generate an http/SOAP invocation to the
digital_certificate Advice instead of to the Kerberos
method in order to authenticate the user based on the
new policy. The authentication policy is a Service
Advice woven at run-time.</p>
        <p>The XML file descriptor that contains the Aspects
rules interactions with the Original Web Services for
the above described example would be like this:
&lt;Aspect name=" analyze_blood_ plasma "&gt;
&lt;pointcut name="analyze" pattern=
"//operation[starts-with(@name," SendResult")]"/&gt;
&lt;Advice name="security" type="before"&gt;
&lt;pointcutName name=" analyze" /&gt;
&lt;content urn="urn_wsdl_service1"
invoke="digital_certificate" status="true"/&gt;
&lt;/Advice&gt;
&lt;/Aspect&gt;</p>
        <p>This XML file descriptor indicates to the engine
that always the methods that match with the XPath
expression
"//operation[startswith(@name,"SendResult")]"(equivalent to the
methods whose names match the regular expression
"SendResult*") were invoked the engine must invoke
before the Service Advice digital_certificate. The
Original method invocation is conditioned to the
answer got from digital_certificate Service Advice.
Only if the authentication is succeeded (status is true)
the SendResult method must be invoked. Based on
this XML file descriptor the engine must generate the
following XQuery script:
1. import service namespace Service1 = "urn:
urn_wsdl_service1" name "digital_certificate";
2. import service namespace Service2 = "urn:
urn_wsdl_service2 " name “SendResult";
3 let $i Service1: digital_certificate(UserId, Passwd);
4. if $i/status=true then
5 let $j:= Service2:SendResult(PatientID);</p>
        <p>Figure 2. Generated XQuery Module output</p>
        <p>Depending on a well defined set of rules the
engine can generate complex interactions among
Original Web Services methods and Services
Advices. But, the mechanism to accomplish the
interactions is relatively simple</p>
        <p>When a client invokes an original method, the
engine intercepts the http/SOAP request and captures
the original method signature, and then the engine
tries to match the method signature with an entry in
the XML file descriptor. After this step, if there is
one or more matching, the engine performs the
interactions schemas according to the kind of advices
found in the XML file descriptor.</p>
        <p>For example, whenever a ”before” advice is
detected the engine extracts the Service Advice
signature and redirects the request to the proper
Service Advice before the request reaches the
original method. Then, it captures the Service Advice
answer and, if the Service Advice answer is positive
(the user was successfully authenticated), it sends the
answer to the original method. The original method
performs its task and sends back the answer to the
engine. Finally, the engine dispatches the final
answer to the client caller.</p>
        <p>The interactions performed when an ”after” or a
”replace” advice is detected fit to similar logic. Only
the invocation sequence is changed.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Conclusion</title>
      <p>
        This paper presents how to apply AOP paradigm to
improve Web Services flexibility. There are many
ongoing works in this direction, but we highlight the
AO4BPEL [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] due to its similarity with our approach.
      </p>
      <p>AO4BPEL is an aspect-oriented extension to
BPEL4WS (Business Process Execution Language
for Web Services) that allows the registration and
deployment of both processes and aspects. Aspects
can be deployed dynamically at runtime whilst BPEL
processes are running.</p>
      <p>The AO4BPEL authors suggest extending
BPEL4WS standard. Conversely, no changes on the
already existent Web Services standards are required
to use our engine.</p>
    </sec>
    <sec id="sec-4">
      <title>5. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Anis</given-names>
            <surname>Charfi</surname>
          </string-name>
          and
          <string-name>
            <given-names>Mira</given-names>
            <surname>Mezini</surname>
          </string-name>
          .
          <article-title>Aspect-oriented web service composition with AO4BPELl</article-title>
          .
          <source>In ECOWS</source>
          , volume
          <volume>3250</volume>
          <source>of LNCS</source>
          , pages
          <volume>168</volume>
          ,
          <fpage>182</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Springer</surname>
          </string-name>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [2 ]
          <string-name>
            <surname>Tomaz</surname>
            , Ricardo Ferraz; Hamida, Mehdi Ben; Monfort,
            <given-names>Valerie.</given-names>
          </string-name>
          <article-title>Concrete Solutions for WEB Services Adaptability Using Policies and Aspects</article-title>
          .
          <source>IEEE Journal Of Digital Information Management</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <source>[3 ] SOAP Version 1</source>
          .2,
          <issue>W3C</issue>
          specification, Web site http ://www.w3.org/TR/ soap/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>XML</given-names>
            <surname>Path</surname>
          </string-name>
          <article-title>Language (XPath), W3C specification, www</article-title>
          .w3.org/TR/xpath.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Onose</given-names>
            <surname>Nicola</surname>
          </string-name>
          and
          <string-name>
            <given-names>Simeone</given-names>
            <surname>Jerome</surname>
          </string-name>
          .
          <article-title>XQuery at Your Web Service</article-title>
          .
          <source>In Proceedings International WWW Conference</source>
          , New York, USA,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Data</given-names>
            <surname>Direct</surname>
          </string-name>
          <string-name>
            <surname>Technology</surname>
          </string-name>
          , Web site available at http ://www.stylusstudio.com.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>[7] RainingData, Web site available at http ://www.rainingdata.com.</mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [8]
          <string-name>
            <surname>BEA</surname>
          </string-name>
          , Web site available at http ://www.bea.com.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>