A certified reference validation mechanism for the permission model - - PowerPoint PPT Presentation

a certified reference validation mechanism for the
SMART_READER_LITE
LIVE PREVIEW

A certified reference validation mechanism for the permission model - - PowerPoint PPT Presentation

Motivation Introduction Specification Verification A certified reference validation mechanism for the permission model of Android Gustavo Betarte Juan Campo Felipe Gorostiaga Carlos Luna InCo, Facultad de Ingenier a, Universidad de


slide-1
SLIDE 1

Motivation Introduction Specification Verification

A certified reference validation mechanism for the permission model of Android

Gustavo Betarte Juan Campo Felipe Gorostiaga Carlos Luna

InCo, Facultad de Ingenier´ ıa, Universidad de la Rep´ ublica, Uruguay. IMDEA Software Institute, Spain.

October 16, 2017

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-2
SLIDE 2

Motivation Introduction Specification Verification

Table of contents

1

Motivation

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-3
SLIDE 3

Motivation Introduction Specification Verification

Table of contents

1

Motivation

2

Introduction

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-4
SLIDE 4

Motivation Introduction Specification Verification

Table of contents

1

Motivation

2

Introduction

3

Specification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-5
SLIDE 5

Motivation Introduction Specification Verification

Table of contents

1

Motivation

2

Introduction

3

Specification

4

Verification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-6
SLIDE 6

Motivation Introduction Specification Verification

Summary

1

Motivation

2

Introduction

3

Specification

4

Verification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-7
SLIDE 7

Motivation Introduction Specification Verification

Why Android?

Present in more than a billion mobile devices. Target of many attacks. Informal and incomplete documentation.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-8
SLIDE 8

Motivation Introduction Specification Verification

Summary

1

Motivation

2

Introduction

3

Specification

4

Verification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-9
SLIDE 9

Motivation Introduction Specification Verification

Introduction to Android

Open-source operating system for mobile devices. Developed by Google and the Open Handset Alliance (OHA)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-10
SLIDE 10

Motivation Introduction Specification Verification

Introduction to Android

Two kinds of applications:

1

System applications shipped with the Android distribution

  • Eg. Clock, Contacts

2

User applications developed by third parties

  • Eg. WhatsApp, Facebook

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-11
SLIDE 11

Motivation Introduction Specification Verification

Introduction to Android

Two kinds of applications:

1

System applications shipped with the Android distribution

  • Eg. Clock, Contacts

2

User applications developed by third parties

  • Eg. WhatsApp, Facebook

Both kinds of applications have access to the device’s resources/services, as well as to other applications’ resources.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-12
SLIDE 12

Motivation Introduction Specification Verification

Application components

Activities

They comprise the application screens They handle the user’s interaction with the application

Content Providers

They handle data sharing between applications Interface between data and external applications

Services Broadcast Receivers

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-13
SLIDE 13

Motivation Introduction Specification Verification

Application components

Activities

They comprise the application screens They handle the user’s interaction with the application

Content Providers

They handle data sharing between applications Interface between data and external applications

Services Broadcast Receivers

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-14
SLIDE 14

Motivation Introduction Specification Verification

Application components

Activities

They comprise the application screens They handle the user’s interaction with the application

Content Providers

They handle data sharing between applications Interface between data and external applications

Services Broadcast Receivers

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-15
SLIDE 15

Motivation Introduction Specification Verification

Application components: an example

Activities Inbox New mail Content Providers Attachments

Attachments Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-16
SLIDE 16

Motivation Introduction Specification Verification

Comunication between Components

Access to Content Providers:

Queries to URIs

Access to any other component:

Intents

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-17
SLIDE 17

Motivation Introduction Specification Verification

Android’s security model

Access to device and external applications must be regulated to keep: Data integrity and confidentiality Costs control by the user System’s proper functioning . . .

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-18
SLIDE 18

Motivation Introduction Specification Verification

Principle Of Least Privilege

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-19
SLIDE 19

Motivation Introduction Specification Verification

Principle Of Least Privilege

Application sandbox

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-20
SLIDE 20

Motivation Introduction Specification Verification

Principle Of Least Privilege

Application sandbox Permission system

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-21
SLIDE 21

Motivation Introduction Specification Verification

AndroidManifest

XML file which every Android application must provide It includes static declarations like:

1

Requested permissions

2

Custom permissions

3

Application’s components

4

. . .

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-22
SLIDE 22

Motivation Introduction Specification Verification

AndroidManifest: Example

<manifest package="com.cpexample" ... > . . . <uses-permission android:name="android.permission.SEND SMS" /> <application android:permission="android.permission.SET WALLPAPER" ... > <activity android:name="com.cpexample.MainActivity" android:permission="android.permission.CALL PHONE" ... > </activity> <provider android:name="com.cpexample.MiProvider" android:permission="android.permission.SEND SMS" ... > </provider> . . . </application> </manifest> Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-23
SLIDE 23

Motivation Introduction Specification Verification

Permission delegation

Permission delegation between components Permissions granted until revocation Two delegation mechanisms:

Pending intents URI permissions

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-24
SLIDE 24

Motivation Introduction Specification Verification

Permission delegation: URI permissions

App1 App2 CProvider

uri1 uri2 uri3

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-25
SLIDE 25

Motivation Introduction Specification Verification

Permission delegation: URI permissions

App1 App2 CProvider

uri1 uri2 uri3

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-26
SLIDE 26

Motivation Introduction Specification Verification

Permission delegation: URI permissions

App1 App2 CProvider

uri1 uri2 uri3

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-27
SLIDE 27

Motivation Introduction Specification Verification

Summary

1

Motivation

2

Introduction

3

Specification

4

Verification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-28
SLIDE 28

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

State i

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-29
SLIDE 29

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

State i

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-30
SLIDE 30

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

Installed applications Current permission delegations

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-31
SLIDE 31

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-32
SLIDE 32

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-33
SLIDE 33

Motivation Introduction Specification Verification

General characteristics

Formalization of Android’s security system Developed using the proof assistant Coq Specially focused on:

Permission system Interaction between components and the system

High order specification based on state machines

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-34
SLIDE 34

Motivation Introduction Specification Verification

System state

InstApps ::= {AppId} GrantedGroups ::= {AppId × {PermGrp}} AppsPerms ::= {AppId × {Perm}} CompInsRunning ::= {CompInstance} OpType ::= read | write | rw DelPPerms ::= {AppId × ContProv × Uri × OpType} DelTPerms ::= {iComp × ContProv × Uri × OpType} AppsResCont ::= {AppId × Res × ResVal} SentIntents ::= {iComp × Intent} AppsManifest ::= {AppId × Manifest} AppsCert ::= {AppId × Cert} AppsDefPerms ::= {AppId × {Perm}} ImageApps ::= {App} AndroidState ::= InstApps × GrantedGroups × AppsPerms × DelTPerms × CompInsRunning × DelPPerms × AppsResCont × SentIntents× AppsManifest × AppsCert × AppsDefPerms × ImageApps A state is valid if application ids are unique ...

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-35
SLIDE 35

Motivation Introduction Specification Verification

Some actions

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-36
SLIDE 36

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-37
SLIDE 37

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-38
SLIDE 38

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop) Read from a content provider (read) Write to a content provider (write)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-39
SLIDE 39

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop) Read from a content provider (read) Write to a content provider (write) Temporal grant of permissions (grantT) Permanent grant of permissions (grantP)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-40
SLIDE 40

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop) Read from a content provider (read) Write to a content provider (write) Temporal grant of permissions (grantT) Permanent grant of permissions (grantP) Revokation of granted permissions (revoke)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-41
SLIDE 41

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop) Read from a content provider (read) Write to a content provider (write) Temporal grant of permissions (grantT) Permanent grant of permissions (grantP) Revokation of granted permissions (revoke) System API call (call) .....

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-42
SLIDE 42

Motivation Introduction Specification Verification

Some actions

App installation (install) App uninstallation (uninstall) Start the execution of a component (start) Stop the execution of a component (stop) Read from a content provider (read) Write to a content provider (write) Temporal grant of permissions (grantT) Permanent grant of permissions (grantP) Revokation of granted permissions (revoke) System API call (call) ..... Semantic expressed by the means of pre and postconditions

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-43
SLIDE 43

Motivation Introduction Specification Verification

Semantics

Precondition of action install Pre(s, install app m c lRes) def = ¬isAppInstalled(app, s) ∧ ¬has duplicates cmp(m) ∧ ∀c : Comp, c ∈ cmp(m) → c / ∈ cmpInState(s) ∧ ¬hasDuplicates perm(m) ∧ authPerms(m, s) ∧ ∀c : Comp, c ∈ cmp(m) → cmpDeclareIntentFilterCorrectly(c)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-44
SLIDE 44

Motivation Introduction Specification Verification

Semantics

Precondition of action install Pre(s, install app m c lRes) def = ¬isAppInstalled(app, s) ∧ ¬has duplicates cmp(m) ∧ ∀c : Comp, c ∈ cmp(m) → c / ∈ cmpInState(s) ∧ ¬hasDuplicates perm(m) ∧ authPerms(m, s) ∧ ∀c : Comp, c ∈ cmp(m) → cmpDeclareIntentFilterCorrectly(c) Postcondition of action install Post(s, install app m c lRes, s′) def = addManifest(m, app, s, s′) ∧ addCert(c, app, s, s′) ∧ addDefPerms(app, m, s, s′) ∧ addApp(app, s, s′) ∧ addRes(app, lRes, s, s′) ∧ initializePermLists(app, s, s′) ∧ sameOtherFields install(s, s′)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-45
SLIDE 45

Motivation Introduction Specification Verification

Actions execution

The state transition is represented with the relation noted ֒ →: validState s Pre s act Post s act s′ s ֒

act,ok

− − − − → s′ validState s ErrorMsg s act err s ֒

act,err

− − − − → s

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-46
SLIDE 46

Motivation Introduction Specification Verification

Actions execution

The state transition is represented with the relation noted ֒ →: validState s Pre s act Post s act s′ s ֒

act,ok

− − − − → s′ validState s ErrorMsg s act err s ֒

act,err

− − − − → s si ֒

act,r

− − − → si+1

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-47
SLIDE 47

Motivation Introduction Specification Verification

Actions execution

The state transition is represented with the relation noted ֒ →: validState s Pre s act Post s act s′ s ֒

act,ok

− − − − → s′ validState s ErrorMsg s act err s ֒

act,err

− − − − → s si ֒

act,r

− − − → si+1 s0 ֒

act1,r1

− − − − → s1 ֒

act2,r2

− − − − → · · · ֒

actn−1,rn−1

− − − − − − − → sn−1 ֒

actn,rn

− − − − → sn

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-48
SLIDE 48

Motivation Introduction Specification Verification

Actions execution

The state transition is represented with the relation noted ֒ →: validState s Pre s act Post s act s′ s ֒

act,ok

− − − − → s′ validState s ErrorMsg s act err s ֒

act,err

− − − − → s si ֒

act,r

− − − → si+1 s0 ֒

act1,r1

− − − − → s1 ֒

act2,r2

− − − − → · · · ֒

actn−1,rn−1

− − − − − − − → sn−1 ֒

actn,rn

− − − − → sn Lemma (Validity is invariant) ∀ (s s′ : AndroidST)(a : Action)(r : Response), s ֒

a,r

− → s′ → valid state(s′)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-49
SLIDE 49

Motivation Introduction Specification Verification

Summary

1

Motivation

2

Introduction

3

Specification

4

Verification

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-50
SLIDE 50

Motivation Introduction Specification Verification

Security properties

Basic properties Eg: state validity invariance

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-51
SLIDE 51

Motivation Introduction Specification Verification

Security properties

Basic properties Eg: state validity invariance Desired properties Eg: Principle of least privilege

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-52
SLIDE 52

Motivation Introduction Specification Verification

Security properties

Basic properties Eg: state validity invariance Desired properties Eg: Principle of least privilege Undesired properties Eg: privilege escalation

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-53
SLIDE 53

Motivation Introduction Specification Verification

Security properties

Basic properties Eg: state validity invariance Desired properties Eg: Principle of least privilege Undesired properties Eg: privilege escalation Mitigating properties Eg: mitigate eavesdropping, intent spoofing

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-54
SLIDE 54

Motivation Introduction Specification Verification

Properties concerning the security model of Android 6

No fine control over grouped permissions: Android’s permission system is not granular enough for granting a proper subset of the set of permissions that belong to a group.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-55
SLIDE 55

Motivation Introduction Specification Verification

Properties concerning the security model of Android 6

No fine control over grouped permissions: Android’s permission system is not granular enough for granting a proper subset of the set of permissions that belong to a group. Implicit individual permission granting: In contrast to what happened in previous Android versions, Applications may obtain privileges that were never granted to it.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-56
SLIDE 56

Motivation Introduction Specification Verification

Properties concerning the security model of Android 6

No fine control over grouped permissions: Android’s permission system is not granular enough for granting a proper subset of the set of permissions that belong to a group. Implicit individual permission granting: In contrast to what happened in previous Android versions, Applications may obtain privileges that were never granted to it. Internet access implicitly and irrevocably allowed: If the execution of an Android API call only requires permissions of level normal, it is enough for an application to list them as used on its manifest file to be allowed to perform such call.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-57
SLIDE 57

Motivation Introduction Specification Verification

Reasoning over the certified reference validation mechanism

Dangerous permissions must be explicitly granted: A non-grouped dangerous permission can only be explicitly granted to an application.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-58
SLIDE 58

Motivation Introduction Specification Verification

Reasoning over the certified reference validation mechanism

Dangerous permissions must be explicitly granted: A non-grouped dangerous permission can only be explicitly granted to an application. Revoked permissions must be regranted: If an application used to have a permission that was later revoked,

  • nly regranting it will allow the application to have it again.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-59
SLIDE 59

Motivation Introduction Specification Verification

Reasoning over the certified reference validation mechanism

Dangerous permissions must be explicitly granted: A non-grouped dangerous permission can only be explicitly granted to an application. Revoked permissions must be regranted: If an application used to have a permission that was later revoked,

  • nly regranting it will allow the application to have it again.

The right to start an external component is revocable: A running component may have the right of starting another one on a certain state, but may not be able to do so at a later time.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-60
SLIDE 60

Motivation Introduction Specification Verification

Reasoning over the certified reference validation mechanism

Dangerous permissions must be explicitly granted: A non-grouped dangerous permission can only be explicitly granted to an application. Revoked permissions must be regranted: If an application used to have a permission that was later revoked,

  • nly regranting it will allow the application to have it again.

The right to start an external component is revocable: A running component may have the right of starting another one on a certain state, but may not be able to do so at a later time. Delegated permissions are not recursively revoked: In Android 6 if a permission p is revoked for an application app not necessarily shall be revoked for the applications to which app delegated p.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-61
SLIDE 61

Motivation Introduction Specification Verification

Mitigating properties: Eavesdropping

Unauthorized information monitoring. In Android: when sensible information is sent as part of public broadcast messages.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-62
SLIDE 62

Motivation Introduction Specification Verification

Mitigating properties: Eavesdropping

Unauthorized information monitoring. In Android: when sensible information is sent as part of public broadcast messages. Lema If a component c which belongs to applicaiton a sends an intent of type broadcast protected by a permission of type signature or signature or system, then if a non-system application a′ wasn’t signed with the same permission as a, then it can’t receive it.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-63
SLIDE 63

Motivation Introduction Specification Verification

Development of a certified implementation

Certified implementation Implementation of Coq functions for each of the specified actions.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-64
SLIDE 64

Motivation Introduction Specification Verification

Development of a certified implementation

Certified implementation Implementation of Coq functions for each of the specified actions. Proof of soundness: functions implement the execution relation for each action.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-65
SLIDE 65

Motivation Introduction Specification Verification

Development of a certified implementation

Certified implementation Implementation of Coq functions for each of the specified actions. Proof of soundness: functions implement the execution relation for each action. Extraction of a Haskell program (command dispatcher) correct by construction.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-66
SLIDE 66

Motivation Introduction Specification Verification

The implementation

The step function and execution of install action

Definition step(s, a) := match a with | . . . → . . . | install app m c lRes → install safe(app, m, c, lRes, s) | . . . → . . . end. Definition install safe(app, m, c, lRes, s) : Result := match install pre(app, m, c, lRes, s) with | Some ec → {error(ec), s} | None → {ok, install post(app, m, c, lRes, s)} end.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-67
SLIDE 67

Motivation Introduction Specification Verification

Soundness

Theorem (Soundness of Android security system implementation)

∀ (s : AndroidST) (a : Action), valid state(s) → s ֒

a,step(s,a).resp

− − − − − − − − → step(s, a).st

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-68
SLIDE 68

Motivation Introduction Specification Verification

Soundness

Theorem (Soundness of Android security system implementation)

∀ (s : AndroidST) (a : Action), valid state(s) → s ֒

a,step(s,a).resp

− − − − − − − − → step(s, a).st

Lemma (Soundness of valid execution)

∀ (s : AndroidST) (a : Action), valid state(s) → Pre(s, a) → s ֒

a,ok

− − → step(s, a).st ∧ step(s, a).resp = ok

Lemma (Soundness of error execution)

∀ (s : AndroidST) (a : Action), valid state(s) → ¬Pre(s, a) → ∃ (ec : ErrorCode), step(s, a).st = s ∧ step(s, a).resp = error(ec) ∧ ErrorMsg(s, a, ec)

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-69
SLIDE 69

Motivation Introduction Specification Verification

Use of certified implementation

Haskell code Applying the program extraction mechanism provided by Coq we have derived a certified Haskell prototype of the reference validation mechanism (command dispatcher).

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-70
SLIDE 70

Motivation Introduction Specification Verification

Use of certified implementation

Haskell code Applying the program extraction mechanism provided by Coq we have derived a certified Haskell prototype of the reference validation mechanism (command dispatcher). Oracle Automatic generation of test cases for a real Android system based

  • n the model using the techniques of model-based testing,

incorporating the use of the oracle.

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-71
SLIDE 71

Motivation Introduction Specification Verification

A model based testing process

get output abstract output verify w.r.t. model set initial values run program generate abstract test cases from model refine test cases

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-72
SLIDE 72

Motivation Introduction Specification Verification

Questions?

Questions?

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017

slide-73
SLIDE 73

Motivation Introduction Specification Verification

Thank you!

Thank you!

Gustavo Betarte, Juan Campo, Felipe Gorostiaga, Carlos Luna LOPSTR 2017