A Formal Specification of the MIDP 2.0 Security Model eguelin 1 - - PowerPoint PPT Presentation

a formal specification of the midp 2 0 security model
SMART_READER_LITE
LIVE PREVIEW

A Formal Specification of the MIDP 2.0 Security Model eguelin 1 - - PowerPoint PPT Presentation

Motivation Specification Verification Refinement A Formal Specification of the MIDP 2.0 Security Model eguelin 1 Gustavo Betarte 2 Carlos Luna 2 Santiago Zanella B 1 Everest Project, INRIA Sophia Antipolis INRIAMicrosoft Research Joint


slide-1
SLIDE 1

Motivation Specification Verification Refinement

A Formal Specification of the MIDP 2.0 Security Model

Santiago Zanella B´ eguelin1 Gustavo Betarte2 Carlos Luna2

1Everest Project, INRIA Sophia Antipolis

INRIA–Microsoft Research Joint Laboratory

2InCo, Universidad de la Rep´

ublica, Uruguay

Workshop on Formal Aspects in Security and Trust, 2006

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-2
SLIDE 2

Motivation Specification Verification Refinement

Outline

1

Motivation

2

Specification

3

Verification

4

Refinement

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-3
SLIDE 3

Motivation Specification Verification Refinement

What is a Mobile Device?

Defining characteristics portable scarce resources (compared with other platforms) communicated stores personal information subscribed to pay-per-use services

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-4
SLIDE 4

Motivation Specification Verification Refinement

Some Examples

Cell Phones Personal Digital Assistants

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-5
SLIDE 5

Motivation Specification Verification Refinement

The Problem

What a secure mobile device should enforce: Data confidentiality and integrity Cost control Availability ...even in the presence of malicious applications

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-6
SLIDE 6

Motivation Specification Verification Refinement

The Problem

What a secure mobile device should enforce: Data confidentiality and integrity Cost control Availability ...even in the presence of malicious applications

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-7
SLIDE 7

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-8
SLIDE 8

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-9
SLIDE 9

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-10
SLIDE 10

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-11
SLIDE 11

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-12
SLIDE 12

Motivation Specification Verification Refinement

The Problem

A possible scenario

If the device supports loading of executable code after issuance...

A B

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-13
SLIDE 13

Motivation Specification Verification Refinement

First Solution

Removing the cause

Either Don’t allow users to download code but they love to do so (and it’s a big market opportunity) Don’t allow downloaded code to access sensitive APIs but many useful applications must do so (e.g. synchronization, news push) Roughly, MIDP 1.0 used this last solution (a sandbox model)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-14
SLIDE 14

Motivation Specification Verification Refinement

Second solution

Establish a security policy

A security policy is a mapping from a set of properties that characterize code to a set of access permissions granted to that code

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-15
SLIDE 15

Motivation Specification Verification Refinement

Second solution

Establish a security policy

A security policy is a mapping from a set of properties that characterize code to a set of access permissions granted to that code

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-16
SLIDE 16

Motivation Specification Verification Refinement

Layered J2ME - MIDP architecture

Hardware Native Operating System CLDC Java Virtual Machine Native Applications MIDP OEM-specific APIs OEM-specific Applications MIDP Applications

Users may only download MIDP applications MIDP applications access resources through restricted interface

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-17
SLIDE 17

Motivation Specification Verification Refinement

MIDP Security Model

In MIDP 1.0, sandbox-like model In MIDP 2.0, model based on protection domains Protection Domain It’s an abstraction of the context of execution of a piece of code Restricts access to sensitive functions In MIDP 2.0, each application belongs to a suite and each suite is bound to a unique Protection Domain

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-18
SLIDE 18

Motivation Specification Verification Refinement

MIDP Security Model

In MIDP 1.0, sandbox-like model In MIDP 2.0, model based on protection domains Protection Domain It’s an abstraction of the context of execution of a piece of code Restricts access to sensitive functions In MIDP 2.0, each application belongs to a suite and each suite is bound to a unique Protection Domain

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-19
SLIDE 19

Motivation Specification Verification Refinement

Protection Domains in Practice

SigKA SigKB Policy

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-20
SLIDE 20

Motivation Specification Verification Refinement

Protection Domains in Practice

Policy

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-21
SLIDE 21

Motivation Specification Verification Refinement

MIDP 2.0 Security Model

Protected function − → Permission A Protection Domain determines: A set of permissions granted unconditionally A set of permissions that could be granted with explicit user authorization, together with a mode that specifies its validity

blanket until the removal of the suite session for the current session

  • neshot for a single use
  • neshot ≤m session ≤m blanket.

The specified mode is an upper bound

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-22
SLIDE 22

Motivation Specification Verification Refinement

Permissions Acquired by a Suite

A suite declares at installation time the permissions it requires

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-23
SLIDE 23

Motivation Specification Verification Refinement

Permissions Acquired by a Suite

A suite declares at installation time the permissions it requires Acquired = Requested ∩ (Unconditionally granted ∪ Granted by user authorization)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-24
SLIDE 24

Motivation Specification Verification Refinement

New Problems

Issues Does the security model enforce the security policy? Do implementations conform to the model? How do other operations interfere with the model?

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-25
SLIDE 25

Motivation Specification Verification Refinement

New Problems

Issues Does the security model enforce the security policy? Do implementations conform to the model? How do other operations interfere with the model? What is exactly the security model?

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-26
SLIDE 26

Motivation Specification Verification Refinement

Outline

1

Motivation

2

Specification

3

Verification

4

Refinement

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-27
SLIDE 27

Motivation Specification Verification Refinement

Remarks

Formalized in the Calculus of Inductive Constructions Developed with the Coq proof assistant Abstract higher-order specification

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-28
SLIDE 28

Motivation Specification Verification Refinement

The Calculus of Inductive Constructions

CIC CIC is an extension of the simple-typed lambda calculus with: Polymorphic types [(λ x . x) : A → A] Higher-order types [A → A : ∗ : ] Dependent types [(λ a : A . f a) : (∀ a : A . Ba)] Implemented in Coq Type checker + Proof assistant Can encode higher-order predicate logic Inductive definitions Curry-Howard isomorphism types ↔ propositions terms ↔ proofs

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-29
SLIDE 29

Motivation Specification Verification Refinement

Formalizing the state of the device

State components relevant to the security model: installed suites current session (if it exists)

current suite permissions granted or revoked in session mode

permissions granted or revoked for the session in blanket mode State := { suite : Suite → Prop, session : option SessionInfo, granted, revoked : SuiteID → Permission → Prop } Higher-order specification (notice predicates in the state)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-30
SLIDE 30

Motivation Specification Verification Refinement

Formalizing the state of the device

State components relevant to the security model: installed suites current session (if it exists)

current suite permissions granted or revoked in session mode

permissions granted or revoked for the session in blanket mode State := { suite : Suite → Prop, session : option SessionInfo, granted, revoked : SuiteID → Permission → Prop } Higher-order specification (notice predicates in the state)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-31
SLIDE 31

Motivation Specification Verification Refinement

Events

Session start (start); Session end (terminate); Authorization request by the current suite (request); Suite installation (install); Suite removal (remove). Their behavior is specified by means of pre- and postconditions. Example (Session start) Pre s (start id) = s.session = None ∧ ∃ ms : Suite, s.suite ms ∧ ms.id = id Pos s s′ r (start id) = r = None ∧ s ≡session s′∧ ∃ ses′, s′.session = ses′ ∧ ses′.id = id ∧ ∀ p : Permission, ¬ses′.granted p ∧ ¬ses′.revoked p

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-32
SLIDE 32

Motivation Specification Verification Refinement

State transition relation ֒ →: ¬Pre s e s ֒

e/None

− − − − → s npre Pre s e Pos s s′ r e s ֒

e/r

− − → s′ pre s ֒

e/r

− − → s′: “the execution of the event e in state s results in a new state s′ and produces a response r”

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-33
SLIDE 33

Motivation Specification Verification Refinement

Sessions

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn A session is determined by a suite identifier id an initial state s0 a sequence of steps ei, si, ri (i = 1, . . . , n) s.t.

1

e1 = start id

2

Pre s0 e1

3

∀ i ∈ {2, . . . , n − 1}, ei = terminate

4

en = terminate

5

∀ i ∈ {1, . . . , n}, si−1 ֒

ei/ri

− − → si

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-34
SLIDE 34

Motivation Specification Verification Refinement

Sessions

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn A session is determined by a suite identifier id an initial state s0 a sequence of steps ei, si, ri (i = 1, . . . , n) s.t.

1

e1 = start id

2

Pre s0 e1

3

∀ i ∈ {2, . . . , n − 1}, ei = terminate

4

en = terminate

5

∀ i ∈ {1, . . . , n}, si−1 ֒

ei/ri

− − → si

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-35
SLIDE 35

Motivation Specification Verification Refinement

Sessions

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn A session is determined by a suite identifier id an initial state s0 a sequence of steps ei, si, ri (i = 1, . . . , n) s.t.

1

e1 = start id

2

Pre s0 e1

3

∀ i ∈ {2, . . . , n − 1}, ei = terminate

4

en = terminate

5

∀ i ∈ {1, . . . , n}, si−1 ֒

ei/ri

− − → si

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-36
SLIDE 36

Motivation Specification Verification Refinement

Sessions

Inductive definition

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn Pre s0 (start id) s0 ֒

start id/r1

− − − − − − → s1 PSession s0 ([ ] start id, s1, r1) pses start PSession s0 (ss last) e = terminate last.s ֒

e/r

− − → s′ PSession s0 (ss last e, s′, r) pses app PSession s0 (ss last) last.s ֒

terminate/r

− − − − − − − → s′ Session s0 (ss last terminate, s′, r) ses term

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-37
SLIDE 37

Motivation Specification Verification Refinement

Sessions

Inductive definition

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn Pre s0 (start id) s0 ֒

start id/r1

− − − − − − → s1 PSession s0 ([ ] start id, s1, r1) pses start PSession s0 (ss last) e = terminate last.s ֒

e/r

− − → s′ PSession s0 (ss last e, s′, r) pses app PSession s0 (ss last) last.s ֒

terminate/r

− − − − − − − → s′ Session s0 (ss last terminate, s′, r) ses term

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-38
SLIDE 38

Motivation Specification Verification Refinement

Sessions

Inductive definition

s0 ֒

start id/r1

− − − − − − → s1 ֒

e2/r2

− − − → s2 ֒

e3/r3

− − − → · · · ֒

en−1/rn−1

− − − − − − → sn−1 ֒

terminate/rn

− − − − − − − → sn Pre s0 (start id) s0 ֒

start id/r1

− − − − − − → s1 PSession s0 ([ ] start id, s1, r1) pses start PSession s0 (ss last) e = terminate last.s ֒

e/r

− − → s′ PSession s0 (ss last e, s′, r) pses app PSession s0 (ss last) last.s ֒

terminate/r

− − − − − − − → s′ Session s0 (ss last terminate, s′, r) ses term

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-39
SLIDE 39

Motivation Specification Verification Refinement

Outline

1

Motivation

2

Specification

3

Verification

4

Refinement

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-40
SLIDE 40

Motivation Specification Verification Refinement

Methodology

The formal specification defines a theory Properties of the security model are theorems We state and prove some of these theorems with the help

  • f Coq

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-41
SLIDE 41

Motivation Specification Verification Refinement

Some Proved Theorems

Proofs are omitted, sorry

State validity is an invariant ∀ (s s′ : State) (e : Event) (r : Response) Valid s → s ֒

e/r

− − → s′ → Valid s′ A state is valid if (among other things) Suite identifiers are unique; The current suite is an installed suite; Granted permissions are consistent with corresponding protection domains and application descriptors; Permissions required as critical by a suite are not forbidden by its protection domain

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-42
SLIDE 42

Motivation Specification Verification Refinement

Some Proved Theorems

More theorems

Revocation of permissions is correctly enforced Whenever a permission is revoked in session mode, subsequent authorization requests are refused Generalization of invariants Sufficient and necessary conditions for invariants Theorem: one-step invariants remain true once established

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-43
SLIDE 43

Motivation Specification Verification Refinement

Outline

1

Motivation

2

Specification

3

Verification

4

Refinement

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-44
SLIDE 44

Motivation Specification Verification Refinement

Why Should We Care?

Remarks We have a higher-order specification Transition relation defined implicitly Coq program extraction mechanism cannot be used What is the pay off of refinement? An executable prototype An oracle for testing Test case extraction (black box testing)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-45
SLIDE 45

Motivation Specification Verification Refinement

Data Refinement

For each type T, a concrete type T is defined x ⊑ x is read “x is refined by x” Example (Predicates as lists) Let P : A → Prop and l : list A, then l ⊑ P iff (∀ a, P a → ∃ a, a ∈ l ∧ a ⊑ a) ∧ (∀ a, a ∈ l → ∃ a, P a ∧ a ⊑ a) Whenever A = A this simplifies to ∀ a, P a ↔ a ∈ l

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-46
SLIDE 46

Motivation Specification Verification Refinement

Concrete State

State := { suite : list Suite, session : option SessionInfo, granted, revoked : SuiteID → list Permission }

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-47
SLIDE 47

Motivation Specification Verification Refinement

Operation Refinement

s s′ s s′ interp ֒ → ⊑ ⊑ State State For every state s′ and response r computed by interp there must exist a corresponding abstract state s′ refined by s′ reachable from s by ֒ → with the same response ∀ (s : State)

  • s : State
  • (e : Event)
  • e : Event
  • (r : Response),

s ⊑ s → e ⊑ e → let

  • s′, r
  • := interp s e in ∃ s′ : State, s′ ⊑ s′ ∧ s ֒

e/r

− − → s′

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-48
SLIDE 48

Motivation Specification Verification Refinement

Operation Refinement

s s′ s s′ interp ֒ → ⊑ ⊑ State State For every state s′ and response r computed by interp there must exist a corresponding abstract state s′ refined by s′ reachable from s by ֒ → with the same response ∀ (s : State)

  • s : State
  • (e : Event)
  • e : Event
  • (r : Response),

s ⊑ s → e ⊑ e → let

  • s′, r
  • := interp s e in ∃ s′ : State, s′ ⊑ s′ ∧ s ֒

e/r

− − → s′

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-49
SLIDE 49

Motivation Specification Verification Refinement

Main Contributions

The first formalization of the MIDP 2.0 security model Formal machine-checked verification of the model Investigated some aspects unclear in the informal specification A refinement methodology The complete development in Coq may be obtained from http://www-sop.inria.fr/everest/personnel/ Santiago.Zanella/MIDP

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-50
SLIDE 50

Motivation Specification Verification Refinement

Ongoing and Future Work

We have not completed a full refinement Relax hypothesis assumed about the model

More than one active suite Dynamic security policies in Protection Domains

Consider extensions to the existing model

Hierarchical permissions Multiplicities (Besson et al. – ESORICS’06)

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model

slide-51
SLIDE 51

Motivation Specification Verification Refinement

Thank you!

Additional Information http://www-sop.inria.fr/everest/personnel/ Santiago.Zanella/MIDP

Zanella B´ eguelin, Betarte, Luna A Formal Specification of the MIDP 2.0 Security Model