31
http://www.egeniq.com [email protected] @egeniq Droidcon, 23 November 2011 Ivo Jansch - @ijansch Apps, APIs and third party services A Love Triangle

Apps, apis, third party services (Droidcon)

Embed Size (px)

DESCRIPTION

In this talk I talked about my experiences with Android security when it comes to storing secrets in apps on the device. It uses oauth as an example but contained practical hints on how to store any secret securely. Presented at DroidconNL in Amsterdam, November 23 2011.

Citation preview

Page 1: Apps, apis, third party services (Droidcon)

http://[email protected]

@egeniq

Droidcon, 23 November 2011Ivo Jansch - @ijansch

Apps, APIs and third party servicesA Love Triangle

Page 2: Apps, apis, third party services (Droidcon)

About Me

@ijanschDeveloperAuthorEntreprenerdiOS/Java/PHP

2

Page 3: Apps, apis, third party services (Droidcon)

About Egeniq

StartupMobileTechKnowledge GeeksDevelopment

3

Page 4: Apps, apis, third party services (Droidcon)

Tiqr - Learning about Android Security

4

1

23

4

5

6

http://www.tiqr.org

Page 5: Apps, apis, third party services (Droidcon)

The Use Case

5

Android App Third Party Service

API

Page 6: Apps, apis, third party services (Droidcon)

Timeline

6

Page 7: Apps, apis, third party services (Droidcon)

OAuth

7

Your AndroidApplication Twitter

Page 8: Apps, apis, third party services (Droidcon)

OAuth

8

OAuthConsumer

OAuthProvider

Page 9: Apps, apis, third party services (Droidcon)

Why do you need to protect keys?

98

OAuthProvider

Page 10: Apps, apis, third party services (Droidcon)

The Android Security Model

10

Page 11: Apps, apis, third party services (Droidcon)

Sandboxing

‣Apps only have access to their own data‣Access is based on Linux user ID‣Further protected by application signature

11

Page 12: Apps, apis, third party services (Droidcon)

Storage + Secure Storage

‣USB Storage• External storage, sharable between apps

‣Device Storage • Apps have their own location, within sandbox

‣Secure Storage• Java KeyStores with strong encryption algorithms• Unfortunately no hardware encrypted storage like iPhone

12

Page 13: Apps, apis, third party services (Droidcon)

The Main Problem

‣How can I securely store secrets?• Is sandboxing a solution? -> Not when device is rooted• Is device storage a solution? -> Not when device is rooted• Is encryption a solution?‣ Yes, but where do you store your encryption keys?

13

Page 14: Apps, apis, third party services (Droidcon)

It’s a common question

Stackoverflow search for ‘store secrets android’:

14

Page 15: Apps, apis, third party services (Droidcon)

With common answers

- Huh? - Don’t store secrets- Don’t use OAuth

- Obfuscate- Encrypt

15

Page 16: Apps, apis, third party services (Droidcon)

Know what? I’ll just use a library

16

Page 17: Apps, apis, third party services (Droidcon)

Scribe

https://github.com/fernandezpablo85/scribe-java

17

Page 18: Apps, apis, third party services (Droidcon)

A Couple Of Solutions

18

Page 19: Apps, apis, third party services (Droidcon)

Option 1 - Obfuscation

19

Page 20: Apps, apis, third party services (Droidcon)

Option 2 - Encryption

20

Page 21: Apps, apis, third party services (Droidcon)

Option 2 - Encryption

21

Page 22: Apps, apis, third party services (Droidcon)

Option 2 - Encryption

22

Page 23: Apps, apis, third party services (Droidcon)

Option 2 - Encryption

23

Page 24: Apps, apis, third party services (Droidcon)

Option 3 - Using the KeyStore

24

Page 25: Apps, apis, third party services (Droidcon)

Option 3 - Using the KeyStore

25

Page 26: Apps, apis, third party services (Droidcon)

Option 4 - Retrieve key from API

26

Android App OAuthProvider

Your API

?

Page 27: Apps, apis, third party services (Droidcon)

Option 5 - Transparent Proxy

27

AndroidApp

OAuthProvider

Proxy

Page 28: Apps, apis, third party services (Droidcon)

Conclusion

It’s all about

awareness

28

Page 29: Apps, apis, third party services (Droidcon)

Recommended Reading

‣ ISBN: 2147483647

‣ Authors:• Himanshu Dwivedi

• Chris Clark

• David Thiel

‣ Covers:• Android

• Apple

• WinMo

29

Page 31: Apps, apis, third party services (Droidcon)

Credits

‣ ‘Tege in Sandbox’ by Judi Cox - http://www.flickr.com/photos/madaise/3406217980/

‣ ‘Locker (KHS up close) by Travis Hymas - http://www.flickr.com/photos/travishasphotos/3481640534/

‣ ‘Mask’ by Ben Fredericson - http://www.flickr.com/photos/xjrlokix/3932488768/