SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
SECURE YOUR APP
FIGHT THE LEAKS!
DROIDCON PARIS 2013
EYAL LEZMY
Slides http://bit.ly/droidcon-sec
http://eyal.fr
ANDROID PRESALES ENGINEER, SAMSUNG B2B
TREASURER AT PARIS ANDROID USER GROUP
ANDROID GOOGLE DEVELOPER EXPERT
DON'T LET HIM DOWN
THE USER TRUSTS YOU
Company
Copyright © 1995-2012 SAMSUNG All rights reserved
APPS HAVE TO RESPECT THE DATA
Different ways to unintentionally grant other apps access to the
data inside your application :
Exporting an unprotected component
Storing personal data in a world readable file
Logging personal data in logcat logs
Copyright © 1995-2012 SAMSUNG All rights reserved
It declares accessible app components
Activity, Service, Receive,...
Adding <intent-filter>
=> your element is exported by default
CHECK YOUR ANDROIDMANIFEST.XML
ContentProvider is always exported by default,
until android:targetSdkVersion="17"
Copyright © 1995-2012 SAMSUNG All rights reserved
Don't export app components unless you want to share their
content with other applications
<application android:label="@string/app_name">
…
<service android:name=".ServiceExample“
android:exported="false">
<intent-filter>
…
</intent-filter>
</service>
…
</application>
What is your legitimity to
expose data?
CHECK YOUR ANDROIDMANIFEST.XML
Copyright © 1995-2012 SAMSUNG All rights reserved
There are different permission protection levels:
normal Lower risk permission
dangerous Higher risk, access to user private data,
potential negative impact
signature Needs the same certificate signature
PERMISIONS
Copyright © 1995-2012 SAMSUNG All rights reserved
Lets look at the code:
<permission android:name="com.example.EXAMPLE_PERM“
android:label="@string/example_perm_l“
android:description="@string/example_perm_d“
android:icon="@drawable/example_perm_i“
android:protectionLevel="signature" />
...
<service android:name=".ServiceExample“
android:permission="com.example.EXAMPLE_PERM">
<intent-filter>...</intent-filter>
</service>
PERMISIONS
Copyright © 1995-2012 SAMSUNG All rights reserved
Don't be the weakest link
private boolean checkPermission(Context context)
{
String permission = "com.example.EXAMPLE_PERM";
int res = context.checkCallingPermission(permission);
return (res == PackageManager.PERMISSION_GRANTED);
}
PERMISIONS
Always check the permission of a caller if you use your permission
Copyright © 1995-2012 SAMSUNG All rights reserved
DISABLE USELESS ACTIVITIES
Fit your components lifecycle to your application's lifecycle
If before configuration (login, account creation, ...) a service or
activity is not useful, disable it
If your application handles common implicit Intent's actions like
ACTION_VIEW or ACTION_SEND consider disabling it by default
Copyright © 1995-2012 SAMSUNG All rights reserved
PackageManager.setComponentEnabledSetting(componentName,
newState, flags);
DISABLE USELESS ACTIVITIES
<activity
android:name="com.example.Activity"
android:label="@string/app_name"
android:enabled="false">
</activity>
Disabled:
Enabled:
Copyright © 1995-2012 SAMSUNG All rights reserved
STORING DATA WISELY
Protect personal data using MODE_PRIVATE for data files,
shared preferences, and databases:
openFileOutput()
openSharedPreferences()
openOrCreateDatabase()
External storage (sdcard) is shared storage
Copyright © 1995-2012 SAMSUNG All rights reserved
PLEASE... SHUT THE FUCK UP!
public static final boolean SHOW_LOG = BuildConfig.DEBUG;
public static void d(final String tag, final String msg) {
if (SHOW_LOG)
Log.d(tag, msg);
}
Don't expose data through logcat on production
Detect the build mode with BuildConfig.DEBUG
Be careful about this subject and test it during QA
Copyright © 1995-2012 SAMSUNG All rights reserved
PROTECTING APP FROM USERS
No more android:debuggable on the manifest
Don't leave this enabled in release code!
ADT 8.0+ do it for you automatically
Copyright © 1995-2012 SAMSUNG All rights reserved
$ adb shell
shell@android:/ $ run-as com.android.example sh
shell@android:/data/data/com.android.example $ id
uid=10060(app_60) gid=10060(app_60)
shell@android:/data/data/com.android.example $ ls
files/secret_data.txt
shell@android:/data/data/com.android.example $
cat files/secret_data.txt
PROTECTING APP FROM USERS
IT'S NOT JUST ABOUT YOUR APP
INSECURE NETWORK
LOST OR STOLEN DEVICES
Copyright © 1995-2012 SAMSUNG All rights reserved
Free certified SSL: https://www.startssl.com/
USE SAFE NETWORKING
HTTPS and SSL can protect against Man in the Middle attacks and
prevent casual snooping
Server certificate validity must be correctly checked
"15% of apps have weak or bad SSL implementation on the Play Store"
Copyright © 1995-2012 SAMSUNG All rights reserved
...but it may help discouraging curious.
Use a peer-reviewed library like KeyCzar
Take care of the key :
Create it at first start, with true random
Or grab a user key from your server
Or ask the user for a passphrase you won't store
DATA ENCRYPTION DOESN'T SOLVE ALL PROBLEMS
Copyright © 1995-2012 SAMSUNG All rights reserved
On a corporate environment, device administration can be
considered
Password management
Device encryption
Disable camera
Lock the device
Remote wipe
DEVICE ADMINISTRATION
Copyright © 1995-2012 SAMSUNG All rights reserved
BEHIND THE STAGE
The APK's content is always world readable, take care about
what you put inside
Sensitive files should be kept out of the APK
Java is open source, your code too
Using Proguard takes a single line of code
Or...
Dex encryption
AAPT modified
Logic on server
IT'S NOT JUST ABOUT SECURITY
THINK ABOUT POLITICS...
Copyright © 1995-2012 SAMSUNG All rights reserved
THE SECURITY PARADOX
Copyright © 1995-2012 SAMSUNG All rights reserved
"The more secure you make something,
the less secure it becomes"
Level the security following the user acceptance or...
Users will find workarounds
Users won't use your service
NEVER FORGET THE USER, NEVAAAAA!
Copyright © 1995-2012 SAMSUNG All rights reserved
REFERENCES
Google I/O 2012 Sessions
Android Developpers Live Youtube channel
Android Developement
Android Developement: Using Cryptography
The Commons Blog
InformationWeek: Security Paradox
ThreatPost: SLL implementation on Android apps
StartSSL Free certificates
SAMSUNG SMART APP CHALLENGE 2013
SAMSUNG SMART APP CHALLENGE 2013
A Global app challenge
Apps for the Galaxy S4
Use of Samsung Chord SDK
Apply June 20 - August 31
www.smartappchallenge.com
$800,000 for 10 winners
SAMSUNG DEVELOPERS
SDKs and Documentation
http://developer.samsung.com
Samsung Chord SDK
Bluetooth Low Energy SDK
Remote Test Lab
Test your applications on real devices through the internet
Free
24H 365 Days
S Pen & Multi Window SDK
AllShare Framework
Real Device,
NOT emulator
Multiple
Devices
THANK YOU!
Slides http://bit.ly/droidcon-sec
http://eyal.fr

Mais conteúdo relacionado

Destaque

ว ธ สร_างบล_อกก_บ blogger
ว ธ สร_างบล_อกก_บ bloggerว ธ สร_างบล_อกก_บ blogger
ว ธ สร_างบล_อกก_บ bloggerNuumint
 
SEO Training in Mahabubnagar
SEO Training in MahabubnagarSEO Training in Mahabubnagar
SEO Training in MahabubnagarSubhash Malgam
 
Digital marketing presentation
Digital marketing presentationDigital marketing presentation
Digital marketing presentationSubhash Malgam
 
เทคน คการส บค_นบน google
เทคน คการส บค_นบน googleเทคน คการส บค_นบน google
เทคน คการส บค_นบน googleNuumint
 
seo training in mahabubnagar
seo training in mahabubnagarseo training in mahabubnagar
seo training in mahabubnagarSubhash Malgam
 
Introduction to Donaldson and Company
Introduction to Donaldson and CompanyIntroduction to Donaldson and Company
Introduction to Donaldson and Companythaistartupreview
 
Ppt tekpen wiwin
Ppt tekpen  wiwinPpt tekpen  wiwin
Ppt tekpen wiwinwiwin_dari
 
ข นตอนการต_ดต__ง โปรแกรม windows 8 บน vmware
ข  นตอนการต_ดต__ง โปรแกรม windows  8 บน vmwareข  นตอนการต_ดต__ง โปรแกรม windows  8 บน vmware
ข นตอนการต_ดต__ง โปรแกรม windows 8 บน vmwareNuumint
 
HospiX: The Hospital Exploring Application for Smart Devices
HospiX: The Hospital Exploring Application for Smart DevicesHospiX: The Hospital Exploring Application for Smart Devices
HospiX: The Hospital Exploring Application for Smart DevicesVishvi Vidanapathirana
 
Managementbijeenkomst ktv
Managementbijeenkomst ktvManagementbijeenkomst ktv
Managementbijeenkomst ktvJulian Laan
 
Future tense
Future tenseFuture tense
Future tenseIsnaini22
 
การศ กษาและค นคว_าอ_สละ
การศ กษาและค นคว_าอ_สละการศ กษาและค นคว_าอ_สละ
การศ กษาและค นคว_าอ_สละNuumint
 
3 neomezená veřejná zakázka
3 neomezená veřejná zakázka3 neomezená veřejná zakázka
3 neomezená veřejná zakázkaondrejbaarcz
 
Ppt uas admin maya
Ppt uas admin mayaPpt uas admin maya
Ppt uas admin mayamaya38
 

Destaque (19)

ว ธ สร_างบล_อกก_บ blogger
ว ธ สร_างบล_อกก_บ bloggerว ธ สร_างบล_อกก_บ blogger
ว ธ สร_างบล_อกก_บ blogger
 
SEO Training in Mahabubnagar
SEO Training in MahabubnagarSEO Training in Mahabubnagar
SEO Training in Mahabubnagar
 
Digital marketing presentation
Digital marketing presentationDigital marketing presentation
Digital marketing presentation
 
เทคน คการส บค_นบน google
เทคน คการส บค_นบน googleเทคน คการส บค_นบน google
เทคน คการส บค_นบน google
 
seo training in mahabubnagar
seo training in mahabubnagarseo training in mahabubnagar
seo training in mahabubnagar
 
Introduction to Donaldson and Company
Introduction to Donaldson and CompanyIntroduction to Donaldson and Company
Introduction to Donaldson and Company
 
Ppt tekpen wiwin
Ppt tekpen  wiwinPpt tekpen  wiwin
Ppt tekpen wiwin
 
ข นตอนการต_ดต__ง โปรแกรม windows 8 บน vmware
ข  นตอนการต_ดต__ง โปรแกรม windows  8 บน vmwareข  นตอนการต_ดต__ง โปรแกรม windows  8 บน vmware
ข นตอนการต_ดต__ง โปรแกรม windows 8 บน vmware
 
2
22
2
 
HospiX: The Hospital Exploring Application for Smart Devices
HospiX: The Hospital Exploring Application for Smart DevicesHospiX: The Hospital Exploring Application for Smart Devices
HospiX: The Hospital Exploring Application for Smart Devices
 
Narkoba
NarkobaNarkoba
Narkoba
 
e-commerse website
e-commerse websitee-commerse website
e-commerse website
 
Blogger
BloggerBlogger
Blogger
 
Managementbijeenkomst ktv
Managementbijeenkomst ktvManagementbijeenkomst ktv
Managementbijeenkomst ktv
 
Future tense
Future tenseFuture tense
Future tense
 
Newton and feynman
Newton and feynmanNewton and feynman
Newton and feynman
 
การศ กษาและค นคว_าอ_สละ
การศ กษาและค นคว_าอ_สละการศ กษาและค นคว_าอ_สละ
การศ กษาและค นคว_าอ_สละ
 
3 neomezená veřejná zakázka
3 neomezená veřejná zakázka3 neomezená veřejná zakázka
3 neomezená veřejná zakázka
 
Ppt uas admin maya
Ppt uas admin mayaPpt uas admin maya
Ppt uas admin maya
 

Semelhante a Droidcon secureyourapp fighttheleaks-samsung

Using APEX to Create a Mobile User Interface for Enterprise Manager 12c
Using APEX to Create a Mobile User Interface for Enterprise Manager 12cUsing APEX to Create a Mobile User Interface for Enterprise Manager 12c
Using APEX to Create a Mobile User Interface for Enterprise Manager 12cGokhan Atil
 
Java Solutions for Securing Edge-to-Enterprise
Java Solutions for Securing Edge-to-EnterpriseJava Solutions for Securing Edge-to-Enterprise
Java Solutions for Securing Edge-to-EnterpriseEric Vétillard
 
First Steps with Java Card
First Steps with Java CardFirst Steps with Java Card
First Steps with Java CardEric Vétillard
 
Security - Part II.pdf
Security - Part II.pdfSecurity - Part II.pdf
Security - Part II.pdfShaiAlmog1
 
Introduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiIntroduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiBruno Borges
 
MobilizeUrApps - Android Application Development
MobilizeUrApps - Android Application DevelopmentMobilizeUrApps - Android Application Development
MobilizeUrApps - Android Application Developmentmobilizeurapps
 
Security Tips for Android App - iTrobes
Security Tips for Android App - iTrobesSecurity Tips for Android App - iTrobes
Security Tips for Android App - iTrobesiTrobes
 
DDS + Android = OpenSplice Mobile
DDS + Android = OpenSplice MobileDDS + Android = OpenSplice Mobile
DDS + Android = OpenSplice MobileAngelo Corsaro
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Sujee Maniyam
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and MonitoringMark Leith
 
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...CA API Management
 
EBsSDKForJavaWithOracleADF_ppt.ppt
EBsSDKForJavaWithOracleADF_ppt.pptEBsSDKForJavaWithOracleADF_ppt.ppt
EBsSDKForJavaWithOracleADF_ppt.pptSudhirSinghShakyaVan
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETSimon Haslam
 
A Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedA Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedBruno Borges
 
MySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL Brasil
 
Java Card, 15 years later
Java Card, 15 years laterJava Card, 15 years later
Java Card, 15 years laterEric Vétillard
 

Semelhante a Droidcon secureyourapp fighttheleaks-samsung (20)

Using APEX to Create a Mobile User Interface for Enterprise Manager 12c
Using APEX to Create a Mobile User Interface for Enterprise Manager 12cUsing APEX to Create a Mobile User Interface for Enterprise Manager 12c
Using APEX to Create a Mobile User Interface for Enterprise Manager 12c
 
Migrating JavaME Apps to Android
Migrating JavaME Apps to AndroidMigrating JavaME Apps to Android
Migrating JavaME Apps to Android
 
Java Solutions for Securing Edge-to-Enterprise
Java Solutions for Securing Edge-to-EnterpriseJava Solutions for Securing Edge-to-Enterprise
Java Solutions for Securing Edge-to-Enterprise
 
First Steps with Java Card
First Steps with Java CardFirst Steps with Java Card
First Steps with Java Card
 
Security - Part II.pdf
Security - Part II.pdfSecurity - Part II.pdf
Security - Part II.pdf
 
Introduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiIntroduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry Pi
 
MobilizeUrApps - Android Application Development
MobilizeUrApps - Android Application DevelopmentMobilizeUrApps - Android Application Development
MobilizeUrApps - Android Application Development
 
Security Tips for Android App - iTrobes
Security Tips for Android App - iTrobesSecurity Tips for Android App - iTrobes
Security Tips for Android App - iTrobes
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
DDS + Android = OpenSplice Mobile
DDS + Android = OpenSplice MobileDDS + Android = OpenSplice Mobile
DDS + Android = OpenSplice Mobile
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
 
Sightly_techInsight
Sightly_techInsightSightly_techInsight
Sightly_techInsight
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and Monitoring
 
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...
5 Reasons Why APIs Must be Part of Your Mobile Strategy - Scott Morrison, Dis...
 
EBsSDKForJavaWithOracleADF_ppt.ppt
EBsSDKForJavaWithOracleADF_ppt.pptEBsSDKForJavaWithOracleADF_ppt.ppt
EBsSDKForJavaWithOracleADF_ppt.ppt
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JET
 
A Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedA Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado Embedded
 
MySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de Games
 
X Means Y
X Means YX Means Y
X Means Y
 
Java Card, 15 years later
Java Card, 15 years laterJava Card, 15 years later
Java Card, 15 years later
 

Último

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Droidcon secureyourapp fighttheleaks-samsung

  • 1. SECURE YOUR APP FIGHT THE LEAKS! DROIDCON PARIS 2013
  • 2. EYAL LEZMY Slides http://bit.ly/droidcon-sec http://eyal.fr ANDROID PRESALES ENGINEER, SAMSUNG B2B TREASURER AT PARIS ANDROID USER GROUP ANDROID GOOGLE DEVELOPER EXPERT
  • 3. DON'T LET HIM DOWN THE USER TRUSTS YOU Company
  • 4. Copyright © 1995-2012 SAMSUNG All rights reserved APPS HAVE TO RESPECT THE DATA Different ways to unintentionally grant other apps access to the data inside your application : Exporting an unprotected component Storing personal data in a world readable file Logging personal data in logcat logs
  • 5. Copyright © 1995-2012 SAMSUNG All rights reserved It declares accessible app components Activity, Service, Receive,... Adding <intent-filter> => your element is exported by default CHECK YOUR ANDROIDMANIFEST.XML ContentProvider is always exported by default, until android:targetSdkVersion="17"
  • 6. Copyright © 1995-2012 SAMSUNG All rights reserved Don't export app components unless you want to share their content with other applications <application android:label="@string/app_name"> … <service android:name=".ServiceExample“ android:exported="false"> <intent-filter> … </intent-filter> </service> … </application> What is your legitimity to expose data? CHECK YOUR ANDROIDMANIFEST.XML
  • 7. Copyright © 1995-2012 SAMSUNG All rights reserved There are different permission protection levels: normal Lower risk permission dangerous Higher risk, access to user private data, potential negative impact signature Needs the same certificate signature PERMISIONS
  • 8. Copyright © 1995-2012 SAMSUNG All rights reserved Lets look at the code: <permission android:name="com.example.EXAMPLE_PERM“ android:label="@string/example_perm_l“ android:description="@string/example_perm_d“ android:icon="@drawable/example_perm_i“ android:protectionLevel="signature" /> ... <service android:name=".ServiceExample“ android:permission="com.example.EXAMPLE_PERM"> <intent-filter>...</intent-filter> </service> PERMISIONS
  • 9. Copyright © 1995-2012 SAMSUNG All rights reserved Don't be the weakest link private boolean checkPermission(Context context) { String permission = "com.example.EXAMPLE_PERM"; int res = context.checkCallingPermission(permission); return (res == PackageManager.PERMISSION_GRANTED); } PERMISIONS Always check the permission of a caller if you use your permission
  • 10. Copyright © 1995-2012 SAMSUNG All rights reserved DISABLE USELESS ACTIVITIES Fit your components lifecycle to your application's lifecycle If before configuration (login, account creation, ...) a service or activity is not useful, disable it If your application handles common implicit Intent's actions like ACTION_VIEW or ACTION_SEND consider disabling it by default
  • 11. Copyright © 1995-2012 SAMSUNG All rights reserved PackageManager.setComponentEnabledSetting(componentName, newState, flags); DISABLE USELESS ACTIVITIES <activity android:name="com.example.Activity" android:label="@string/app_name" android:enabled="false"> </activity> Disabled: Enabled:
  • 12. Copyright © 1995-2012 SAMSUNG All rights reserved STORING DATA WISELY Protect personal data using MODE_PRIVATE for data files, shared preferences, and databases: openFileOutput() openSharedPreferences() openOrCreateDatabase() External storage (sdcard) is shared storage
  • 13. Copyright © 1995-2012 SAMSUNG All rights reserved PLEASE... SHUT THE FUCK UP! public static final boolean SHOW_LOG = BuildConfig.DEBUG; public static void d(final String tag, final String msg) { if (SHOW_LOG) Log.d(tag, msg); } Don't expose data through logcat on production Detect the build mode with BuildConfig.DEBUG Be careful about this subject and test it during QA
  • 14. Copyright © 1995-2012 SAMSUNG All rights reserved PROTECTING APP FROM USERS No more android:debuggable on the manifest Don't leave this enabled in release code! ADT 8.0+ do it for you automatically
  • 15. Copyright © 1995-2012 SAMSUNG All rights reserved $ adb shell shell@android:/ $ run-as com.android.example sh shell@android:/data/data/com.android.example $ id uid=10060(app_60) gid=10060(app_60) shell@android:/data/data/com.android.example $ ls files/secret_data.txt shell@android:/data/data/com.android.example $ cat files/secret_data.txt PROTECTING APP FROM USERS
  • 16. IT'S NOT JUST ABOUT YOUR APP INSECURE NETWORK LOST OR STOLEN DEVICES
  • 17. Copyright © 1995-2012 SAMSUNG All rights reserved Free certified SSL: https://www.startssl.com/ USE SAFE NETWORKING HTTPS and SSL can protect against Man in the Middle attacks and prevent casual snooping Server certificate validity must be correctly checked "15% of apps have weak or bad SSL implementation on the Play Store"
  • 18. Copyright © 1995-2012 SAMSUNG All rights reserved ...but it may help discouraging curious. Use a peer-reviewed library like KeyCzar Take care of the key : Create it at first start, with true random Or grab a user key from your server Or ask the user for a passphrase you won't store DATA ENCRYPTION DOESN'T SOLVE ALL PROBLEMS
  • 19. Copyright © 1995-2012 SAMSUNG All rights reserved On a corporate environment, device administration can be considered Password management Device encryption Disable camera Lock the device Remote wipe DEVICE ADMINISTRATION
  • 20. Copyright © 1995-2012 SAMSUNG All rights reserved BEHIND THE STAGE The APK's content is always world readable, take care about what you put inside Sensitive files should be kept out of the APK Java is open source, your code too Using Proguard takes a single line of code Or... Dex encryption AAPT modified Logic on server
  • 21. IT'S NOT JUST ABOUT SECURITY THINK ABOUT POLITICS...
  • 22. Copyright © 1995-2012 SAMSUNG All rights reserved THE SECURITY PARADOX
  • 23. Copyright © 1995-2012 SAMSUNG All rights reserved "The more secure you make something, the less secure it becomes" Level the security following the user acceptance or... Users will find workarounds Users won't use your service NEVER FORGET THE USER, NEVAAAAA!
  • 24. Copyright © 1995-2012 SAMSUNG All rights reserved REFERENCES Google I/O 2012 Sessions Android Developpers Live Youtube channel Android Developement Android Developement: Using Cryptography The Commons Blog InformationWeek: Security Paradox ThreatPost: SLL implementation on Android apps StartSSL Free certificates
  • 25. SAMSUNG SMART APP CHALLENGE 2013 SAMSUNG SMART APP CHALLENGE 2013 A Global app challenge Apps for the Galaxy S4 Use of Samsung Chord SDK Apply June 20 - August 31 www.smartappchallenge.com $800,000 for 10 winners
  • 26. SAMSUNG DEVELOPERS SDKs and Documentation http://developer.samsung.com Samsung Chord SDK Bluetooth Low Energy SDK Remote Test Lab Test your applications on real devices through the internet Free 24H 365 Days S Pen & Multi Window SDK AllShare Framework Real Device, NOT emulator Multiple Devices