12.01.2015 Views

Download - Academy Publisher

Download - Academy Publisher

Download - Academy Publisher

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

under the endorsement of both the manager () and<br />

accountant () operations. We encode this policy using<br />

AspectJ language. The code is shown in Fig. 1.<br />

bool pm = false;<br />

aspect Cr<br />

bool pa = false;<br />

{ Pointcut c()}:<br />

……<br />

call (* critical())<br />

manager();<br />

&&target(P);<br />

if(…) { accountant(); } before c()<br />

critical();<br />

if (pm ∧ pa)<br />

{ pm = false; pa = false; }<br />

else throw IRMException();<br />

(a) Base Code<br />

}<br />

aspect Ma<br />

aspect Ac<br />

{ Pointcut m()}:<br />

{ Pointcut a()}:<br />

call (* manager())<br />

call (* accountant())<br />

&&target(P);<br />

&&target(P);<br />

After m() { pm = true;} After a() { pa = true;}<br />

}<br />

}<br />

Figure 1. base code and aspect of example 1<br />

The base code in block (a) is the primary program. It<br />

defines two global variables, pa and pm, and executes<br />

three security-related functions: accountant(), manager()<br />

and critical(). According to the policy, critical() can be<br />

executed only after both accountant() and manager()<br />

have been executed. To execute this policy, we create<br />

three aspects. First, aspect Ma defines Pointcut m, which<br />

is located at the function manager(). The type of advice is<br />

After. Thus, the action defined by aspect Ma is that after<br />

manager() has finished, the variable pm is set to “true”.<br />

Next, aspect Ac is defined similarly to aspect Ma, but sets<br />

pa to true after accountant() has finished. Finally, aspect<br />

Cr defines Pointcut c() at the function critical(). The type<br />

of advice is Before, so the actions defined by aspect Cr<br />

take place before the execution of critical(). The code<br />

fragment evaluates pa and pm; if both are true, it executes<br />

the critical() function and sets pa and pm to false.<br />

Otherwise, it throws an exception.<br />

At compilation, the aspect weaver incorporates all<br />

three aspects into the base code to produce a AOSM.<br />

Figure 2 displays the code for the resulting program.<br />

……<br />

manager();<br />

pm = true;<br />

if(…) {accountant();<br />

pa = true;}<br />

if (pm ∧ pa)<br />

{ pm = false; pa = false;<br />

critical();}<br />

else throw new IRMException();<br />

Figure 2. Policy-adherence program after Aspect weaving<br />

III. CORRECT VERIFICATION MODEL FOR<br />

AOSM PROGRAM<br />

Based on the characteristics of AOSM programs, we<br />

construct a verification model to verify the correct<br />

property of monitor inlined programs.<br />

A. Abstract structure<br />

Alternating-Time Temporal Logic (ATL) and<br />

Alternating Transition System (ATS) [7, 8] are logical<br />

specification tools for open system. We specify an<br />

AOSM program as a Turn-Based Alternating Transition<br />

System (Turn-based ATS). The concrete definition given<br />

as follows:<br />

Definition 3.1 An AOSM program structure (AOSM<br />

structure ) can be abstracted as a Turn-based ATS.<br />

Expressed as tuple AOSM Structure=<br />

with the follow components:<br />

1. ∑ is a set of players, which includes system<br />

components Aspect and BaseCode, as well as<br />

Environment.<br />

2. Q is a finite set of state;<br />

3. ∏ is a finite set of proposition;<br />

4. Function π :Q→2∏ is a labeling function, which<br />

maps each state q∈Q to a set π (q) ⊆ ∏. π (q) is<br />

the set of propositions true at state q.<br />

5. Function σ: Q→ ∑ map a state q to a player aq.<br />

Representing that at state q, it is the turn of player aq<br />

to choose the next execution steps of program. Nature<br />

number da(q)≥1 is moves available at state q for<br />

player a. We identify the moves of player a at state q<br />

with the numbers 1,……,da(q). For each state q∈Q, a<br />

move vector at q is a tuple < j1; : : : ; jk> such that 1<br />

≤ja≤da(q) for each player a. For other players b∈∑\<br />

aq at state q, db(q)=1;<br />

6. δ(q, J a ) is a transition function. When a q choose<br />

action j a , the state will transit to next state q`=δ(q, J a )<br />

∈Q.<br />

B. Defination of correct property<br />

We now describe soundness and transparency<br />

properties in ATL formulas in this section. So it needs to<br />

interpret the syntax of ATL at first:<br />

Definition 3.2 An ATL formula is one of the following:<br />

1. Proposition p,P∈∏;<br />

2. ¬ ϕ or ϕ 1∨ϕ 2, where ϕ 、ϕ 1、ϕ 2 are ATL<br />

formulas;<br />

3. ○ ϕ , or □ ϕ , or ◇ ϕ , or<br />

ϕ 1 uϕ 2 are ATL formulas, where A ⊆ ∑is<br />

a set of players, and ϕ 、 ϕ 1 and ϕ 2 are ATL<br />

formulas.<br />

The operator is path quantifier, and ○(“next”),<br />

□(“always”), ◇ (“eventually”), and U (“until”) are<br />

temporal operators. represent path chosen by<br />

players in set A. Quantifieralso has a dual form<br />

〖〗. While formalsϕ means that the players in<br />

A can cooperate to make the ϕ true, the dual form<br />

〖A〗ϕ means that the players in A can not cooperate<br />

to make the ϕ false.<br />

Based on above definitions of ATL, we now<br />

formulate the correct property of self-monitoring program<br />

on AOSM structure.<br />

Definition 3.3 (Soundness) Soundness means that the<br />

self-monitoring program should adhere to the intended<br />

policy. That is to say, on an AOSM structure, all the path<br />

decided by the strategies of players Aspect and BaseCode<br />

should satisfy the charactersϕ of policy, no matter how<br />

121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!