Top Banner
WWDC 2017 讀書會 2017/07/21 - Antony Chuang
91

KKBOX WWDC17 Security - Antony

Jan 22, 2018

Download

Technology

Liyao Chen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: KKBOX WWDC17 Security - Antony

WWDC 2017 讀書會2017/07/21 - Antony Chuang

Page 2: KKBOX WWDC17 Security - Antony

Outline

• Your Apps and Evolving Network Security Standards

• Privacy and Your Apps

• Advances in Networking

• What's new in Apple Pay Wallet

Page 3: KKBOX WWDC17 Security - Antony

• Your Apps and Evolving Network Security Standards

• Privacy and Your Apps

• Advances in Networking

• What's new in Apple Pay Wallet

Page 4: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

• Best Practices

• App Transport Security

• Transport Layer Security

Page 5: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices

Page 6: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices

Page 7: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - RevocationOnline Certificate Status Protocol (OCSP)

Page 8: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - RevocationOnline Certificate Status Protocol (OCSP)

• Additional network connection

• Compromises user privacy

• Requires app opt-in

Page 9: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - RevocationOnline Certificate Status Protocol Stapling (OCSP Stapling)

Page 10: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - RevocationOnline Certificate Status Protocol Stapling (OCSP Stapling)

• Slow adoption

• Malicious server

Page 11: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - RevocationCertificate Transparency Log

Page 12: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - Revocation

Certificate Transparency Log

• Reduced privacy compromise

• Automatic updating

• Faster connections

Certificate in iOS: https://support.apple.com/en-us/HT204132

Page 13: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - Trust Removals

• SHA-1 signed certificates for TLS

• Certificates using <2048-bit RSA for TLS

Page 14: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - Trust Removals

• Not affect

- Root certificates

- Enterprise-distributed certificates

- User-installed certificates

- Client certificates

• Affect

- InvalidCertChain (-9807) SSL errors with URLSession

Page 15: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - Trust Removals

Page 16: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Best Practices - What to Do Now?

• Check implementations, libraries, and servers

• Avoid ATS exceptions

Page 17: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

App Transport Security - Update

• Exceptions narrow down to per domain

• Exceptions expansion beyond WebKit (Certificate

Transparency requirement)

- AVFoundation loads

- WebView request

- Local network connection

Page 18: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

ATS-Compliant Services

Page 19: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Transport Later Security

Page 20: KKBOX WWDC17 Security - Antony

Your Apps and Evolving Network Security Standards

Enable TLS 1.3 Beta

• Not on by default

• iOS

https://developer.apple.com/go/?id=tls13-mobile-profile

• macOS

defaults write /Library/Preferences/com.apple.networkd tcp_connect_enable_tls13 1

Page 21: KKBOX WWDC17 Security - Antony

• Your Apps and Evolving Network Security Standards

• Privacy and Your Apps

• Advances in Networking

• What's new in Apple Pay Wallet

Page 22: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Page 23: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - iOS 10

Page 24: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - iOS 11

Page 25: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - Location

Page 26: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - Location

Support When In Use location authorization

• NSLocationWhenInUseUsageDescription

• NSLocationAlwaysAndWhenInUseUsageDescription

Page 27: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - LocationWhen In Use location authorization undefined in iOS 10

Page 28: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Prompting with Purpose - LocationWhen In Use location and Always authorization both defined in iOS 10

Page 29: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Photo Library access in iOS 11

• Image picker without prompting for access

• Write only support

• Authorization will be reset on upgrade

Page 30: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Photo Library write only access in iOS 11

NSPhotoLibraryAddUsageDescription

• UIImageWriteToSavedPhotosAlbum

• UISaveVideoAtPathToSavedPhotosAlbum

Page 31: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Core NFC

NFCReaderUsageDescription

• Scan for nearby NFC tags

• In the foreground

Page 32: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

Microphone - Watch OS

• Recording allowed to continue in the background

• Recording possible without the built-in modal UI

• Requires microphone authorization

• Indicator on watch face

Page 33: KKBOX WWDC17 Security - Antony

Safari and other apps get their own cookies and website data

Clearing website data in Safari also clears the data in your app

Privacy and Your Apps

Safari View Controller

Page 34: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

On-Device Processing

• CoreML

• VisionKit

• ARKit

• NLP

Page 35: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

DeviceCheck

• iOS, tvOS

• Per device, per developer data stored by Apple

• Two bits and a timestamp

Page 36: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

DeviceCheckUpdate bit state

Page 37: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

DeviceCheckRequest to Apple to query bit state

Page 38: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

DeviceCheckResponse from Apple with the bit state

Page 39: KKBOX WWDC17 Security - Antony

Privacy and Your Apps

DeviceCheck

• Handle resold or transferred devices

• Relevancy based on age

• Part of your app logic not sole source

Page 40: KKBOX WWDC17 Security - Antony

• Your Apps and Evolving Network Security Standards

• Privacy and Your Apps

• Advances in Networking

• What's new in Apple Pay Wallet

Page 41: KKBOX WWDC17 Security - Antony

Advances in Networking

• Explicit Congestion Notification

• IPv6

• Networking stack changes

• New Network Extension facilities

• Multipath protocols for multipath devices

• URLSession

Page 42: KKBOX WWDC17 Security - Antony

Advances in Networking

Explicit Congestion Notification

Page 43: KKBOX WWDC17 Security - Antony

Advances in Networking

IPv6

Page 44: KKBOX WWDC17 Security - Antony

Advances in Networking

IPv6

Page 45: KKBOX WWDC17 Security - Antony

Advances in Networking

Networking stack changes

Page 46: KKBOX WWDC17 Security - Antony

Advances in Networking

New Network Extension facilities

Page 47: KKBOX WWDC17 Security - Antony

Advances in Networking New Network Extension facilities -NEHotspotConfiguration

Page 48: KKBOX WWDC17 Security - Antony

Advances in Networking New Network Extension facilities -NEHotspotConfiguration

Page 49: KKBOX WWDC17 Security - Antony

Advances in Networking New Network Extension facilities -NEHotspotConfiguration

Page 50: KKBOX WWDC17 Security - Antony

Advances in Networking New Network Extension facilities - NEDNSProxyProvider

• Receives the system’s DNS query messages

• Handles them as it wishes

- Can send to recursive resolver of its choice

- Can send using protocol of its choice

‣ DNS over TLS

‣ DNS over HTTP

Page 51: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath protocols for multipath devices

Page 52: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath protocols for multipath devices

• Triggered by Marginal Wi-Fi

• “Fittest Wins Out” contest between Wi-Fi and Cell

• Wi-Fi has head start over Cell

• On a flow by flow basis, at flow setup time

Page 53: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath TCP

• Built on top of TCP

- Reliability

- Congestion control

• Seamless handover from Wi-Fi to Cell

• Chooses optimal interface for latency-sensitive flows

Page 54: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath TCP

• MPTCP schedules traffic across the interfaces

• One “TCP subflow” per interface

• MPTCP creates/destroys subflows

Page 55: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath TCP in Siri

• Implemented since iOS 7 for Siri

• User feedback (time to first word) 20% faster in the 95th percentile

• 5x reduction in network failures

Page 56: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath TCP in iOS11

• Server support

• Multipath service types

- Handover Mode

- Interactive Mode

• URLSession API

Page 57: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath TCP - Server support

Page 58: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath service types in iOS 11

• Handover Mode for high reliability

• Interactive Mode for low latency

Page 59: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath service types - Handover

• Reliability for persistent connections

• Minimal cell usage

• Available in Beta 1

Page 60: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath service types - Interactive

• Low latency for low-volume interactive flows

• Wi-Fi and cellular

• Available in an upcoming Beta

Page 61: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession support

Page 62: KKBOX WWDC17 Security - Antony

Advances in Networking

Multipath service types - Aggregation

• Combines link capacities

• Available through developer settings

• Starting in an upcoming Beta

Page 63: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession - Current

• Failure causes by weak connectivity

- NSURLErrorNotConnectedToInternet

- NSURLErrorCannotConnectToHost

• Manual retry by user or monitor condition by SCNetworkReachability

Page 64: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession

• New URLSessionConfiguration property

var waitsForConnectivity: Bool

• New URLSessionTaskDelegate method

urlSession(_:taskIsWaitingForConnectivity:) - optional

Page 65: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession

• Recommendation

- Always enable waitsForConnectivity

• Exception

- Requests that must be completed immediately, like transaction

Page 66: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession

Page 67: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask Scheduling API

Page 68: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask Scheduling API

• New URLSessionTask property

var earliestBeginDate: Date?

• New URLSessionTaskDelegate method called only when earliestBeginDate been set

urlSession(_:task:willBeginDelayedRequest:completionHandler:) - optional

Page 69: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask Scheduling API

Page 70: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask Scheduling API

New property for better scheduling by system

var countOfBytesClientExpectsToSend: Int64

var countOfBytesClientExpectsToReceive: Int64

NSURLSessionTransferSizeUnknown if cannot be estimated

Page 71: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask Progress

URLSessionTask implements ProgressReporting protocol

class URLSessionTask : NSObject, NSCopying, ProgressReporting

public var progress: Progress { get }

Page 72: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSessionTask ProgressProgress state management methods change URLSessionTask state

Page 73: KKBOX WWDC17 Security - Antony

Advances in Networking

URLSession Enhancements

• ProgressReporting

• Brotli compression

- Requires HTTPS (TLS)

• Public Suffix List updates

Page 74: KKBOX WWDC17 Security - Antony

• Your Apps and Evolving Network Security Standards

• Privacy and Your Apps

• Advances in Networking

• What's new in Apple Pay Wallet

Page 75: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay for Donations

• Accept donations for your nonprofit simply and securely

• Available within apps and on the web

• New donation button style

• https://developer.apple.com/support/apple-pay-nonprofits/

Page 76: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay Make Purchasing Easier

Page 77: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Other Benefits Of Apple Pay

• Reduction in chargebacks

• No need to handle or store credit card numbers

• Trusted user experience

Page 78: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Buttons

Page 79: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Inline Setup

• Apple Pay setup is now offered automatically

• Simply present an Apple Pay sheet to a user without cards

• Users are returned to your Apple Pay purchase immediately after setup

• Still faster than a typical manual checkout

Page 80: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Payment Errors

• Payment instrument failed to process

• Billing address didn’t match

• Email address was invalid

• Postal address had an incorrect ZIP

• Telephone was missing an area code

Page 81: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Payment Errors

Page 82: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

• Gracefully handle invalid or incorrect data directly in Apple Pay

• Display custom error messages

• Direct users to the specific fields that need correction

Page 83: KKBOX WWDC17 Security - Antony
Page 84: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

Page 85: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

Page 86: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

Page 87: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

Page 88: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Apple Pay - Custom Errors

New callback

Page 89: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Wallet

NFC passes

• NFC passes let you send customer information over

• NFC Only encrypted NFC passes supported from iOS 11

• Register for NFC passes at developer.apple.com/apple-pay

Page 90: KKBOX WWDC17 Security - Antony

What's new in Apple Pay Wallet

Wallet

Sharing

• Passes can now be opted out of sharing

• Useful for single use items like loyalty cards or tickets

Page 91: KKBOX WWDC17 Security - Antony

Thank you