CSC591-006 Smartphone OS Security Introduction Spring 2012 Prof. - - PowerPoint PPT Presentation

csc591 006 smartphone os security introduction
SMART_READER_LITE
LIVE PREVIEW

CSC591-006 Smartphone OS Security Introduction Spring 2012 Prof. - - PowerPoint PPT Presentation

CSC591-006 Smartphone OS Security Introduction Spring 2012 Prof. William Enck NC State -- Department of Computer Science Page 1 Why Study Smartphone Security? New platform / theyre popular / its a buzzword Resource constrained


slide-1
SLIDE 1

NC State -- Department of Computer Science Page

CSC591-006 Smartphone OS Security Introduction

Spring 2012

  • Prof. William Enck

1

slide-2
SLIDE 2

NC State -- Department of Computer Science Page

Why Study Smartphone Security?

  • New platform / they’re popular / it’s a buzzword
  • Resource constrained devices (still?)
  • Different (intensified?) security risks
  • The future of computing?

2

slide-3
SLIDE 3

NC State -- Department of Computer Science Page

This Course

  • This is a paper-based seminar course considering

smartphone operating systems and their security

  • Seminar-style: round-table discussions of scientific

papers led by a student moderator

  • OS Report: breadth study of top platforms (Android,

iOS, Windows Phone, and BlackBerry)

  • Research Project: students will complete a conference-

like paper

3

slide-4
SLIDE 4

NC State -- Department of Computer Science Page

Grading

  • Project: 40%
  • Smartphone OS Report: 15%
  • Class participation: 25%
  • Moderating+Presentations: 10%
  • Paper critiques: 10%

4

slide-5
SLIDE 5

NC State -- Department of Computer Science Page

Paper Critiques

  • We will discuss one or two papers every class
  • Critiques are due by noon the day of class
  • Graded as “satisfactory,” “satisfactory-”, “satisfactory+”
  • Need a “satisfactory” average to pass the class
  • Identify:
  • Three technical strengths
  • Three technical weaknesses
  • For each strength/weakness:
  • Identify it and support it by arguments
  • Late Policy:
  • Four 1-day extensions
  • Drop up to 4 summaries

5

slide-6
SLIDE 6

NC State -- Department of Computer Science Page

Paper Moderating

  • Assigned moderators will make a brief (5-7 minute)

presentation (template on Moodle)

  • Proposes three discussion questions
  • Breakout roundtable discussions for about 10 mins
  • Groups of three (changes every class)
  • “All hands” discussion for about 15 mins

6

slide-7
SLIDE 7

NC State -- Department of Computer Science Page

Selecting Papers to Moderate

  • Everyone must go once before anyone goes twice
  • Paper discussions start next week
  • Email me 5 top choices by next class
  • I will make assignments
  • If a paper isn’t desired by anyone, I’ll pick someone

7

slide-8
SLIDE 8

NC State -- Department of Computer Science Page

OS Reports

  • Class broken into four teams (decided today!)
  • Android, iOS, BlackBerry, Windows Phone
  • Written Report (Prelim)
  • Oral Presentation
  • Written Report (Final)
  • Application environment
  • Security Framework
  • Conclude with at least three positive and three negative

critiques of the security framework.

8

slide-9
SLIDE 9

NC State -- Department of Computer Science Page

Research Projects (Proposal)

  • 3-5 page project description (Written in LaTeX)
  • Section 1: Introduction
  • Section 2: Approach
  • Section 3: Deliverables
  • Section 4: Schedule
  • References
  • Groups of one or two (with approval)
  • Oral presentations (~10 mins)

9

slide-10
SLIDE 10

NC State -- Department of Computer Science Page

Project Status Report

  • Early draft of your final report
  • Should have well written: abstract, introduction, overview of

approach.

  • Protocol/Architecture/Design should have some technical

detail and a high-level architecture

  • Placeholders for remaining sections
  • Related work should be near complete

10

slide-11
SLIDE 11

NC State -- Department of Computer Science Page

Final Project Report

  • 8-10 pages (11pt)
  • Suggested outline:
  • Abstract
  • Introduction
  • Overview of Approach
  • Protocol/Architecture/

Design/...

  • Evaluation
  • Discussion
  • Related Work
  • Conclusions
  • References
  • Final Presentation
  • ~20 mins (depending on

number of projects)

  • 5 mins Q&A

11

slide-12
SLIDE 12

NC State -- Department of Computer Science Page

OS Report Teams

12

slide-13
SLIDE 13

NC State -- Department of Computer Science Page

Quick Android Primer

13

slide-14
SLIDE 14

NC State -- Department of Computer Science Page

Android Phones

  • An Android contains a number of

“applications”

  • Android comes installed with a number of

basic systems tools, e.g., dialer, address book, etc.

  • Developers use the Android API to

construct applications.

  • All apps are written in Java and executed

within a custom Java virtual machine.

  • Each application package is contained in a

jar file (.apk)

  • Applications are installed by the user
  • No “app store” required, just build and go.
  • Open access to data and voice services

14

slide-15
SLIDE 15

NC State -- Department of Computer Science Page

Architecture

  • The Android smartphone operating system is built upon Linux

and includes many libraries and a core set of applications.

  • The middleware makes it interesting
  • Not focused on UNIX processes
  • Uses the Binder component framework
  • Originally part of BeOS, then enhanced

by Palm, now used in Android

  • Applications consist of many

components of different types

  • Applications interact via components
  • We focus on security with respect to the component API

15

Phone Application Contacts Application Maps Application Android Middleware Linux

Reference Monitor Policy Binder Component Framework

slide-16
SLIDE 16

NC State -- Department of Computer Science Page

Component Model

  • While each application runs as its own UNIX uid,

sharing can occur through application-level interactions

  • Interactions based on components
  • Different component types
  • Activity
  • Service
  • Content Provider
  • Broadcast Receiver
  • Target component in the

same or different application

  • but first ...

16

Starting an Activity for a Result Activity Activity start return Communicating with a Service Activity callback Service call start/stop/bind Querying a Content Provider Activity Read/Write Query return Content Provider Receiving an Intent Broadcast System Activity Service Broadcast Receiver Send Intent

slide-17
SLIDE 17

NC State -- Department of Computer Science Page

Intents

  • Intents are objects used as inter-component signaling
  • Starting the user interface for an application
  • Sending a message between components
  • Starting a background service

17

slide-18
SLIDE 18

NC State -- Department of Computer Science Page

Activity Component

  • The user interface consists of a series of

Activity components.

  • Each Activity is a “screen”.
  • User actions tell an Activity to start

another Activity, possibly with the expectation of a result.

  • The target Activity is not necessarily in

the same application.

  • Directly or via Intent “action strings”.
  • Processing stops when another Activity is

“on top”.

18

slide-19
SLIDE 19

NC State -- Department of Computer Science Page

Service Component

  • Background processing occurs in Service components.
  • Downloading a file, playing music, tracking location, polling, etc.
  • Local vs. Remote Services (process-level distinction)
  • Also provides a “service” interface between applications
  • Arbitrary interfaces for data transfer
  • Android Interface Definition Language (AIDL)
  • Register callback methods
  • Core functionality often implemented

as Service components

  • e.g., Location API, Alarm service
  • Multiple interfaces
  • Control: start, stop
  • Method invocation: bind

19

slide-20
SLIDE 20

NC State -- Department of Computer Science Page

Content Provider Component

  • Content Provider components provide a standardized interface

for sharing data, i.e., content (between applications).

  • Models content in a relational DB
  • Users of Content Providers can perform

queries equivalent to SELECT, UPDATE, INSERT, DELETE

  • Works well when content is tabular
  • Also works as means of addressing “files”
  • URI addressing scheme
  • content://<authority>/<table>/[<id>]
  • content://contacts/people/10

20

slide-21
SLIDE 21

NC State -- Department of Computer Science Page

Broadcast Receiver Component

  • Broadcast Receiver components act as specialized event Intent

handlers (also think of as a message mailbox).

  • Broadcast Receiver components “subscribe”

to specific action strings (possibly multiple)

  • action strings are defined by the system or developer
  • component is automatically called by the system
  • Recall that Android provides automatic

Activity resolution using “action strings”.

  • The action string was assigned to an Intent object
  • Sender can specify component recipient (no action string)

21

slide-22
SLIDE 22

NC State -- Department of Computer Science Page

The Android Manifest

  • Manifest files are the technique for describing the contents
  • f an application package (i.e., resource file)
  • Each Android application has a special AndroidManifest.xml

file (included in the .apk package)

  • describes the contained components
  • components cannot execute unless they are listed
  • specifies rules for “auto-resolution”
  • specifies access rules
  • describes runtime dependencies
  • optional runtime libraries
  • required system permissions

22

slide-23
SLIDE 23

NC State -- Department of Computer Science Page

Manifest Specification

23

slide-24
SLIDE 24

NC State -- Department of Computer Science Page

Example Applications

  • FriendTracker Application
  • FriendTracker Service to poll for friend locations
  • Broadcasts an Intent when near a friend
  • FriendProvider Content Provider to store location of friends
  • Cross references friends with system Contacts Provider
  • FriendTrackerControl Activity to start and stop the Service
  • BootReceiver Broadcast Receiver to start the service on boot
  • FriendViewer Application
  • FriendViewer Activity to display list of friend locations
  • FriendMap Activity to show friends on a map (on right)
  • FriendReceiver Broadcast Receiver to display when near
  • Available from http://siis.cse.psu.edu/android_sec_tutorial.html

24

slide-25
SLIDE 25

NC State -- Department of Computer Science Page

Component Interaction

25

FriendTracker Application

FriendProvider BootReceiver FriendTracker Control FriendTracker

FriendViewer Application

FriendViewer FriendMap FriendReceiver

System Server

System Service

Contacts Application

ViewContact start/stop start read,write Broadcast Intent Broadcast Intent read read start start

slide-26
SLIDE 26

NC State -- Department of Computer Science Page

Defining Security Policy

  • Android focuses on Inter Component Communication (ICC)
  • The Android manifest file allows developers to define an

access control policy for access to components

  • Each component can be assigned an access permission label
  • Each application requests a list of permission labels (fixed at install)
  • Android’s security model boils down to the following:
  • However, there are a number of exceptions ...

26

Application 1

Permission Labels

l1,... A: ... Application 2

Permission Labels

... B: l1 C: l2 X

Inherit Permissions

slide-27
SLIDE 27

NC State -- Department of Computer Science Page

Public and Private Components

  • Exception: Components can be public or private.
  • Default is dependent on “intent-filter” rules
  • The manifest schema defines an “exported” attribute
  • Why: Protect internal components
  • Especially useful if a “sub-Activity” returns a result
  • e.g., FriendMap Activity in our example
  • Implication: Components may unknowingly be (or

become) accessible to other applications.

  • Best Practice: Always set the “exported” attribute.

27

slide-28
SLIDE 28

NC State -- Department of Computer Science Page

Implicitly Open Components

  • Exception: If the manifest file does not specify an access

permission on a public component, any component in any application can access it.

  • Why: Some components should provide “global” access
  • e.g., the main Activity for an Application
  • Permissions are assigned at install-time
  • Implication: Unprivileged applications have access
  • e.g., FriendReceiver in our example (spoof notification)
  • Best Practice: Components without access permissions should

be exceptional cases, and inputs must be scrutinized (consider splitting components).

28

slide-29
SLIDE 29

NC State -- Department of Computer Science Page

Implicitly Open Components

  • Exception: If the manifest file does not specify an access

permission on a public component, any component in any application can access it.

  • Why: Some components should provide “global” access
  • e.g., the main Activity for an Application
  • Permissions are assigned at install-time
  • Implication: Unprivileged applications have access
  • e.g., FriendReceiver in our example (spoof notification)
  • Best Practice: Components without access permissions should

be exceptional cases, and inputs must be scrutinized (consider splitting components).

28

slide-30
SLIDE 30

NC State -- Department of Computer Science Page

Intent Broadcast Permissions

  • Exception:

The code broadcasting an Intent can set an access permission restricting which Broadcast Receivers can access the Intent.

  • Why: Define what applications can read broadcasts
  • e.g., the FRIEND_NEAR message in our example
  • Implication: If no permission label is set on a

broadcast, any unprivileged application can read it.

  • Best Practice: Always specify an access permission on

Intent broadcasts (unless explicit destination).

29

slide-31
SLIDE 31

NC State -- Department of Computer Science Page

Intent Broadcast Permissions

  • Exception:

The code broadcasting an Intent can set an access permission restricting which Broadcast Receivers can access the Intent.

  • Why: Define what applications can read broadcasts
  • e.g., the FRIEND_NEAR message in our example
  • Implication: If no permission label is set on a

broadcast, any unprivileged application can read it.

  • Best Practice: Always specify an access permission on

Intent broadcasts (unless explicit destination).

29

slide-32
SLIDE 32

NC State -- Department of Computer Science Page

Pending Intents

  • Exception: PendingIntent objects allow another application to

“finish” an operation for you via RPC.

  • Introduced in the v0.9 SDK release (August 2008)
  • Execution occurs in the originating application’s “process” space
  • Why: Allows external applications to send to private components
  • Used in a number of system APIs (Alarm, Location, Notification)
  • e.g., timer in FriendTracker Service
  • Implication: The remote application can fill in unspecified values.
  • May influence the destination and/or data integrity
  • Allows a form of delegation
  • Best Practice: Only use Pending Intents as “delayed callbacks” to

private Broadcast Receivers/Activities and always fully specify the Intent destination.

30

slide-33
SLIDE 33

NC State -- Department of Computer Science Page

Pending Intents

  • Exception: PendingIntent objects allow another application to

“finish” an operation for you via RPC.

  • Introduced in the v0.9 SDK release (August 2008)
  • Execution occurs in the originating application’s “process” space
  • Why: Allows external applications to send to private components
  • Used in a number of system APIs (Alarm, Location, Notification)
  • e.g., timer in FriendTracker Service
  • Implication: The remote application can fill in unspecified values.
  • May influence the destination and/or data integrity
  • Allows a form of delegation
  • Best Practice: Only use Pending Intents as “delayed callbacks” to

private Broadcast Receivers/Activities and always fully specify the Intent destination.

30

slide-34
SLIDE 34

NC State -- Department of Computer Science Page

Content Provider Permissions

  • Exception: Content Providers have two additional security features
  • Separate “read” and “write” access permission labels
  • URI permissions allow record level delegation (added Sep 2008)
  • Why: Provide control over application data
  • e.g., FriendProvider uses read and write permissions
  • Implication: Content sharing need not be all or nothing
  • URI permissions allow delegation (must be allowed by Provider)
  • Best Practice: Always define separate read and write permissions.
  • Allow URI permissions when necessary

31

slide-35
SLIDE 35

NC State -- Department of Computer Science Page

Content Provider Permissions

  • Exception: Content Providers have two additional security features
  • Separate “read” and “write” access permission labels
  • URI permissions allow record level delegation (added Sep 2008)
  • Why: Provide control over application data
  • e.g., FriendProvider uses read and write permissions
  • Implication: Content sharing need not be all or nothing
  • URI permissions allow delegation (must be allowed by Provider)
  • Best Practice: Always define separate read and write permissions.
  • Allow URI permissions when necessary

31

slide-36
SLIDE 36

NC State -- Department of Computer Science Page

Service Hooks

  • Exception: A component (e.g., Service) may arbitrarily invoke

the checkPermission() method to enforce ICC.

  • Why: Allows Services to differentiate access to specific

methods.

  • e.g., .addNick() method of IFriendTracker
  • Implication: The application developer can add reference

monitor hooks

  • Best Practice: Use checkPermission() to mediate

“administrative” operations.

  • Alternatively, create separate Services

32

slide-37
SLIDE 37

NC State -- Department of Computer Science Page

Service Hooks

  • Exception: A component (e.g., Service) may arbitrarily invoke

the checkPermission() method to enforce ICC.

  • Why: Allows Services to differentiate access to specific

methods.

  • e.g., .addNick() method of IFriendTracker
  • Implication: The application developer can add reference

monitor hooks

  • Best Practice: Use checkPermission() to mediate

“administrative” operations.

  • Alternatively, create separate Services

32

slide-38
SLIDE 38

NC State -- Department of Computer Science Page

Protected APIs

  • Exception: The system uses permission labels to mediate access to

certain resource APIs

  • Why: The system needs to protect network and hardware

resources

  • e.g., Applications request the android.permission.INTERNET label

to make network connections.

  • Implication: Allows the system or a user to assess how

“dangerous” an application may be.

  • Best Practices: Judiciously request permissions for protected

APIs

33

slide-39
SLIDE 39

NC State -- Department of Computer Science Page

Permission Protection Levels

  • Exception: Permission requests are not always granted
  • Permissions can be:
  • normal - always granted
  • dangerous - requires user approval
  • signature - matching signature key
  • signature or system - same as signature, but also system apps
  • Why: Malicious applications may request harmful permissions
  • e.g., privacy implications of receiving FRIEND_NEAR
  • Implication: Users may not understand implications when

explicitly granting permissions.

  • Best Practice: Use signature permissions for application

“suites” and dangerous permissions otherwise

  • Include informative descriptions

34

slide-40
SLIDE 40

NC State -- Department of Computer Science Page

Permission Protection Levels

  • Exception: Permission requests are not always granted
  • Permissions can be:
  • normal - always granted
  • dangerous - requires user approval
  • signature - matching signature key
  • signature or system - same as signature, but also system apps
  • Why: Malicious applications may request harmful permissions
  • e.g., privacy implications of receiving FRIEND_NEAR
  • Implication: Users may not understand implications when

explicitly granting permissions.

  • Best Practice: Use signature permissions for application

“suites” and dangerous permissions otherwise

  • Include informative descriptions

34