Controlling Data Flow with a Policy-Based Programming Language for - - PowerPoint PPT Presentation

controlling data flow with a policy based programming
SMART_READER_LITE
LIVE PREVIEW

Controlling Data Flow with a Policy-Based Programming Language for - - PowerPoint PPT Presentation

Controlling Data Flow with a Policy-Based Programming Language for the Web Thierry Sans Iliano Cervesato Soha Hussein Privacy from the users perspective 85GA7 Privacy from the users perspective 85GA7 Privacy from the users


slide-1
SLIDE 1

Controlling Data Flow with a Policy-Based Programming Language for the Web

Thierry Sans Iliano Cervesato Soha Hussein

slide-2
SLIDE 2

Privacy from the user’s perspective

85GA7

slide-3
SLIDE 3

Privacy from the user’s perspective

85GA7

slide-4
SLIDE 4

Privacy from the user’s perspective

85GA7

slide-5
SLIDE 5

Privacy from the user’s perspective

85GA7

slide-6
SLIDE 6

Privacy from the user’s perspective

85GA7

slide-7
SLIDE 7

Privacy from the user’s perspective

85GA7

slide-8
SLIDE 8

Privacy from the user’s perspective

85GA7

slide-9
SLIDE 9

Privacy from the user’s perspective

Should I use this app? How does this app use my data?

85GA7

slide-10
SLIDE 10

Privacy from the user’s perspective

Should I use this app? How does this app use my data?

85GA7

slide-11
SLIDE 11

Privacy from the user’s perspective

Should I use this app? How does this app use my data? App’s Privacy Policy

85GA7

slide-12
SLIDE 12

Privacy from the user’s perspective

Should I use this app? How does this app use my data? App’s Privacy Policy User’s Privacy Expectations

85GA7

slide-13
SLIDE 13

Privacy from the user’s perspective

Should I use this app? How does this app use my data? App’s Privacy Policy User’s Privacy Expectations

85GA7

slide-14
SLIDE 14
slide-15
SLIDE 15

Privacy from the web developer’s perspective

slide-16
SLIDE 16

Privacy from the web developer’s perspective

How to write my privacy policy?

slide-17
SLIDE 17

Privacy from the web developer’s perspective

How to write my privacy policy?

slide-18
SLIDE 18

Can we generate a privacy policy automatically?

slide-19
SLIDE 19

Can we generate a privacy policy automatically?

Based on the privacy policies of third party service providers ...

slide-20
SLIDE 20

Can we generate a privacy policy automatically?

Based on the privacy policies of third party service providers ... … and based on how the program combines these services ...

slide-21
SLIDE 21

Can we generate a privacy policy automatically?

Based on the privacy policies of third party service providers ... … and based on how the program combines these services ... … can we infer how user’s data will be used? *

slide-22
SLIDE 22

Can we generate a privacy policy automatically?

Based on the privacy policies of third party service providers ... … and based on how the program combines these services ... … can we infer how user’s data will be used? * * no adversary model, third parties are trustworthy

slide-23
SLIDE 23

Two solutions

slide-24
SLIDE 24

Two solutions

Solution 1 : Analyze the programs and infer the data flow

➡ Static analysis, abstract interpretation

slide-25
SLIDE 25

Two solutions

Solution 1 : Analyze the programs and infer the data flow

➡ Static analysis, abstract interpretation

Solution 2 : Design a new programming language

➡ Qwel (Qatar Web Programming Language) with data flow

slide-26
SLIDE 26

Qwel : lambda calculus + primitives for remote procedure call + . . .

Types τ :: = unit | τ × τʹ″ | τ → τ’ | τ ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2

Fragment of the language syntax

slide-27
SLIDE 27

Qwel : lambda calculus + primitives for remote procedure call + . . .

Types τ :: = unit | τ × τʹ″ | τ → τ’ | τ ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2

Fragment of the language syntax Typing

Σ | Γ ⊢w e : τ “e has type τ at w w.r.t. Σ and Γ” Γ ::= · | Γ, x : τ Σ ::= · | Σ, w/u : τ ⇒ τ

slide-28
SLIDE 28

Programming with Qwel

slide-29
SLIDE 29

Programming with Qwel

@w1 publish x : τ . e

slide-30
SLIDE 30

Programming with Qwel

w1/u1

@w1 publish x : τ . e

slide-31
SLIDE 31

Programming with Qwel

w1/u1

@w1 publish x : τ . e @w0 call w1/u1 with input

slide-32
SLIDE 32

Programming with Qwel

w1/u1

input

@w1 publish x : τ . e @w0 call w1/u1 with input

slide-33
SLIDE 33

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5 Data Flow Services

slide-34
SLIDE 34

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

publish x : unit. let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

Data Flow Services

slide-35
SLIDE 35

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

publish x : unit let xʹ″ = call w1/u1 with x xʹ″ʹ″ = call w4/u4 with xʹ″ xʹ″ʹ″ʹ″ = call w5/u5 with xʹ″ in ⟨xʹ″ʹ″, xʹ″ʹ″ʹ″⟩ end publish x : unit. let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

Data Flow Services

slide-36
SLIDE 36

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

λ input:unit.(call w0/u0 with input) publish x : unit let xʹ″ = call w1/u1 with x xʹ″ʹ″ = call w4/u4 with xʹ″ xʹ″ʹ″ʹ″ = call w5/u5 with xʹ″ in ⟨xʹ″ʹ″, xʹ″ʹ″ʹ″⟩ end publish x : unit. let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

Data Flow Services

slide-37
SLIDE 37

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

λ input:unit.(call w0/u0 with input)

slide-38
SLIDE 38

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

Where is input going to? How will it be used?

λ input:unit.(call w0/u0 with input)

slide-39
SLIDE 39

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

Where is input going to? How will it be used?

λ input:unit.(call w0/u0 with input)

slide-40
SLIDE 40

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

Can we get a symbolic expression that represents how input is used?

➡ The data flow of input

Where is input going to? How will it be used?

λ input:unit.(call w0/u0 with input)

slide-41
SLIDE 41

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

slide-42
SLIDE 42

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

no flow

slide-43
SLIDE 43

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

slide-44
SLIDE 44

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

service flow

slide-45
SLIDE 45

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

slide-46
SLIDE 46

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

sequential flow

slide-47
SLIDE 47

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

slide-48
SLIDE 48

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

parallel flow

slide-49
SLIDE 49

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

Fragment of the language syntax

slide-50
SLIDE 50

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

no

Fragment of the language syntax

slide-51
SLIDE 51

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

no service

Fragment of the language syntax

slide-52
SLIDE 52

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

no service composition

Fragment of the language syntax

slide-53
SLIDE 53

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

no service composition parallel

Fragment of the language syntax

slide-54
SLIDE 54

Qwel with Flow

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″

no service composition parallel

Fragment of the language syntax Typing

Σ | Γ ⊢w e : τ “e has type τ at w w.r.t. Σ and Γ” Γ ::= · | Γ, x : τ {μ} Σ ::= · | Σ, w/u : τ {μ} ⇒ τ

slide-55
SLIDE 55

No Flow and Service flow

w1/u1 w2/u2 w0/u0

publish x : unit. call w1/u1 with x publish x : unit. call w2/u2 with x publish x : unit. x

slide-56
SLIDE 56

No Flow and Service flow

w1/u1 w2/u2 w0/u0

publish x : unit. call w1/u1 with x publish x : unit. call w2/u2 with x publish x : unit. x

: unit {w2 ≻ •} ⇒ unit

slide-57
SLIDE 57

No Flow and Service flow

w1/u1 w2/u2 w0/u0

publish x : unit. call w1/u1 with x publish x : unit. call w2/u2 with x publish x : unit. x

: unit {w2 ≻ •} ⇒ unit : unit {w0 ≻ (w1 ≻ (w2 ≻ •))} ⇒ unit

slide-58
SLIDE 58

No Flow and Service flow

w1/u1 w2/u2 w0/u0

publish x : unit. call w1/u1 with x publish x : unit. call w2/u2 with x publish x : unit. x

: unit {w2 ≻ •} ⇒ unit : unit {w0 ≻ (w1 ≻ (w2 ≻ •))} ⇒ unit : unit {w1 ≻ (w2 ≻ •)} ⇒ unit

slide-59
SLIDE 59

No Flow and Service flow

w1/u1 w2/u2 w0/u0

publish x : unit. call w1/u1 with x publish x : unit. call w2/u2 with x publish x : unit. x

: unit {w2 ≻ •} ⇒ unit : unit {w0 ≻ (w1 ≻ (w2 ≻ •))} ⇒ unit : unit {w1 ≻ (w2 ≻ •)} ⇒ unit Σ | Γ, x: τ {μ} ⊢w e : τ’ Σ | Γ ⊢w publish x:τ.e : τ {w ≻ μ} ⇒ τ

slide-60
SLIDE 60

Parallel flow

x

w0/u0 w4/u4 w5/u5

publish x : unit let xʹ″ = call w4/u4 with x xʹ″ʹ″ = call w5/u5 with x in ⟨xʹ″, xʹ″ʹ″⟩ end

slide-61
SLIDE 61

Parallel flow

x

w0/u0 w4/u4 w5/u5

publish x : unit let xʹ″ = call w4/u4 with x xʹ″ʹ″ = call w5/u5 with x in ⟨xʹ″, xʹ″ʹ″⟩ end

: unit {w0 ≻ ((w4 ≻ •) ∥ (w5 ≻ •))} ⇒ unit

slide-62
SLIDE 62

Parallel flow

x

w0/u0 w4/u4 w5/u5

publish x : unit let xʹ″ = call w4/u4 with x xʹ″ʹ″ = call w5/u5 with x in ⟨xʹ″, xʹ″ʹ″⟩ end

: unit {w0 ≻ ((w4 ≻ •) ∥ (w5 ≻ •))} ⇒ unit Σ | Γ ⊢w e1 : τ Σ | Γʹ″ ⊢w e2 : τʹ″ Σ | (Γ ∥ Γʹ″) ⊢w ⟨e1,e2⟩ : τ × τʹ″

slide-63
SLIDE 63

Sequential flow

x

w1/u1 w2,u2 w3,u3

publish x : unit let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

slide-64
SLIDE 64

Sequential flow

x

w1/u1 w2,u2 w3,u3

publish x : unit let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

: unit {w1 ≻ ((w2 ≻ •) ; (w3 ≻ •))} ⇒ unit

slide-65
SLIDE 65

Sequential flow

x

w1/u1 w2,u2 w3,u3

publish x : unit let xʹ″ = call w2/u2 with x in call w3/u3 with xʹ″ end

: unit {w1 ≻ ((w2 ≻ •) ; (w3 ≻ •))} ⇒ unit Σ | Γ ⊢w e1 : τ {μ} ⇒ τ‘ Σ | Γʹ″ ⊢w e2 : τ Σ | (Γ ∥ (Γʹ″ ; μ)) ⊢w call e1 with e2 : τ’

slide-66
SLIDE 66

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

λ input:unit.(call w0/u0 with input)

Can we get a symbolic expression that represent how input is used?

➡ The data flow of input

Where is input going to? How will it be used?

slide-67
SLIDE 67

w0/u0 w1/u1 w2/u2 w3/u3 w4/u4 w5/u5

λ input:unit.(call w0/u0 with input)

Can we get a symbolic expression that represent how input is used?

➡ The data flow of input

Where is input going to? How will it be used?

w0 ≻ ((w1 ≻ (w2 ; w3)) ; (w4 ∥ w5))

slide-68
SLIDE 68

From data flow to flow policies

w1/u1

call w1/u1 with input publish x : unit. f(x)

slide-69
SLIDE 69

From data flow to flow policies

w1/u1

call w1/u1 with input publish x : unit. f(x) App’s Privacy Policy

: τ {μ} ⇒ τ’

slide-70
SLIDE 70

From data flow to flow policies

w1/u1

call w1/u1 with input publish x : unit. f(x) App’s Privacy Policy

: τ {μ} ⇒ τ’

User’s Privacy Expectations

[p]

slide-71
SLIDE 71

From data flow to flow policies

w1/u1

call w1/u1 with input publish x : unit. f(x) App’s Privacy Policy

: τ {μ} ⇒ τ’

User’s Privacy Expectations

[p]

μ p

slide-72
SLIDE 72

The policy language

Types τ :: = unit | τ × τʹ″ | τ {μ} → τ’ | τ {μ} ⇒ τ’ Expressions e :: = x | λx:τ.e | (e1 e2) | ⟨e1,e2⟩ | fst e | snd e | () | w/u | publish x:τ.e | call e1 with e2 [p] Flow μ :: = • | w ≻ μ | μ ; μʹ″ | μ ∥ μʹ″ Policies p = ⊤ | ⊥ | ¬p | p1 ∧ p2 | p1 ∨ p2 | • | w≻p | p1 ; p2

Fragment of the language syntax Policy Evaluation

slide-73
SLIDE 73

Derived Operators

ws ≻⋆ p

wi/ui

p wi ∈ ws

p1 ;? p2

p1 p2

  • r

p1

p1 ;⋆ p2

p1 p2

slide-74
SLIDE 74

Derived Operators

ws ≻ p

wi/ui

p wi ∈ ws

ws ≻⋆ p

wi/ui

p wi ∈ ws

p1 ;? p2

p1 p2

  • r

p1

p1 ;⋆ p2

p1 p2

slide-75
SLIDE 75

Derived Operators

ws ≻ p

wi/ui

p wi ∈ ws

ws ≻? p

wi/ui

p

wi/ui

wi ∈ ws

  • r

ws ≻⋆ p

wi/ui

p wi ∈ ws

p1 ;? p2

p1 p2

  • r

p1

p1 ;⋆ p2

p1 p2

slide-76
SLIDE 76

Policy examples

Alice trusts w1 calling any services as needed, and w0 may send the result coming from w1 to w4 and/or w5 if needed

w0 ≻ ((w1 ≻ ((w2 ≻ ⊤) ; ⊤)) ; {w4,w5})

Alice trusts w0, w1, w2, w3, w4 and w5 only

({w0, w1, w2, w3, w4, w5} ≻⋆ ⊥) ;⋆ ⊥

Alice trusts trusts any node except w6

{w6} = ({w6} ≻⋆ ⊥) ;⋆ ⊥

slide-77
SLIDE 77

Chinese Wall security policy

As the value is sent to w4 any nested service call or further composition should not involve w5 and vice versa

p4 = (w4 ≻ {w5}) ;? {w5} p5 = (w5 ≻ {w4}) ;? {w4} p = {w4,w5} ∨ (({w4,w5} ≻⋆ p4) ;⋆ {w5}) ∨ (({w4,w5} ≻⋆ p5) ;⋆ {w4})

slide-78
SLIDE 78

The Qwel prototype

A web application

  • Qwel interpreter written in

Javascript (browser/server)

  • Remote procedure calls are

HTTP requests

  • Services are stored locally in

a MongoDB database

slide-79
SLIDE 79

Conclusion

  • Qwel a type-safe language for web programming
  • Types annotated with flow inferred statically
  • Policy language to constraint flows
slide-80
SLIDE 80

Future work

  • Extend the data flow model to discriminate between services

from the same domain

  • Support higher-order functions by dealing with hypothetical

flow (polymorphic flow types)

  • Extend the data flow model with support for mobile code

(javascript code)

  • Prove that executing the code generate a trace that matches

the data flow predicted statically

slide-81
SLIDE 81

Thank You

slide-82
SLIDE 82

On the problem with higher-order functions

publish (f, x): ((int → int) * int) = (f x)

@w0

slide-83
SLIDE 83

On the problem with higher-order functions

publish (f, x): ((int → int) * int) = (f x) What is the flow of x?

@w0

slide-84
SLIDE 84

On the problem with higher-order functions

publish (f, x): ((int → int) * int) = (f x) What is the flow of x?

@w0

It depends on f ! f : int {μ} → int

slide-85
SLIDE 85

On the problem with higher-order functions

publish (f, x): ((int → int) * int) = (f x) What is the flow of x? : int {w0 ≻ μ} ⇒ int

@w0

It depends on f ! f : int {μ} → int

slide-86
SLIDE 86

On the problem with higher-order functions

publish (f, x): ((int → int) * int) = (f x) What is the flow of x? : int {w0 ≻ μ} ⇒ int

@w0

It depends on f ! f : int {μ} → int

We need account for hypothetical flow with higher-order functions

➡ Polymorphic flow types

slide-87
SLIDE 87

Related Work

Dependencies between program building blocks

  • History-based type systems - Abadi and al [1]
  • Data Flow Graph - Ferrante and al [12]

➡ In Qwel, services can be created dynamically as opposed to

having static libraries Acceptable composition of shared resources

  • Algebra and logic for access control - Pym and al [4, 5]

➡ Qwel outlines the specific context of web programming

slide-88
SLIDE 88

Related Work

Verifying policy constraints statically

  • Fable - Swamy and al [16]
  • Jif - Myers and al [17]

➡ Similar idea explored with Qwel but not based on labeling

slide-89
SLIDE 89

Data flow vs non-interference

In non-interference models

  • flow is controlled by the mean of type labels and a lattice
  • but no explicit data flow representation

We want to understand better how they are related

  • Are these two approaches orthogonal?
  • Can we used them in conjunction to provide a robust

security model?