security best practices for mobile development @ dreamforce 2013

Post on 15-Jan-2015

6.961 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

The slide deck from my Mobile Security session from Dreamforce 2013

TRANSCRIPT

Security Best Practices for Mobile DevelopmentSecurity Best Practices for Mobile Development

Tom Gersic, Salesforce.com

Director, Mobile Services Delivery

@tomgersic

Safe harborSafe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Tom GersicTom Gersic

Director, Mobile Services Delivery

@tomgersic

Director, Mobile Services Delivery

@tomgersic

Agenda

• Fundamental Principles

• What iOS and Android Share

• iOS Specific Characteristics

• Android Specific Characteristics

• Salesforce Mobile Offerings

Who thinks the data on their phone is secure?

Everything on my iPhone is encrypted because I use a PIN code.

Is this a true Statement?

Anybody here use Facebook?

Improved in iOS7, though

What about Salesforce 1?

Fundamental Security Principles

Vulnerability

Threat

Consequence

Mitigation

Separation of Concerns – Principle of Least Privilege

Security Stack

Real life examples

Libtiff Image Exploit / Jailbreak• iPhone 1 – patched in 1.1.2

• Tiff buffer overflow

• Nothing to prevent executing code on the heap

• Gained root access from viewing an image on the web

ASLR (PIE) and DEP

iOS 7 Lock Screen Bypass

Fingerprint Hacking

“Bluebox uncovers Android Master Key -- 2013”

Concatenated SMS Exploit – Charlie Miller

Concatenated SMS Exploit

• Takes 519 SMS messages – all but 1 is invisible

• Send message -1 of X to underflow the array buffer

• Can’t be stopped by the user

• Used to write an entire binary executable to the heap, and run

it, taking over the phone.

NFC Exploit

But most of the time…

Data Security – Hardware Encryption

Requires PIN/Passcode on both iOS and Android

On iOS, apps opt-in

Supported on iPhone 3GS w/ iOS v4+ (AES 256 bit)

Android Honeycomb+ (AES 128 bit)• Some manufacturers increase to AES 256 bit (Samsung SAFE)

SD Card encryption on Android is manufacturer specific.

App Security

Layers of Defense

Application Signing

Application Sandboxing

iOS Sandbox• All apps (Apple’s and App Store) run as “mobile” user.

• Sandboxing is bolted on -- handled via XNU Sandbox

“Seatbelt” kernel extension.

• Applications run in separate subdirectories of

/private/var/mobile/Applications

• Any app in this directory is loaded with “container”

(sandboxed) profile.

Android Sandbox

• Uses underlying Linux security model

• Every app runs as a separate user

• Apps signed by the same developer can run as the same user, if desired

(not the default, though)

• Every app runs in its own instance of the Android Runtime (Dalvik Virtual

Machine)

• Like iOS, every app has its own directory structure

• SD Card, though, is generally public – accessible to all apps and

unencrypted unless manufacturer has added encryption (Samsung SAFE)

Background Processing

iOS 7 Backgrounding

Background Processes / App Interaction

Types of Android Components

Activities

Intent

Service

Content Provider

Broadcast Receiver

Public / Private Components

But what about custom keyboards?

Keyboard Security Risks

Except Passwords?

https://github.com/tomgersic/AndroidKeyLogger

Permissions

Mitigation

Static Analysis Tools

Application Encryption

• Encrypt your data yourself using PIN / Passcode

• CoreData/SQLCipher NSIncrementalStore

Good Dynamics

• FMDB/SQLCipher Salesforce Smartstore

Jailbreak Detection

• Sandbox integrity check: fork() should fail

• Check for jailbreak files: /Applications/Cydia.app

/Library/MobileSubstrate/MobileSubstrate.dylib

/var/cache/apt

/bin/sh

/bin/bash

In-App Encryption

Customer DataSalesforce.com Mobile SDK

SmartStore Stack

Enable ASLR in your app

• ASLR: Address Space Layout Randomization

Stack Canaries

• AKA Stack Smashing Protection

• Protect against buffer overflows

• Places random known value (canary) before local variables

• Use Apple LLVM – won’t work with LLVM GCC

Hide Data from App Snapshot Images

Who STILL thinks the data on their phone is secure?

Tom GersicTom Gersic

Director, Mobile Services Delivery@tomgersic

@tomgersic

top related