• Non ci sono risultati.

Secure multiparty sessions with topics

N/A
N/A
Protected

Academic year: 2022

Condividi "Secure multiparty sessions with topics"

Copied!
44
0
0

Testo completo

(1)

Introduction Safe sessions Types with topics Results Conclusion

Secure multiparty sessions with topics

Ilaria Castellani, Mariangiola Dezani-Ciancaglini, Ugo de’Liguoro

INRIA Sophia Antipolis, University of Turin

PLACES - Eindhoven, April 2016

1/20

(2)

Introduction Safe sessions Types with topics Results Conclusion

Motivation and goal

control flow based security analysis relies onsecurity levelsand level drop detection to discover information leaks

in case of multiparty communication this leads to unreasonable restrictions

previous work where multiparty sessions have been endowed with security levels and type systems enforcing leak-free communication, suffers from similar restrictions

here we add a further dimension, calledtopics, to relax these restrictions, and show that this can be ensured via a type system

2/20

(3)

Introduction Safe sessions Types with topics Results Conclusion

Motivation and goal

control flow based security analysis relies onsecurity levelsand level drop detection to discover information leaks

in case of multiparty communication this leads to unreasonable restrictions

previous work where multiparty sessions have been endowed with security levels and type systems enforcing leak-free communication, suffers from similar restrictions

here we add a further dimension, calledtopics, to relax these restrictions, and show that this can be ensured via a type system

2/20

(4)

Introduction Safe sessions Types with topics Results Conclusion

Motivation and goal

control flow based security analysis relies onsecurity levelsand level drop detection to discover information leaks

in case of multiparty communication this leads to unreasonable restrictions

previous work where multiparty sessions have been endowed with security levels and type systems enforcing leak-free communication, suffers from similar restrictions

here we add a further dimension, calledtopics, to relax these restrictions, and show that this can be ensured via a type system

2/20

(5)

Introduction Safe sessions Types with topics Results Conclusion

Motivation and goal

control flow based security analysis relies onsecurity levelsand level drop detection to discover information leaks

in case of multiparty communication this leads to unreasonable restrictions

previous work where multiparty sessions have been endowed with security levels and type systems enforcing leak-free communication, suffers from similar restrictions

here we add a further dimension, calledtopics, to relax these restrictions, and show that this can be ensured via a type system

2/20

(6)

Introduction Safe sessions Types with topics Results Conclusion

Motivation and goal

control flow based security analysis relies onsecurity levelsand level drop detection to discover information leaks

in case of multiparty communication this leads to unreasonable restrictions

previous work where multiparty sessions have been endowed with security levels and type systems enforcing leak-free communication, suffers from similar restrictions

here we add a further dimension, calledtopics, to relax these restrictions, and show that this can be ensured via a type system

2/20

(7)

Introduction Safe sessions Types with topics Results Conclusion

Secure information flow

Let (L, v) be the lattice of security levels:

` v `0⇔ ` is less confidential than `0

⊥ = public, > = secret. Aleakis an information flow

¡ ¡ ¡ v`¡ ¡ ¡ u`0¡ ¡ ¡ where ` 6v `0 and

v`is sent from a participantpto a participantqandqis either the sender or the receiver of u`0

3/20

(8)

Introduction Safe sessions Types with topics Results Conclusion

Secure information flow

Let (L, v) be the lattice of security levels:

` v `0⇔ ` is less confidential than `0

⊥ = public, > = secret.

Aleakis an information flow

¡ ¡ ¡ v`¡ ¡ ¡ u`0¡ ¡ ¡ where ` 6v `0 and

v`is sent from a participantpto a participantqandqis either the sender or the receiver of u`0

3/20

(9)

Introduction Safe sessions Types with topics Results Conclusion

Secure information flow

Let (L, v) be the lattice of security levels:

` v `0⇔ ` is less confidential than `0

⊥ = public, > = secret.

Aleakis an information flow

¡ ¡ ¡ v`¡ ¡ ¡ u`0¡ ¡ ¡ where ` 6v `0 and

v`is sent from a participantpto a participantqandqis either the sender or the receiver of u`0

3/20

(10)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(11)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1

sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(12)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(13)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment

standard information flow security

7

information flow security with topics

3

4/20

(14)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(15)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(16)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(17)

Introduction Safe sessions Types with topics Results Conclusion

Motivating example

Alice as PC member:

receives the opinion of Bob on paper 1 sends her judgment on paper 2 to Charlie

the level of Bob opinion is not smaller than the level of Alice judgment standard information flow security

7

information flow security with topics

3

4/20

(18)

Introduction Safe sessions Types with topics Results Conclusion

Safety with topics

A leak is an information flow

¡ ¡ ¡ v`¡ ¡ ¡ u`0¡ ¡ ¡ where ` 6v `0

Addingtopicsa leak is

· · · v`,ϕ· · · u`0,ψ· · · where ` 6v `0 and ϕ, ψ are correlated

5/20

(19)

Introduction Safe sessions Types with topics Results Conclusion

Access control and leak freedom w.r.t. topics

Access control (AC):for each participant p and topic ϕ:

participant p is able to receive v`,ϕ if ` v ρ(p, ϕ) (reading level)

Leak freedom (LF):a session is leak free if for each participant p whenever p receives v`,ϕ, she just sends values u`0,ψ s.t.

` v `0 or ϕj ψ where ϕb ψ if ϕ and ψ are independent topics.

6/20

(20)

Introduction Safe sessions Types with topics Results Conclusion

Access control and leak freedom w.r.t. topics

Access control (AC):for each participant p and topic ϕ:

participant p is able to receive v`,ϕ if ` v ρ(p, ϕ) (reading level)

Leak freedom (LF):a session is leak free if for each participant p whenever p receives v`,ϕ, she just sends values u`0,ψ s.t.

` v `0 or ϕj ψ where ϕb ψ if ϕ and ψ are independent topics.

6/20

(21)

Introduction Safe sessions Types with topics Results Conclusion

Access control and leak freedom w.r.t. topics

Access control (AC):for each participant p and topic ϕ:

participant p is able to receive v`,ϕ if ` v ρ(p, ϕ) (reading level)

Leak freedom (LF):a session is leak free if for each participant p whenever p receives v`,ϕ, she just sends values u`0,ψ s.t.

` v `0 or ϕj ψ where ϕb ψ if ϕ and ψ are independent topics.

6/20

(22)

Introduction Safe sessions Types with topics Results Conclusion

A multiparty session calculus

Expressions:

e ::= x || v`,ϕ || op(e1, . . . , en) Processes:

P ::= q!λ(e).P || p?λ(x ).Q || P ⊕ P || P + P || µX .P || X || 0

Multiparty sessions:

M ::= p1/ P1 | . . . | pn/ Pn

Operational semantics:

P q!Îť(v

`,ϕ)

−−−−−→ P0 Q p?λ(v

`,ϕ)

−−−−−−→ Q0 p / P | q / Q p(λ,v

`,ϕ)q

−−−−−−→ p / P0 | q / Q0

7/20

(23)

Introduction Safe sessions Types with topics Results Conclusion

Safe sessions

Definition

A multiparty session M is safe if it satisfies:

Access control (AC):

whenever σ · p(λ, v`,ϕ)q is a trace of M, then ` v ρ(q, ϕ);

Leak freedom (LF):

whenever σ · p(λ, v`,ϕ)q · σ0· q(λ0, u`0,ψ)r is a relay trace of M, then either ` v `0 or ϕb ψ.

where σ · p(λ, v`,ϕ)q · σ0· q(λ0, u`0,ψ)r is a relay trace from p to r mediated by q.

8/20

(24)

Introduction Safe sessions Types with topics Results Conclusion

Examples

A trace of a safe session (that was not such in past systems)

Bob (evaluation,”reject”`1, paper 1) Alice Alice (evaluation,”accept”`2, paper 2) Charlie

`1is not smaller than `2

paper 1 and paper 2 are independent

9/20

(25)

Introduction Safe sessions Types with topics Results Conclusion

Examples

A trace of a safe session (that was not such in past systems)

Bob (evaluation,”reject”`1, paper 1) Alice

Alice (evaluation,”accept”`2, paper 2) Charlie

`1is not smaller than `2

paper 1 and paper 2 are independent

9/20

(26)

Introduction Safe sessions Types with topics Results Conclusion

Examples

A trace of a safe session (that was not such in past systems)

Bob (evaluation,”reject”`1, paper 1) Alice Alice (evaluation,”accept”`2, paper 2) Charlie

`1is not smaller than `2

paper 1 and paper 2 are independent

9/20

(27)

Introduction Safe sessions Types with topics Results Conclusion

Examples

A trace of a safe session (that was not such in past systems)

Bob (evaluation,”reject”`1, paper 1) Alice Alice (evaluation,”accept”`2, paper 2) Charlie

`1is not smaller than `2

paper 1 and paper 2 are independent

9/20

(28)

Introduction Safe sessions Types with topics Results Conclusion

Examples

A trace of a safe session (that was not such in past systems)

Bob (evaluation,”reject”`1, paper 1) Alice Alice (evaluation,”accept”`2, paper 2) Charlie

`1is not smaller than `2

paper 1 and paper 2 are independent

9/20

(29)

Introduction Safe sessions Types with topics Results Conclusion

Types

Sorts:

S ::= nat || int || bool || string Global types:

G ::= p → q : {λi(Si`i,ϕi).Gi}i ∈I || µt.G || t || end Session types:

T ::=_

i ∈I

q!λi(Si`i,ϕi).Ti || ^

i ∈I

p?λi(Si`i,ϕi).Ti || µt.T || t || end

10/20

(30)

Introduction Safe sessions Types with topics Results Conclusion

Level, topic agreement with a type

h`, ϕiagreeswith T , h`, ϕi ≺ T , if according to T only values of level

`0w ` are sent on topics related with ϕ

h`, ϕi ≺ T is co-inductively defined by h`, ϕi ≺ end

if h`, ϕi ≺ Ti for all i ∈ I then h`, ϕi ≺^

i ∈I

p?λi(Si`i,ϕi).Ti

if h`, ϕi ≺ Ti and either ` v `0i or ϕb ψi for all i ∈ I then h`, ϕi ≺_

i ∈I

q!Νi(S`0i,ψi).Ti

11/20

(31)

Introduction Safe sessions Types with topics Results Conclusion

Level, topic agreement with a type

h`, ϕiagreeswith T , h`, ϕi ≺ T , if according to T only values of level

`0w ` are sent on topics related with ϕ h`, ϕi ≺ T is co-inductively defined by

h`, ϕi ≺ end

if h`, ϕi ≺ Ti for all i ∈ I then h`, ϕi ≺^

i ∈I

p?λi(Si`i,ϕi).Ti

if h`, ϕi ≺ Ti and either ` v `0i or ϕb ψi for all i ∈ I then h`, ϕi ≺_

i ∈I

q!Νi(S`0i,ψi).Ti

11/20

(32)

Introduction Safe sessions Types with topics Results Conclusion

Safe session types

Type T issafeif

1 all input continuations are safe and agreed by the respective participant, topic pairs,

2 all output continuations are safe and outputs are sent to participants with the proper reading level

Coinductively end is safe

if h`i, ϕii ≺ Ti and Ti is safe for all i ∈ I then

^

i ∈I

p?λi(Si`i,ϕi).Ti is safe if `iv ρ(q, ϕi) and Ti is safe for all i ∈ I then

_

i ∈I

q!λi(Si`i,ϕi).Ti

12/20

(33)

Introduction Safe sessions Types with topics Results Conclusion

Safe session types

Type T issafeif

1 all input continuations are safe and agreed by the respective participant, topic pairs,

2 all output continuations are safe and outputs are sent to participants with the proper reading level

Coinductively end is safe

if h`i, ϕii ≺ Ti and Ti is safe for all i ∈ I then

^

i ∈I

p?λi(Si`i,ϕi).Ti is safe if `iv ρ(q, ϕi) and Ti is safe for all i ∈ I then

_

i ∈I

q!λi(Si`i,ϕi).Ti

12/20

(34)

Introduction Safe sessions Types with topics Results Conclusion

Session type system

Type rules:

Γ ` e : S`,ϕ Γ ` P I T Γ ` q!λ(e).P I q!λ(S`,ϕ).T

Γ, x : S`,ϕ` Q I T Γ ` p?λ(x ).Q I p?λ(S`,ϕ).T Γ ` P1I T1 Γ ` P2I T2

Γ ` P1⊕ P2I T1∨ T2

Γ ` P1I T1 Γ ` P2I T2 Γ ` P1+ P2I T1∧ T2

Γ ` P I T is asafe typing if all types in the derivation are safe.

Example: if ρ(p, ϕ) = > and ϕb ψ we can derive

` p?λ(x).r!λ0(false⊥,ψ).0 I p?λ(bool>,ϕ).r!λ0(bool⊥,ψ).end

13/20

(35)

Introduction Safe sessions Types with topics Results Conclusion

Session type system

Type rules:

Γ ` e : S`,ϕ Γ ` P I T Γ ` q!λ(e).P I q!λ(S`,ϕ).T

Γ, x : S`,ϕ` Q I T Γ ` p?λ(x ).Q I p?λ(S`,ϕ).T Γ ` P1I T1 Γ ` P2I T2

Γ ` P1⊕ P2I T1∨ T2

Γ ` P1I T1 Γ ` P2I T2 Γ ` P1+ P2I T1∧ T2

Γ ` P I T is asafe typing if all types in the derivation are safe.

Example: if ρ(p, ϕ) = > and ϕb ψ we can derive

` p?λ(x).r!λ0(false⊥,ψ).0 I p?λ(bool>,ϕ).r!λ0(bool⊥,ψ).end

13/20

(36)

Introduction Safe sessions Types with topics Results Conclusion

Subtyping

Subtyping of safe types, T ≤ T0, is co-inductively defined by end ≤ end

if Ti≤ Ti0 for all i ∈ I ⊇ J then

^

i ∈I

p?λi(Si`i,ϕi).Ti 6^

j ∈J

p?λj(Sj`j,ϕj).Tj0

if Ti≤ Ti0 for all i ∈ I ⊆ J then _

i ∈I

p!λi(Si`i,ϕi).Ti 6_

j ∈J

p!λj(Sj`j,ϕj).Tj0

14/20

(37)

Introduction Safe sessions Types with topics Results Conclusion

Global type system

Let’s take from [Honda-Yoshida-Carbone 2008]:

pt{G } is the set of participants of G

G  p is the projection into the session type for p

` Pi I Ti Ti≤ G  pi pt{G } ⊆ {p1, . . . , pn} ∀i ∈ {1, . . . , n}

p1/ P1| . . . | pn/ PnI G

15/20

(38)

Introduction Safe sessions Types with topics Results Conclusion

Typing example

Alice / Bob?evaluation(x ). Charlie!evaluation(”accept”`1,paper 2).0 Bob?evaluation(String`1,paper 1).Charlie!evaluation(String`2,paper 2).end

16/20

(39)

Introduction Safe sessions Types with topics Results Conclusion

Session and global type reduction

Reduction of session types:

T ∨ T0=⇒ T p!λ(S`,ϕ).T =⇒ T ^

i ∈I

p?λi(Si`i,ϕi).Ti =⇒ Ti

Reduction of global types:

G =⇒ G \ p−→ qλ

where G \ p−→ q is the global type obtained from G by executing theλ communication p−→ qλ

17/20

(40)

Introduction Safe sessions Types with topics Results Conclusion

Subject reduction

Theorem

If p / P | M−→ p / Pκ 0 | M0, and p / P | M I G and ` P I T , then:

1 p / P0 | M0 I G0 for some G0 such that G =⇒∗G0;

2 ` P0 I T0 for some T0 such that T =⇒∗T0.

Proved by establishing that:

if q!λ(S`,ϕ).T ≤ G  p, then T ≤ (G \ p−→ q)  p;λ if p?λ(S`,ϕ).T ∧ T0≤ G  q, then T ≤ (G \ p−→ q)  q;λ G  r = (G \ p−→ q)  r for r 6= p, r 6= q.λ

18/20

(41)

Introduction Safe sessions Types with topics Results Conclusion

Soundness theorem

Theorem

If M is typeable by a derivation containing only safe types then M is safe.

Proof essentially based on subject reduction theorem.

19/20

(42)

Introduction Safe sessions Types with topics Results Conclusion

Conclusion and further work

Advantages of the proposed approach:

A sequence of messages directed to the same participant is always allowed

Thanks to the introduction of topics, the standard leak-freedom requirement can be relaxed also on relay sequences, by forbidding only downward flows between messages on related topics. Further directions:

consider multiple sessions

enrich the present calculus by allowing levels and topics to depend on exchanged values, following [Louren¸co-Caires 2015]

20/20

(43)

Introduction Safe sessions Types with topics Results Conclusion

Conclusion and further work

Advantages of the proposed approach:

A sequence of messages directed to the same participant is always allowed

Thanks to the introduction of topics, the standard leak-freedom requirement can be relaxed also on relay sequences, by forbidding only downward flows between messages on related topics.

Further directions:

consider multiple sessions

enrich the present calculus by allowing levels and topics to depend on exchanged values, following [Louren¸co-Caires 2015]

20/20

(44)

Introduction Safe sessions Types with topics Results Conclusion

Conclusion and further work

Advantages of the proposed approach:

A sequence of messages directed to the same participant is always allowed

Thanks to the introduction of topics, the standard leak-freedom requirement can be relaxed also on relay sequences, by forbidding only downward flows between messages on related topics.

Further directions:

consider multiple sessions

enrich the present calculus by allowing levels and topics to depend on exchanged values, following [Louren¸co-Caires 2015]

20/20

Riferimenti

Documenti correlati

The EF-hand domain in these proteins is characterized by the first loop being noncanonical (14 aa long) and by the first and last helices preceded and followed by

Given a user process P and the set of global types associated to the service identifiers which occur free or bound in P we can add the sender and the receivers to each communication,

SAM g drives the amalgamation very deeply, by unifying sessions and generic methods, and by basing choices (i.e. which session body to choose, and how to continue with the session)

This is due to the replacement of some original processes by the projections of global types into the corresponding participants; see the definition of direct composition of

 As part of a project aimed at synthesizing new chiral structures to be used as ligands in catalytic asymmetric applications, we decided to investigate the chiral

Ad esempio, il patrimonio genetico potrebbe essere corretto con interventi sulla linea somatica: nel caso degli impianti e delle protesi, poi, l’aggiorna- mento

A categorical core/periphery partition (Borgatti & Everett, 1999) reveals that seven subject areas constitute the network core: Public Sector, Organizational Psychology,

Trustworthy Service Oriented Computing is hard: services are autonomous, heterogeeneous, separately designed computational entities to be..