upgrading approaches to the secure mobile architectures

52
Upgrading approaches to the secure mobile architectures #appbuilders16 @vixentael

Upload: stanfy

Post on 15-Apr-2017

153 views

Category:

Mobile


0 download

TRANSCRIPT

Page 1: Upgrading approaches to the secure mobile architectures

Upgrading approaches to the secure

mobile architectures

#appbuilders16 @vixentael

Page 2: Upgrading approaches to the secure mobile architectures

OR

Page 3: Upgrading approaches to the secure mobile architectures

Everything will be

BROKEN!

#appbuilders16 @vixentael

Page 4: Upgrading approaches to the secure mobile architectures

Everything will be

BROKEN,so what should we do?

#appbuilders16 @vixentael

Page 5: Upgrading approaches to the secure mobile architectures

Intro: this is a picture

Page 6: Upgrading approaches to the secure mobile architectures

This is a picture: virgin sight

networkbackend logic

the appserver

environment

#appbuilders16 @vixentael

Page 7: Upgrading approaches to the secure mobile architectures

UI/UX

deliver fast!

GTD!

swift

boring crap, waste of life 😂

🍭 maaaagic!

magic..

MVP!

#appbuilders16 @vixentael

This is a picture: mobile focus

Page 8: Upgrading approaches to the secure mobile architectures

source of trust

risk we control

sandboxdragons

lots of risk even if app is good

easy to f*ck up

#appbuilders16 @vixentael

This is a picture: security vision

Page 9: Upgrading approaches to the secure mobile architectures

#appbuilders16 @vixentael

This is a picture: the reality

FBI

CIA

NSA

hackers

QA engineers

Page 10: Upgrading approaches to the secure mobile architectures

the brains!

#appbuilders16 @vixentael

This is a picture: our control

Page 11: Upgrading approaches to the secure mobile architectures

The problem

Page 12: Upgrading approaches to the secure mobile architectures

The problembad cryptography

insecure API’s

plaintext traffic

data leakage

denial of serviceremote jailbreak over bluetooth

stolen credentialsman-in-the-middle

Page 13: Upgrading approaches to the secure mobile architectures

OpennessSpeed

Ignorance

The problem

#appbuilders16 @vixentael

Page 14: Upgrading approaches to the secure mobile architectures

How bad is it? Like thisControlNissanLEAFviavulnerableAPIs

http://www.troyhunt.com/2016/02/controlling-vehicle-features-of-nissan.html

#appbuilders16 @vixentael

http://www.wired.com/2015/07/gadget-hacks-gm-cars-locate-unlock-start/

http://samy.pl/defcon2015/

hackingcarsusingOnStarapptolocate,unlockandremote

startvehicles

what could possibly go wrong? 🤔

Page 15: Upgrading approaches to the secure mobile architectures
Page 16: Upgrading approaches to the secure mobile architectures

iMessage

RecoveryofPlaintextiMessageDatausingJavascripthttp://www.bishopfox.com/blog/2016/04/if-you-cant-break-crypto-break-the-client-recovery-of-plaintext-imessage-data/

GraballyouriMessaHachmentsviakeyenumeraIonhttp://blog.cryptographyengineering.com/2016/03/attack-of-

week-apple-imessage.html

#appbuilders16 @vixentael

Page 17: Upgrading approaches to the secure mobile architectures

This is how bad it is!

#appbuilders16 @vixentael

iOS vulnerabilities by yearsrawdatafromcvedetails.com

0

100

200

300

400

2007 2008 2009 2010 2011 2012 2013 2014 2015

1 9 27 32 37

11290

120

384

Page 18: Upgrading approaches to the secure mobile architectures

This is how bad it is!

http://blog.mindedsecurity.com/2015/03/ssl-mitm-attack-in-afnetworking-251-do.html

>1500vulnerableappsviaflawedAFNetworking

<10%popularappsuseSSLpinning

#appbuilders16 @vixentael

iOS vulnerabilities by yearsrawdatafromcvedetails.com

0

100

200

300

400

2007 2008 2009 2010 2011 2012 2013 2014 2015

1 9 27 32 37

11290

120

384

Page 19: Upgrading approaches to the secure mobile architectures

SO WHAT?

Page 20: Upgrading approaches to the secure mobile architectures

Why does this even happen?

Page 21: Upgrading approaches to the secure mobile architectures

Our mindset is wrong a bit

“It works” !=

“It’s secure”

Mobile’s limited abilities require specific server behaviorMobile is not

traditional client-server

Design-driven development is frequently a security

disaster

#appbuilders16 @vixentael

Page 22: Upgrading approaches to the secure mobile architectures

Mobile is an odd thin client

#appbuilders16 @vixentael

–CanserverreallyaddressyoubyIPaddress?–CanserverexpectRFCbehaviorofyourIPstack?–Canserverandclientsharecodeandcomponentswithpropertrust?–IsIPC/RPCbehaviorreciprocalbetweenclientandserver?–Isclientandserverequalintheircapacityfortechnicaldecisions?

Mobile considers itself in a proper client-server relationship, but:

Page 23: Upgrading approaches to the secure mobile architectures

Mobile is an odd thin client

#appbuilders16 @vixentael

–CanserverreallyaddressyoubyIPaddress?–CanserverexpectRFCbehaviorofyourIPstack?–Canserverandclientsharecodeandcomponentswithpropertrust?–IsIPC/RPCbehaviorreciprocalbetweenclientandserver?–Isclientandserverequalintheircapacityfortechnicaldecisions?

Mobile considers itself in a proper client-server relationship, but:

NOPE ;)

Page 24: Upgrading approaches to the secure mobile architectures

Mobile security is hard and yet undeveloped

#appbuilders16 @vixentael

Sophisticated problems security-wise

No well established techniques

Very blurred risk models

Page 25: Upgrading approaches to the secure mobile architectures

What exactly are we risking?

Page 26: Upgrading approaches to the secure mobile architectures

IdentityDataControl

What we risk?

#appbuilders16 @vixentael

Page 27: Upgrading approaches to the secure mobile architectures

Data

#appbuilders16 @vixentael

personal data

health data

conversations

certificates

passwords

contacts

users’ data

Page 28: Upgrading approaches to the secure mobile architectures

Identity

#appbuilders16 @vixentael

identification (credentials)

attacker

access allowed!

application

Page 29: Upgrading approaches to the secure mobile architectures

Control

#appbuilders16 @vixentael

Remember those cars, right?

Page 30: Upgrading approaches to the secure mobile architectures

What should we do?

Page 31: Upgrading approaches to the secure mobile architectures

Understand the strong sides

#appbuilders16 @vixentael

limitedecosystemlow collateral risk 📉

thingsuserhasandyoucantrust

authentication/trust 🔒

isquitegooddata safety 🛡

almostnetworkpassive

narrowed threat scope 🔍

💪 💪

Page 32: Upgrading approaches to the secure mobile architectures

Trust no one. But yourself

#appbuilders16 @vixentael

trust server less

explicit trust

involve users💔👫☁🌪

Page 33: Upgrading approaches to the secure mobile architectures

Echelonization

#appbuilders16 @vixentael

if the system has one perimeter,

it will fail!

Page 34: Upgrading approaches to the secure mobile architectures

Echelonization

#appbuilders16 @vixentael

authenticate manually verify credentials use many factors

..add more layers of defense!

Page 35: Upgrading approaches to the secure mobile architectures

Compartmentalization

#appbuilders16 @vixentael

limit the access to information to those who need to know it

in order to perform certain tasks

storesecuretransmit

display

Page 36: Upgrading approaches to the secure mobile architectures

SO WHAT?

Page 37: Upgrading approaches to the secure mobile architectures

Practice time!techniques for your

architectures

Page 38: Upgrading approaches to the secure mobile architectures

Do all classic things

#appbuilders16 @vixentael

https://speakerdeck.com/vixentael/avoiding-damage-shame-and-regrets-data-protection-for-mobile-client-server-architectures

Protect transport well, authenticate server, pin certificates

Authenticate everythingEncrypt everything in motion and at rest

Protect keys well

Then escalate with novel techniques

read my previous slides

Page 39: Upgrading approaches to the secure mobile architectures

End-to-end encryption 101

#appbuilders16 @vixentael

users own all keys server can’t see anything important transport keys are ephemeral app state does not rely on server state ☁🤓 👸🔒

🔒

Page 40: Upgrading approaches to the secure mobile architectures

End-to-end encryption 101+1

#appbuilders16 @vixentaelhttps://cossacklabs.com/choose-your-ios-crypto.htmllarge + text

Page 41: Upgrading approaches to the secure mobile architectures

Multi-factor authentication

#appbuilders16 @vixentael

things you have things you know things you arephonedevice

simcardIDdocs

private/publickey

passwordaddress

answertoquesIon

biometricsofallkinds

Page 42: Upgrading approaches to the secure mobile architectures

Multi-factor authentication

#appbuilders16 @vixentael

things you have things you know things you arephonedevice

simcardIDdocs

private/publickey

passwordaddress

answertoquesIon

biometricsofallkinds

2+ = MFA

&& &&

Page 43: Upgrading approaches to the secure mobile architectures

Zero-knowledge: problemno trust :(

#appbuilders16 @vixentael

Page 44: Upgrading approaches to the secure mobile architectures

Zero-knowledge: proof!trust :)

#appbuilders16 @vixentaelhttps://cossacklabs.com/introducing_secure_comparator.htmlwanna know more?

Page 45: Upgrading approaches to the secure mobile architectures

Is this it?

Page 46: Upgrading approaches to the secure mobile architectures

Combining things: secure app v.1

SSL

storage encryption

storage encryption

data leakageMiTM weak SSL

#appbuilders16 @vixentael

Page 47: Upgrading approaches to the secure mobile architectures

Combining things: secure app v.2end-to-end encryption

#appbuilders16 @vixentael

storage encryption

storage encryption

🗝🗝

🗝

🗝 🗝

weak authblind trust

ephemeral keys

protected transport

Page 48: Upgrading approaches to the secure mobile architectures

Combining things: secure app v.3

#appbuilders16 @vixentael

end-to-end encryptionstorage

encryptionstorage

encryption

ephemeral keys

protected transport

MFA

🗝🗝

🗝

ZKP

Page 49: Upgrading approaches to the secure mobile architectures

It is simple, isn’t it?

Page 50: Upgrading approaches to the secure mobile architectures

Key points

#appbuilders16 @vixentael

1. read these slides again, tapping on links 2. read ‘Additional reading’ 3. read my previous presentations 4. analyze your current system 5. implement the techniques 6. ??? 7. profit!

…feel free to contact me

Page 51: Upgrading approaches to the secure mobile architectures

Thank you for listening

@vixentael iOSdeveloperatstanfy.com

iOScontributoratThemis/cossacklabs.com

Page 52: Upgrading approaches to the secure mobile architectures

Additional reading

https://medium.com/stanfy-engineering-practices/data-protection-for-mobile-client-server-architectures-6e6dcabd871a

Data Protection For Mobile Client-Server Architectures

http://mashable.com/2016/04/16/apple-security-explained/How Apple Security works

https://www.cossacklabs.com/avoid-ssl-for-your-next-app.htmlWhy you should avoid ssl for your next application

https://cossacklabs.com/choose-your-ios-crypto.htmlCrypto in iOS: choose your destiny

https://www.owasp.org/index.php/IOS_Application_Security_Testing_Cheat_SheetOWASP: iOS application security testing cheat sheet