Top Banner
User & Device Identity For Microservices @ Netflix Scale Satyajit Thadeshwar QCon San Francisco 2019
109

User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Jun 26, 2020

Download

Documents

dariahiddleston
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: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity For Microservices @ Netflix Scale

Satyajit ThadeshwarQCon San Francisco 2019

Page 2: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Logged out?#$%&!

Page 3: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Logged out?#$%&!

Page 4: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Time

Core Streaming Metric

Current Last Week

Page 5: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Satyajit ThadeshwarProduct Edge Access [email protected]

Page 6: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Complicated

Page 7: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 8: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

9 teams

57 watchers

Page 9: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Netflix subscribers and the devices that they use

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 10: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Where we were

What we did

Wins

Page 11: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Where we were

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 12: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Email: [email protected]: ********ESN: LGTV20165-193456G568

User Login

Page 13: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

EDGE ORIGIN

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

User Login

Page 14: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

success

User Login

Page 15: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

success

User Login

customerId: 10192378ESN: LGTV20165-193456G568Expires: In 8 hours

Page 16: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

successSet-Cookie

User Login

customerId: 10192378ESN: LGTV20165-193456G568Expires: In 8 hours

Page 17: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Authenticate Request

/browse

Page 18: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

EDGE ORIGIN

/browse

Authenticate Request

/browse

Page 19: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

EDGE ORIGIN

/browse

Authenticate Request

success

KEY MANAGEMENTSERVICE

/browse

Page 20: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

EDGE ORIGIN

/browse

Authenticate Request

success

MID-TIER SERVICES

customerId: 10192378ESN: LGTV20165-193456G568

KEY MANAGEMENTSERVICE

/browse

Page 21: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

EDGE ORIGIN

/browse

Authenticate Request

success

MID-TIER SERVICES

customerId: 10192378ESN: LGTV20165-193456G568

KEY MANAGEMENTSERVICE

/browse

Page 22: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

More than one service consuming cookies

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 23: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 24: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES/ios/android/atv...

Page 25: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 26: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 27: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 28: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 29: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

At massive scale

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 30: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Netflix

158M+ subscribers

Page 31: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Netflix

158M+ subscribers

1B+ devices

Page 32: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Netflix

158M+ subscribers

1B+ devices

2M peak RPS

Page 33: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Authenticate Request / Extract Identity

API

ORIGIN

KEY MANAGEMENTSERVICE = 2 million Requests Per Second

Page 34: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

More than one token type

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 35: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Cookies

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 36: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Cookies

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- Signup

Page 37: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Cookies

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- Signup

- Login

Page 38: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Cookies

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- Signup

- Login

- Discovery

Page 39: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

MSL Tokens

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- Device authentication

- Encryption

Message Security Layer (MSL)https://www.infoq.com/news/2014/11/netflix-msl/

Page 40: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

MSL Tokens

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- License

- Playback

Page 41: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

CTicket

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- Legacy devices

Page 42: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Partner Tokens

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

- JWS, JWE

- Non-member experiences

Page 43: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

- Signup- Sign-in- Discovery

- License- Playback

- Legacy devices

- Non-member experience

Cookies

MSL Tokens

CTicket

Partner Tokens (JWS, JWE)

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 44: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

LegacyAPI

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 45: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

- Multiple services consuming auth tokens

- Multiple types of auth tokens

- Massive scale

- Inefficient, insecure & complicated

Where we were

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 46: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

LegacyAPI

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

lolomo / Search

DRM

Other services

EDGE ORIGINS MID-TIER SERVICES

Page 47: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

DeviceAuth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPI

Page 48: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

What we didUser & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 49: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Moved authentication to the edge

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 50: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

Device Auth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPI

Page 51: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

Device Auth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPICookie

ServiceMSL

ServicePartner Service

EAS

Page 52: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

Device Auth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPICookie

ServiceMSL

ServicePartner Service

EAS

EDGE AUTHENTICATION SERVICES

Page 53: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

EAS

renewal / device auth / key exchange

Cookie Service

MSL Service

Partner Service

valid and not expired

95%

5%

Page 54: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Cookie Service

EAS

valid but expired

renewal call

Page 55: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Cookie Service

EAS

valid but expired

renewal call failed

Page 56: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Cookie Service

EAS

valid but expired

renewal call rescheduled

resolved identity

Page 57: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Cookie Service

EAS

valid but expired

renewal call rescheduled

rescheduled cookie

resolved identity

Page 58: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

Device Auth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPICookie

ServiceMSL

ServicePartner Service

EAS

EDGE AUTHENTICATION SERVICES

Page 59: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

API

Device Auth

Service

Legacy API

Netflix Microservices

SIGNUPFLOW

SERVICE

subscriber

authservice

EDGE ORIGINS MID-TIER SERVICES

NodeJSServices

Lolomo / Search

DRM

Other services

DiscoveryAPI

PlaybackAPICookie

ServiceMSL

ServicePartner Service

EAS

EDGE AUTHENTICATION SERVICES

Page 60: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

Page 61: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

- Identity structure created at the edge for each request

Page 62: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

- Identity structure created at the edge for each request

- Contains user & device identity

Page 63: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

- Identity structure created at the edge for each request

- Contains user & device identity

- Internal to Netflix ecosystem

Page 64: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

- Identity structure created at the edge for each request

- Contains user & device identity

- Internal to Netflix ecosystem

- Integrity protected by HMAC

Page 65: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport

- Identity structure created at the edge for each request

- Contains user & device identity

- Internal to Netflix ecosystem

- Integrity protected by HMAC

- Protobuf format

Page 66: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

Page 67: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

message Header { string originator = 1;}

Page 68: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

Page 69: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

message UserInfo { Source source = 1;

AuthenticationLevel auth_level = 2; Int64Wrapper customer_id = 3; Int64Wrapper account_owner_id = 4; repeated UserAction actions = ;

}

Page 70: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

message DeviceInfo { Source source = 1;

AuthenticationLevel auth_level = 2; StringValue esn = 3; Int32Value device_type = 4; repeated DeviceAction actions = 5;

}

Page 71: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage UserInfo { Source source = 1;

AuthenticationLevel auth_level = 2;}

message DeviceInfo { Source source = 1;

AuthenticationLevel auth_level = 2;}

Page 72: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage UserInfo { Source source = 1;

AuthenticationLevel auth_level = 2;}

message DeviceInfo { Source source = 1;

AuthenticationLevel auth_level = 2;} enum Source {

COOKIE = 1; MSL = 2; PARTNER_TOKEN = 3; CTICKET = 4;

}

Page 73: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage UserInfo { Source source = 1;

AuthenticationLevel auth_level = 2;}

message DeviceInfo { Source source = 1;

AuthenticationLevel auth_level = 2;} enum AuthenticationLevel {

LOW = 1; // untrusted transport HIGH = 2; // secure tokens over TLS HIGHEST = 3; // MSL or user credentials

}

Page 74: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passportmessage Passport {

Header header = 1; UserInfo user_info = 2; DeviceInfo device_info = 3; Integrity user_integrity = 4; Integrity device_integrity = 5;

}

message Integrity { string key_name = 1;

bytes hmac = 2;}

Page 75: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Introspector

- Wrapper over passport binary data

Page 76: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Introspector

- Wrapper over passport binary data

public interface PassportIntrospector { Long getCustomerId(); Long getAccountOwnerId(); String getEsn(); String getPassportAsString(); ...}

Page 77: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Introspector

- Wrapper over passport binary data

public interface PassportIntrospector { Long getCustomerId(); Long getAccountOwnerId(); String getEsn(); String getPassportAsString(); ...}

- Consumers create passportIntrospector from binary passport data

factory.createIntrospector(passport);

Page 78: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Tooling

Self-service tool for teams to decrypt passport

Page 79: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Actions

message UserInfo { repeated UserAction actions = 6;

...}

message DeviceInfo { repeated DeviceAction actions = 5;

...}

Page 80: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Actions

message UserInfo { repeated UserAction actions = 6;

...}

message DeviceInfo { repeated DeviceAction actions = 5;

...}

- Explicit signal sent by the downstream services, when an update to user or device identity has been performed

Page 81: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Actions

message UserInfo { repeated UserAction actions = 6;

...}

message DeviceInfo { repeated DeviceAction actions = 5;

...}

- Explicit signal sent by the downstream services, when an update to user or device identity has been performed

- This "signal" is used by EAS to either create or update the corresponding type of token

Page 82: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Action

Page 83: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Action: User Login

Page 84: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul

EDGE

Email: [email protected]: ********ESN: LGTV20165-193456G568

Passport Action: User Login

Page 85: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

EDGE ORIGIN

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

Passport Action: User Login

(Device Bound)

Page 86: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

success

Passport Action: User Login

(Device Bound)

Page 87: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

success

Passport Action: User Login

(Device Bound)

user loginuser login

Page 88: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Zuul API

Netflix Microservices

auth service

EDGE ORIGIN MID-TIER SERVICES

Email: [email protected]: ********ESN: LGTV20165-193456G568 /login

successSet-Cookie

Passport Action: User Login

Cookie Service

(Device Bound)

user loginuser login

Page 89: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Action: Profile Switch

Page 90: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Action: Profile Switch

- Each profile has its own identity

Page 91: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Action: Profile Switch

- Each profile has its own identity

- Switched profile tokens sent back to the device

Page 92: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Passport Actions

Separation Of Concerns

Increased Visibility

Page 93: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

- Moved authentication to the edge

- Streamlined the identity resolution and mutation path

- Making consumption of user & device identity

- Efficient, secure & simple

What we did

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 94: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

WinsUser & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Page 95: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Token Agnostic Identity

Downstream systems don't have to worry about authentication concerns

Page 96: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Simplified Authorization

Downstream services use authentication level for authorization decisions

Page 97: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Simplified Authorization

Before:

long customerId = 2123125603L;String ESN = "NFXBOX-235F…";

Page 98: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Extensible Identity Model

New attributes about user or device can be added

Page 99: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Local cache for up to date subscriber data message UserInfo {

BytesValue subscriber_account ...}

Placeholder for local cache of subscriber data

Page 100: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Offloaded &Fine Tuned

Offloaded token processing which resulted into significant gains for

- CPU- Request Latency - GC - Cluster Footprint

We were able to fine-tune EAS systems based on the token processing profile

Page 101: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Offloaded & Fine Tuned

Offloaded token processing which resulted into significant gains for

- CPU- Request Latency - GC - Cluster Footprint

We were able to fine tune EAS systems based on the token processing profile

Page 102: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Offloaded &Fine Tuned

- 30% reduction in CPU cost per request

- 40% reduction in load average

CPU to RPS ratio for API instance

Page 103: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Offloaded &Fine Tuned

- 30% reduction in average latency

- 99th percentile latency dropping by 20%

Response time for API instance

Page 104: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Offloaded &Fine Tuned

- Significant reduction in GC pressure and GC pause times

Stop the world GC for API cluster

Page 105: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Increased Visibility

Increased visibility into identities flowing in and out of Netflix ecosystem

...and into the identity mutations happening in a request

Page 106: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Developer Velocity

Greatly increased developer velocity for authentication related changes

Page 107: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Team focused onsecurity

Separation of concerns among the teams

Page 108: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

User & Device Identity for Microservices @ Netflix ScaleSatyajit Thadeshwar

Key Takeaways

- Token agnostic identity model

- Simplified authorization

- Extensible identity model

- Offloaded all the token processing from many systems

- Fine tuned individual microservices to suit the token processing profile

- Increased visibility into identities flowing and corresponding mutations

- Increased developer velocity for authentication & identity related changes

- Team focused on security

Page 109: User & Device Identity For Microservices @ Netflix Scale · User & Device Identity for Microservices @ Netflix Scale Satyajit Thadeshwar Zuul API Device Auth Service Legacy API Netflix

Thank You.

Satyajit [email protected]://www.linkedin.com/in/satyajit-thadeshwar