SlideShare uma empresa Scribd logo
1 de 27
Security Tips
for Android App
Volodymyr Kimak
Softjourn, Inc
Why Android?
Platform Popularity
Device Infection
Android Platform Version Usage
API Security
API Security: Tips
● Use JWT or Bearer Tokens for Session management and
validation, do not rely on mobile app judgements
● Validate every API method properly (parameters, roles and
permissions), even if it is hidden somewhere in the mobile
app
● Do not disclose Direct Object References to backend
entities, because it leads to enumeration and easy guessing
of them
Authentication and Authorization
Authentication and Authorization: Tips
● Require strong Session management
● Do not store passwords locally, instead store tokens even
for “Remember Me” functionality
● Do not allow users to provide 4-6 digit PIN codes instead of
passwords, use FingerPrint authentication instead
Cryptography
Cryptography: Tips
● Store sensitive data locally, only if it is really needed
● Use only modern, strong, approved cryptographic
algorithms, do not create your own crypto
● Use strong random number generators
● Protect your keys in a key vault
● Do not store hardcoded encryption keys in app code
Communication: SSL Handshake
Communication: Tips
● Remove all debug HTTP(S) settings
● Use the latest HTTP standards:
○ HTTP 1.1 or HTTP 2.0
○ HTTPS/TLS 1.2
● Verify SSL certificate:
○ Hostname
○ Information (SSL Pinning)
■ Pin Certificate
■ Pin Public Key Info (SPKI)
○ In case of Hybrid app (Xamarin), it is possible to verify certificate on 2 levels (native and
hybrid) to increase security
○ Inform User about SSL error and drop connection
Data Storage: Types
Data Storage: Locations
● Internal
● External
Data Storage: KeyStore
Data Storage: Tips
● Use Shared Preferences for only simple app preferences,
but not for sensitive data
● Use KeyStore for storing small amount of sensitive data
● Use Internal Storage for app’s generated content
● Use External Storage for user’s files, but not for sensitive
data, unless you encrypt it
● Use Encrypted Database (Realm or SQLite) for storing large
amount of sensitive data
● Do not store sensitive data in logs or analytics
Content Provider
Content Provider: Tips
● Use Content Provider to share data between apps
● If used only by your app, set flag android:exported=false
● If shared apps are only your own apps, set flag
android:protectionLevel=signature
● Prefer to use android:grantUriPermissions over
android:permissions, because if gives more granular and
dynamic access to data
● Use parametrized query methods such as
query/update/delete to avoid potential SQL injections from
untrusted sources
Activity/Service/Broadcast Receiver
Activity/Service/Broadcast Receiver: Tips
● Provide shared access from other apps to only those
activities/services/receivers, which are aimed at it, using
android:exported/intent-filter/permission attributes
Binary Protection
Binary Protection: Tips
● Use native code obfuscators:
○ Proguard
○ Dexguard
○ In case of hybrid app (Xamarin), use corresponding
obfuscators also
● Use SafetyNet API from Google:
○ Attestation API - check if device environment is safe and
app has not been modified
○ Verify Apps API - check if device contains potentially
harmful apps
Redundant functionality
Redundant functionality: Tips
● Remove debug flag from Application manifest
● Remove internal functionality
● Remove all hardcoded/test passwords
● Remove all test and non-production ready endpoints
● Verify that log messages do not expose application flow and
critical info
Links
● https://developer.android.com/training/best-security.html
● https://www.owasp.org/index.php/Mobile_Top_10_2016-
Top_10
● https://developer.android.com/training/safetynet/index.htm
l
● https://www.guardsquare.com/en/proguard
Security Tips for Securing Your Android App

Mais conteúdo relacionado

Mais procurados

Introduction to Security Testing
Introduction to Security TestingIntroduction to Security Testing
Introduction to Security TestingvodQA
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurationsMegha Sahu
 
Android application security unveiled
Android application security unveiledAndroid application security unveiled
Android application security unveiledJan Hodermarsky
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityColin English
 

Mais procurados (7)

Introduction to Security Testing
Introduction to Security TestingIntroduction to Security Testing
Introduction to Security Testing
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurations
 
OWASP Top Ten 2017
OWASP Top Ten 2017OWASP Top Ten 2017
OWASP Top Ten 2017
 
Android application security unveiled
Android application security unveiledAndroid application security unveiled
Android application security unveiled
 
Security Testing for Web Application
Security Testing for Web ApplicationSecurity Testing for Web Application
Security Testing for Web Application
 
Owasp Mobile Top 10 – 2014
Owasp Mobile Top 10 – 2014Owasp Mobile Top 10 – 2014
Owasp Mobile Top 10 – 2014
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 

Semelhante a Security Tips for Securing Your Android App

Security Tips for Android App - iTrobes
Security Tips for Android App - iTrobesSecurity Tips for Android App - iTrobes
Security Tips for Android App - iTrobesiTrobes
 
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...apidays
 
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014Anant Shrivastava
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Codemotion
 
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)SSO using CAS + two-factor authentication (PyGrunn 2014 talk)
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)Artur Barseghyan
 
Security on android
Security on androidSecurity on android
Security on androidpk464312
 
2018 android-security-udacity-morrison chang
2018 android-security-udacity-morrison chang2018 android-security-udacity-morrison chang
2018 android-security-udacity-morrison changmjchang
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Opersys inc.
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)Ron Munitz
 
Android Application Security from consumer and developer perspectives
Android Application Security from consumer and developer perspectivesAndroid Application Security from consumer and developer perspectives
Android Application Security from consumer and developer perspectivesAyoma Wijethunga
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Opersys inc.
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)Ron Munitz
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)Ron Munitz
 
Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]Angelo Rüggeberg
 
Android security in depth - extended
Android security in depth - extendedAndroid security in depth - extended
Android security in depth - extendedSander Alberink
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityMatt Tesauro
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on itWSO2
 

Semelhante a Security Tips for Securing Your Android App (20)

Security Tips for Android App - iTrobes
Security Tips for Android App - iTrobesSecurity Tips for Android App - iTrobes
Security Tips for Android App - iTrobes
 
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
 
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014
Owasp Mobile Risk M2 : Insecure Data Storage : null/OWASP/G4H Bangalore Aug 2014
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
 
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)SSO using CAS + two-factor authentication (PyGrunn 2014 talk)
SSO using CAS + two-factor authentication (PyGrunn 2014 talk)
 
OpenID Connect
OpenID ConnectOpenID Connect
OpenID Connect
 
Security on android
Security on androidSecurity on android
Security on android
 
2018 android-security-udacity-morrison chang
2018 android-security-udacity-morrison chang2018 android-security-udacity-morrison chang
2018 android-security-udacity-morrison chang
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)
The Ultimate Android Security Checklist (Codemotion Tel-Aviv, 2014)
 
Android Application Security from consumer and developer perspectives
Android Application Security from consumer and developer perspectivesAndroid Application Security from consumer and developer perspectives
Android Application Security from consumer and developer perspectives
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
Smartphones' Security
Smartphones' SecuritySmartphones' Security
Smartphones' Security
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)
 
Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]
 
Android security in depth - extended
Android security in depth - extendedAndroid security in depth - extended
Android security in depth - extended
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API Security
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 

Mais de Igor Beliaiev

Igor Beliaiev "Incident Busters. Human Security Interaction"
Igor Beliaiev "Incident Busters. Human Security Interaction"Igor Beliaiev "Incident Busters. Human Security Interaction"
Igor Beliaiev "Incident Busters. Human Security Interaction"Igor Beliaiev
 
Vlada Kulish "Deserialization. What it is and how to hack it"
Vlada Kulish "Deserialization. What it is and how to hack it"Vlada Kulish "Deserialization. What it is and how to hack it"
Vlada Kulish "Deserialization. What it is and how to hack it"Igor Beliaiev
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsIgor Beliaiev
 
Security Hole #18 - Cryptolocker Ransomware
Security Hole #18 - Cryptolocker RansomwareSecurity Hole #18 - Cryptolocker Ransomware
Security Hole #18 - Cryptolocker RansomwareIgor Beliaiev
 
Security Hole #18 - Security Matters
Security Hole #18 - Security MattersSecurity Hole #18 - Security Matters
Security Hole #18 - Security MattersIgor Beliaiev
 
Security Hole #11 - Competitive intelligence
Security Hole #11 - Competitive intelligenceSecurity Hole #11 - Competitive intelligence
Security Hole #11 - Competitive intelligenceIgor Beliaiev
 

Mais de Igor Beliaiev (7)

Igor Beliaiev "Incident Busters. Human Security Interaction"
Igor Beliaiev "Incident Busters. Human Security Interaction"Igor Beliaiev "Incident Busters. Human Security Interaction"
Igor Beliaiev "Incident Busters. Human Security Interaction"
 
Vlada Kulish "Deserialization. What it is and how to hack it"
Vlada Kulish "Deserialization. What it is and how to hack it"Vlada Kulish "Deserialization. What it is and how to hack it"
Vlada Kulish "Deserialization. What it is and how to hack it"
 
Security Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and ResultsSecurity Walls in Linux Environment: Practice, Experience, and Results
Security Walls in Linux Environment: Practice, Experience, and Results
 
Hacking a company
Hacking a companyHacking a company
Hacking a company
 
Security Hole #18 - Cryptolocker Ransomware
Security Hole #18 - Cryptolocker RansomwareSecurity Hole #18 - Cryptolocker Ransomware
Security Hole #18 - Cryptolocker Ransomware
 
Security Hole #18 - Security Matters
Security Hole #18 - Security MattersSecurity Hole #18 - Security Matters
Security Hole #18 - Security Matters
 
Security Hole #11 - Competitive intelligence
Security Hole #11 - Competitive intelligenceSecurity Hole #11 - Competitive intelligence
Security Hole #11 - Competitive intelligence
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Security Tips for Securing Your Android App

  • 1. Security Tips for Android App Volodymyr Kimak Softjourn, Inc
  • 7. API Security: Tips ● Use JWT or Bearer Tokens for Session management and validation, do not rely on mobile app judgements ● Validate every API method properly (parameters, roles and permissions), even if it is hidden somewhere in the mobile app ● Do not disclose Direct Object References to backend entities, because it leads to enumeration and easy guessing of them
  • 9. Authentication and Authorization: Tips ● Require strong Session management ● Do not store passwords locally, instead store tokens even for “Remember Me” functionality ● Do not allow users to provide 4-6 digit PIN codes instead of passwords, use FingerPrint authentication instead
  • 11. Cryptography: Tips ● Store sensitive data locally, only if it is really needed ● Use only modern, strong, approved cryptographic algorithms, do not create your own crypto ● Use strong random number generators ● Protect your keys in a key vault ● Do not store hardcoded encryption keys in app code
  • 13. Communication: Tips ● Remove all debug HTTP(S) settings ● Use the latest HTTP standards: ○ HTTP 1.1 or HTTP 2.0 ○ HTTPS/TLS 1.2 ● Verify SSL certificate: ○ Hostname ○ Information (SSL Pinning) ■ Pin Certificate ■ Pin Public Key Info (SPKI) ○ In case of Hybrid app (Xamarin), it is possible to verify certificate on 2 levels (native and hybrid) to increase security ○ Inform User about SSL error and drop connection
  • 15. Data Storage: Locations ● Internal ● External
  • 17. Data Storage: Tips ● Use Shared Preferences for only simple app preferences, but not for sensitive data ● Use KeyStore for storing small amount of sensitive data ● Use Internal Storage for app’s generated content ● Use External Storage for user’s files, but not for sensitive data, unless you encrypt it ● Use Encrypted Database (Realm or SQLite) for storing large amount of sensitive data ● Do not store sensitive data in logs or analytics
  • 19. Content Provider: Tips ● Use Content Provider to share data between apps ● If used only by your app, set flag android:exported=false ● If shared apps are only your own apps, set flag android:protectionLevel=signature ● Prefer to use android:grantUriPermissions over android:permissions, because if gives more granular and dynamic access to data ● Use parametrized query methods such as query/update/delete to avoid potential SQL injections from untrusted sources
  • 21. Activity/Service/Broadcast Receiver: Tips ● Provide shared access from other apps to only those activities/services/receivers, which are aimed at it, using android:exported/intent-filter/permission attributes
  • 23. Binary Protection: Tips ● Use native code obfuscators: ○ Proguard ○ Dexguard ○ In case of hybrid app (Xamarin), use corresponding obfuscators also ● Use SafetyNet API from Google: ○ Attestation API - check if device environment is safe and app has not been modified ○ Verify Apps API - check if device contains potentially harmful apps
  • 25. Redundant functionality: Tips ● Remove debug flag from Application manifest ● Remove internal functionality ● Remove all hardcoded/test passwords ● Remove all test and non-production ready endpoints ● Verify that log messages do not expose application flow and critical info
  • 26. Links ● https://developer.android.com/training/best-security.html ● https://www.owasp.org/index.php/Mobile_Top_10_2016- Top_10 ● https://developer.android.com/training/safetynet/index.htm l ● https://www.guardsquare.com/en/proguard

Notas do Editor

  1. https://pages.nokia.com/8859.Threat.Intelligence.Report.html https://www.networkworld.com/article/3185766/security/malware-infection-rate-of-smartphones-is-soaring-android-devices-often-the-target.html https://developer.android.com/about/dashboards/index.html
  2. https://pages.nokia.com/8859.Threat.Intelligence.Report.html https://www.networkworld.com/article/3185766/security/malware-infection-rate-of-smartphones-is-soaring-android-devices-often-the-target.html https://developer.android.com/about/dashboards/index.html
  3. https://pages.nokia.com/8859.Threat.Intelligence.Report.html https://www.networkworld.com/article/3185766/security/malware-infection-rate-of-smartphones-is-soaring-android-devices-often-the-target.html https://developer.android.com/about/dashboards/index.html
  4. https://pages.nokia.com/8859.Threat.Intelligence.Report.html https://www.networkworld.com/article/3185766/security/malware-infection-rate-of-smartphones-is-soaring-android-devices-often-the-target.html https://developer.android.com/about/dashboards/index.html
  5. http://factmyth.com/factoids/cryptography-is-the-art-of-writing-and-solving-codes/
  6. https://www.synopsys.com/blogs/software-security/ineffective-certificate-pinning-implementations/ https://koz.io/pinning-cve-2016-2402/ https://www.cloudflare.com/learning/cdn/cdn-ssl-tls-security/
  7. https://www.synopsys.com/blogs/software-security/ineffective-certificate-pinning-implementations/ https://koz.io/pinning-cve-2016-2402/
  8. https://stackoverflow.com/questions/9986734/which-android-data-storage-technique-to-use Shared preferences are good for storing ... an application's preferences, and other small bits of data. It's a just really simple persistent string key store for a few data types: boolean, float, int, long and string. So for instance if my app had a login, I might consider storing the session key as string within SharedPreferences. SQLite databases are great whenever you are going to use a lot of structured data and a relatively rigid schema for managing it. Put in layman's terms, SQLite is like MySQL or PostgreSQL except instead of the database acting as a server daemon which then takes queries from the CGI scripts like php, it is simply stored in a .db file, and accessed and queried through a simple library within the application. While SQLite cannot scale nearly as big as the dedicated databases, it is very quick and convenient for smaller applications, like Android apps. I would use an SQLite db if I were making an app for aggregating and downloading recipes, since that kind of data is relatively structured and a database would allow for it to scale well. Databases are nice because writing all of your data to a file, then parsing it back in your own proprietary format it no fun. Then again, storing data in XML or JSON wouldn't be so bad.
  9. https://stackoverflow.com/questions/9986734/which-android-data-storage-technique-to-use Internal storage is good for storing application data that the user doesn't need access to, because the user cannot easily access internal storage. Possibly good for caching, logs, other things. Anything that only the app intends to Create Read Update or Delete. External storage. Great for the opposite of what I just said. The dropbox app probably uses external storage to store the user's dropbox folder, so that the user has easy access to these files outside the dropbox application, for instance, using the file manager.
  10. What is KeyStore? https://developer.android.com/training/articles/keystore.html
  11. Attestation API provides services for determining whether a device running your app satisfies Android compatibility tests. Verify Apps API allows your app to protecting the device against potentially harmful apps.