SlideShare a Scribd company logo
Network Security In Android M
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Hi, I’m Matt
➔Making stuff with Xamarin since ‘13
➔Like hanging out on big cliffs
➔The mobile guy at
➔Passionate about improving our trades tooling!
◆ Ask me about MFractor later :)
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Background
➔Why is this important?
◆ Post Assange, Post Snowden
◆ Users expect security
◆ Users expect privacy
◆ It’s trendy!
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Security in Android M
➔Implements 3 mechanisms
◆ ‘usesClearTextTraffic’ within manifest
◆ NetworkSecurityPolicy
◆ StrictMode
➔These are only available in API 23 and higher
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
UsesClearTextTraffic
➔Manifest option to flag support of clear text traffic
➔Exposed via NetworkSecurityPolicy
➔What it looks like:
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Network Security Policy
➔Singleton class containing apps traffic policy
➔Does not enforce policy!
◆ Merely exposes it.
➔Expects application components to adhere to it.
◆ But is opt-in!
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
➔That honour usesClearTextTraffic
◆ DownloadManager
◆ MediaPlayer
◆ SocketHandler
◆ Java.* or Android.* HTTP, FTP, WebSockets, XMPP, IMAP, SMTP network components
◆ Some third party libraries
● OkHttp
● ModernHttpClient
➔That dishonour usesClearTextTraffic:
◆ Android.WebKit.WebView
Components
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Honours usesClearTextTraffic
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Dishonours usesClearTextTraffic
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Honours usesClearTextTraffic
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Enforcing Secure Traffic
➔ Check for apps clear text configuration:
➔Use StrictMode!
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
StrictMode
➔ Exposes ability to monitor for clear-text traffic
➔Detect and log:
➔Detect and crash:
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Detecting Insecure Traffic
➔ So, how do they do it?
◆ StrictMode.DetectClearText() registers firewall rule
● Within the apps user-space.
◆ Firewall watches for outgoing TLS packets
◆ Flags non-conforming packets
◆ Notifies app process of violation.
◆ Logs or crashes
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
StrictMode - TLS Header
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
StrictMode Implementation
➔Uses ‘iptables’ to register firewall rules
➔Logs outgoing packets that violate rules.
➔StrictController.cpp:
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
StrictMode - Limitations
➔Only detects TLS wrapped traffic.
➔Unknown behaviour for TCP or UDP connections.
◆ Gut feeling is they will cause a violation
➔Should only be used in debug builds.
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Demo Time
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Implications
➔ For app developers:
◆ Be aware of new security policies.
● Don’t necessarily need to use it.
◆ Be aware of non-cleartext compliant libraries:
● Nugets
● Xamarin Components
● Etc etc etc
◆ If in doubt, turn on StrictMode
➔For component developers:
◆ Play nice and make libraries cleartext compliant:
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Summary
➔Cleartext traffic is under the microscope
◆ Google -> Network Security Policy
◆ Apple -> App Transport Security
➔Be aware of new policies
◆ Android N will only enforce them more
➔Try to comply with the policies
◆ Using compliant libraries like ModernHttpClient
◆ Checking the NetworkSecurityPolicy
➔Be aware 3rd party libraries may not conform
@matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
Resources
➔Demo Source Code
➔NetworkSecurityPolicy API Reference
➔Network Security Policy for Android apps

More Related Content

Similar to SydMobNet March 2016: Matthew Robbins - Android M Security Policies

Xamarin - Under the bridge
Xamarin - Under the bridgeXamarin - Under the bridge
Xamarin - Under the bridge
Dan Ardelean
 
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK FrameworkSecure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
Leszek Mi?
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
Felipe Prado
 
AktaionPPTv5_JZedits
AktaionPPTv5_JZeditsAktaionPPTv5_JZedits
AktaionPPTv5_JZedits
Rod Soto
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
Freddy Buenaño
 
Jackpot! sbancare un atm con ploutus.d
Jackpot! sbancare un atm con ploutus.dJackpot! sbancare un atm con ploutus.d
Jackpot! sbancare un atm con ploutus.d
Antonio Parata
 
"Giving the bad guys no sleep"
"Giving the bad guys no sleep""Giving the bad guys no sleep"
"Giving the bad guys no sleep"
Christiaan Beek
 
Automotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a HackerAutomotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a Hacker
ForAllSecure
 
OS Security Evolution & Latest Attack Vectors By Jacob Torrey
OS Security Evolution & Latest Attack Vectors  By Jacob TorreyOS Security Evolution & Latest Attack Vectors  By Jacob Torrey
OS Security Evolution & Latest Attack Vectors By Jacob Torrey
Priyanka Aash
 
Once you go cloud you never go down - by Enter - festival ICT 2015
Once you go cloud you never go down - by Enter - festival ICT 2015Once you go cloud you never go down - by Enter - festival ICT 2015
Once you go cloud you never go down - by Enter - festival ICT 2015
festival ICT 2016
 
Once you go cloud you never go down
Once you go cloud you never go downOnce you go cloud you never go down
Once you go cloud you never go down
DrupalDay
 
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdftheVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
Gabriel Mathenge
 
bettercap.pdf
bettercap.pdfbettercap.pdf
bettercap.pdf
shehbaz15
 
Bsides NYC 2018 - Hunting for Lateral Movement
Bsides NYC 2018 - Hunting for Lateral MovementBsides NYC 2018 - Hunting for Lateral Movement
Bsides NYC 2018 - Hunting for Lateral Movement
Mauricio Velazco
 
Infecting the Embedded Supply Chain
 Infecting the Embedded Supply Chain Infecting the Embedded Supply Chain
Infecting the Embedded Supply Chain
Priyanka Aash
 
Cybercrime in the Deep Web (BHEU 2015)
Cybercrime in the Deep Web (BHEU 2015)Cybercrime in the Deep Web (BHEU 2015)
Cybercrime in the Deep Web (BHEU 2015)
Marco Balduzzi
 
Cybercrime In The Deep Web
Cybercrime In The Deep WebCybercrime In The Deep Web
Cybercrime In The Deep Web
Trend Micro
 
20150909_network_security_lecture
20150909_network_security_lecture20150909_network_security_lecture
20150909_network_security_lecture
University of Twente
 
How Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
How Hack WiFi through Aircrack-ng in Kali Linux Cyber SecurityHow Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
How Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
Ahmad Yar
 
Monitoring ICS Communications
Monitoring ICS CommunicationsMonitoring ICS Communications
Monitoring ICS Communications
Digital Bond
 

Similar to SydMobNet March 2016: Matthew Robbins - Android M Security Policies (20)

Xamarin - Under the bridge
Xamarin - Under the bridgeXamarin - Under the bridge
Xamarin - Under the bridge
 
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK FrameworkSecure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
Secure 2019 - APT for Everyone - Adversary Simulations based on ATT&CK Framework
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
 
AktaionPPTv5_JZedits
AktaionPPTv5_JZeditsAktaionPPTv5_JZedits
AktaionPPTv5_JZedits
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
Jackpot! sbancare un atm con ploutus.d
Jackpot! sbancare un atm con ploutus.dJackpot! sbancare un atm con ploutus.d
Jackpot! sbancare un atm con ploutus.d
 
"Giving the bad guys no sleep"
"Giving the bad guys no sleep""Giving the bad guys no sleep"
"Giving the bad guys no sleep"
 
Automotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a HackerAutomotive Cybersecurity: Test Like a Hacker
Automotive Cybersecurity: Test Like a Hacker
 
OS Security Evolution & Latest Attack Vectors By Jacob Torrey
OS Security Evolution & Latest Attack Vectors  By Jacob TorreyOS Security Evolution & Latest Attack Vectors  By Jacob Torrey
OS Security Evolution & Latest Attack Vectors By Jacob Torrey
 
Once you go cloud you never go down - by Enter - festival ICT 2015
Once you go cloud you never go down - by Enter - festival ICT 2015Once you go cloud you never go down - by Enter - festival ICT 2015
Once you go cloud you never go down - by Enter - festival ICT 2015
 
Once you go cloud you never go down
Once you go cloud you never go downOnce you go cloud you never go down
Once you go cloud you never go down
 
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdftheVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
 
bettercap.pdf
bettercap.pdfbettercap.pdf
bettercap.pdf
 
Bsides NYC 2018 - Hunting for Lateral Movement
Bsides NYC 2018 - Hunting for Lateral MovementBsides NYC 2018 - Hunting for Lateral Movement
Bsides NYC 2018 - Hunting for Lateral Movement
 
Infecting the Embedded Supply Chain
 Infecting the Embedded Supply Chain Infecting the Embedded Supply Chain
Infecting the Embedded Supply Chain
 
Cybercrime in the Deep Web (BHEU 2015)
Cybercrime in the Deep Web (BHEU 2015)Cybercrime in the Deep Web (BHEU 2015)
Cybercrime in the Deep Web (BHEU 2015)
 
Cybercrime In The Deep Web
Cybercrime In The Deep WebCybercrime In The Deep Web
Cybercrime In The Deep Web
 
20150909_network_security_lecture
20150909_network_security_lecture20150909_network_security_lecture
20150909_network_security_lecture
 
How Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
How Hack WiFi through Aircrack-ng in Kali Linux Cyber SecurityHow Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
How Hack WiFi through Aircrack-ng in Kali Linux Cyber Security
 
Monitoring ICS Communications
Monitoring ICS CommunicationsMonitoring ICS Communications
Monitoring ICS Communications
 

More from Alec Tucker

Monkey fest australia 2020
Monkey fest australia 2020Monkey fest australia 2020
Monkey fest australia 2020
Alec Tucker
 
Enterprise Mobile Security and OWASP Compliance
Enterprise Mobile Security and OWASP ComplianceEnterprise Mobile Security and OWASP Compliance
Enterprise Mobile Security and OWASP Compliance
Alec Tucker
 
Addressing the OWASP Mobile Security Threats using Xamarin
Addressing the OWASP Mobile Security Threats using XamarinAddressing the OWASP Mobile Security Threats using Xamarin
Addressing the OWASP Mobile Security Threats using Xamarin
Alec Tucker
 
Sydney Mobile .Net (Xamarin) Developers Group March 2016
Sydney Mobile .Net (Xamarin) Developers Group March 2016Sydney Mobile .Net (Xamarin) Developers Group March 2016
Sydney Mobile .Net (Xamarin) Developers Group March 2016
Alec Tucker
 
Sydney Mobile .Net (Xamarin) Developers Group January 2016
Sydney Mobile .Net (Xamarin) Developers Group January 2016Sydney Mobile .Net (Xamarin) Developers Group January 2016
Sydney Mobile .Net (Xamarin) Developers Group January 2016
Alec Tucker
 
Xamarin.android memory management gotchas
Xamarin.android memory management gotchasXamarin.android memory management gotchas
Xamarin.android memory management gotchas
Alec Tucker
 
Sydney Mobile .Net Developers Group February 2015
Sydney Mobile .Net Developers Group February 2015Sydney Mobile .Net Developers Group February 2015
Sydney Mobile .Net Developers Group February 2015
Alec Tucker
 
Sydney Mobile .Net Developers Group January 2015
Sydney Mobile .Net Developers Group January 2015Sydney Mobile .Net Developers Group January 2015
Sydney Mobile .Net Developers Group January 2015
Alec Tucker
 
Sydney Mobile .Net Developers Group December 2014
Sydney Mobile .Net Developers Group December 2014Sydney Mobile .Net Developers Group December 2014
Sydney Mobile .Net Developers Group December 2014
Alec Tucker
 
#SydMobNet Nov 2014: Evolve 2014 recap
#SydMobNet Nov 2014: Evolve 2014 recap#SydMobNet Nov 2014: Evolve 2014 recap
#SydMobNet Nov 2014: Evolve 2014 recap
Alec Tucker
 
Sydney Mobile .Net Developers Group November 2014
Sydney Mobile .Net Developers Group November 2014Sydney Mobile .Net Developers Group November 2014
Sydney Mobile .Net Developers Group November 2014
Alec Tucker
 
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
Alec Tucker
 
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
Alec Tucker
 
SydMobNet July 2014: Xamarin 3 & Xamarin Forms
SydMobNet July 2014: Xamarin 3 & Xamarin FormsSydMobNet July 2014: Xamarin 3 & Xamarin Forms
SydMobNet July 2014: Xamarin 3 & Xamarin Forms
Alec Tucker
 
SydMobNet May 2014 - Lewis Benge on Wearable Tech
SydMobNet May 2014 - Lewis Benge on Wearable TechSydMobNet May 2014 - Lewis Benge on Wearable Tech
SydMobNet May 2014 - Lewis Benge on Wearable Tech
Alec Tucker
 
SydMobNet April 2014 - Nick Randolph's Build 2014 Update
SydMobNet April 2014 - Nick Randolph's Build 2014 UpdateSydMobNet April 2014 - Nick Randolph's Build 2014 Update
SydMobNet April 2014 - Nick Randolph's Build 2014 Update
Alec Tucker
 
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Alec Tucker
 
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
Alec Tucker
 

More from Alec Tucker (18)

Monkey fest australia 2020
Monkey fest australia 2020Monkey fest australia 2020
Monkey fest australia 2020
 
Enterprise Mobile Security and OWASP Compliance
Enterprise Mobile Security and OWASP ComplianceEnterprise Mobile Security and OWASP Compliance
Enterprise Mobile Security and OWASP Compliance
 
Addressing the OWASP Mobile Security Threats using Xamarin
Addressing the OWASP Mobile Security Threats using XamarinAddressing the OWASP Mobile Security Threats using Xamarin
Addressing the OWASP Mobile Security Threats using Xamarin
 
Sydney Mobile .Net (Xamarin) Developers Group March 2016
Sydney Mobile .Net (Xamarin) Developers Group March 2016Sydney Mobile .Net (Xamarin) Developers Group March 2016
Sydney Mobile .Net (Xamarin) Developers Group March 2016
 
Sydney Mobile .Net (Xamarin) Developers Group January 2016
Sydney Mobile .Net (Xamarin) Developers Group January 2016Sydney Mobile .Net (Xamarin) Developers Group January 2016
Sydney Mobile .Net (Xamarin) Developers Group January 2016
 
Xamarin.android memory management gotchas
Xamarin.android memory management gotchasXamarin.android memory management gotchas
Xamarin.android memory management gotchas
 
Sydney Mobile .Net Developers Group February 2015
Sydney Mobile .Net Developers Group February 2015Sydney Mobile .Net Developers Group February 2015
Sydney Mobile .Net Developers Group February 2015
 
Sydney Mobile .Net Developers Group January 2015
Sydney Mobile .Net Developers Group January 2015Sydney Mobile .Net Developers Group January 2015
Sydney Mobile .Net Developers Group January 2015
 
Sydney Mobile .Net Developers Group December 2014
Sydney Mobile .Net Developers Group December 2014Sydney Mobile .Net Developers Group December 2014
Sydney Mobile .Net Developers Group December 2014
 
#SydMobNet Nov 2014: Evolve 2014 recap
#SydMobNet Nov 2014: Evolve 2014 recap#SydMobNet Nov 2014: Evolve 2014 recap
#SydMobNet Nov 2014: Evolve 2014 recap
 
Sydney Mobile .Net Developers Group November 2014
Sydney Mobile .Net Developers Group November 2014Sydney Mobile .Net Developers Group November 2014
Sydney Mobile .Net Developers Group November 2014
 
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
SydMobNet September 2014: ReactiveUI, Genymotion, Xamarin.UITest and Xamarin ...
 
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
SydMobNet August 2014: What's New in iOS8 & Xamarin plus .Net MVC and Xamarin...
 
SydMobNet July 2014: Xamarin 3 & Xamarin Forms
SydMobNet July 2014: Xamarin 3 & Xamarin FormsSydMobNet July 2014: Xamarin 3 & Xamarin Forms
SydMobNet July 2014: Xamarin 3 & Xamarin Forms
 
SydMobNet May 2014 - Lewis Benge on Wearable Tech
SydMobNet May 2014 - Lewis Benge on Wearable TechSydMobNet May 2014 - Lewis Benge on Wearable Tech
SydMobNet May 2014 - Lewis Benge on Wearable Tech
 
SydMobNet April 2014 - Nick Randolph's Build 2014 Update
SydMobNet April 2014 - Nick Randolph's Build 2014 UpdateSydMobNet April 2014 - Nick Randolph's Build 2014 Update
SydMobNet April 2014 - Nick Randolph's Build 2014 Update
 
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
 
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
 

SydMobNet March 2016: Matthew Robbins - Android M Security Policies

  • 2. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Hi, I’m Matt ➔Making stuff with Xamarin since ‘13 ➔Like hanging out on big cliffs ➔The mobile guy at ➔Passionate about improving our trades tooling! ◆ Ask me about MFractor later :)
  • 3. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Background ➔Why is this important? ◆ Post Assange, Post Snowden ◆ Users expect security ◆ Users expect privacy ◆ It’s trendy!
  • 4. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Security in Android M ➔Implements 3 mechanisms ◆ ‘usesClearTextTraffic’ within manifest ◆ NetworkSecurityPolicy ◆ StrictMode ➔These are only available in API 23 and higher
  • 5. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com UsesClearTextTraffic ➔Manifest option to flag support of clear text traffic ➔Exposed via NetworkSecurityPolicy ➔What it looks like:
  • 6. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Network Security Policy ➔Singleton class containing apps traffic policy ➔Does not enforce policy! ◆ Merely exposes it. ➔Expects application components to adhere to it. ◆ But is opt-in!
  • 7. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com
  • 8. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com ➔That honour usesClearTextTraffic ◆ DownloadManager ◆ MediaPlayer ◆ SocketHandler ◆ Java.* or Android.* HTTP, FTP, WebSockets, XMPP, IMAP, SMTP network components ◆ Some third party libraries ● OkHttp ● ModernHttpClient ➔That dishonour usesClearTextTraffic: ◆ Android.WebKit.WebView Components
  • 9. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Honours usesClearTextTraffic
  • 10. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Dishonours usesClearTextTraffic
  • 11. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Honours usesClearTextTraffic
  • 12. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Enforcing Secure Traffic ➔ Check for apps clear text configuration: ➔Use StrictMode!
  • 13. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com StrictMode ➔ Exposes ability to monitor for clear-text traffic ➔Detect and log: ➔Detect and crash:
  • 14. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Detecting Insecure Traffic ➔ So, how do they do it? ◆ StrictMode.DetectClearText() registers firewall rule ● Within the apps user-space. ◆ Firewall watches for outgoing TLS packets ◆ Flags non-conforming packets ◆ Notifies app process of violation. ◆ Logs or crashes
  • 15. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com StrictMode - TLS Header
  • 16. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com StrictMode Implementation ➔Uses ‘iptables’ to register firewall rules ➔Logs outgoing packets that violate rules. ➔StrictController.cpp:
  • 17. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com StrictMode - Limitations ➔Only detects TLS wrapped traffic. ➔Unknown behaviour for TCP or UDP connections. ◆ Gut feeling is they will cause a violation ➔Should only be used in debug builds.
  • 18. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Demo Time
  • 19. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Implications ➔ For app developers: ◆ Be aware of new security policies. ● Don’t necessarily need to use it. ◆ Be aware of non-cleartext compliant libraries: ● Nugets ● Xamarin Components ● Etc etc etc ◆ If in doubt, turn on StrictMode ➔For component developers: ◆ Play nice and make libraries cleartext compliant:
  • 20. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Summary ➔Cleartext traffic is under the microscope ◆ Google -> Network Security Policy ◆ Apple -> App Transport Security ➔Be aware of new policies ◆ Android N will only enforce them more ➔Try to comply with the policies ◆ Using compliant libraries like ModernHttpClient ◆ Checking the NetworkSecurityPolicy ➔Be aware 3rd party libraries may not conform
  • 21. @matthewrdev | matthew.ch.robbins@gmail.com | 0431 197 349 | mfractor.com Resources ➔Demo Source Code ➔NetworkSecurityPolicy API Reference ➔Network Security Policy for Android apps