SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Migrating 30k bank
users - what can
possibly go wrong?
Anna Skawińska
Anna Skawińska
Node.js Team Manager,
Senior Node.js Developer @TSH
also: mom of 2, wife, self-taught musician,
constant learner and doer, dad joke professional
Agenda
The Masterplan
2
The Challenge
1
The Reality
3
Lessons learned
4
The Challenge
Greenfield app
Cognito User Pool
● email used as username
● email used as password recovery method
● phone number used as MFA method
● so: both required
Backend
Legacy app
● blackbox
● > 26 000 users
Migration of logins
logins
Greenfield app
banking data
● 3 months on prod
● for new customers only
● < 100 users
Cloud-native
backend
Legacy app
Two customers, one login
Two customers, one login
ID USERNAME PASSWORD
123456 AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
423454 AA23456 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
423455 AB23456 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
LOGIN_ID FIRST_NAME LAST_NAME DATE_OF_BIRTH CUSTOMER_ID PHONE EMAIL
123456 Mrs Smith 01-01-1985 XXXXX null null
123456 Mr Smith 06-06-1980 YYYYY null null
Logins
Customers
The Masterplan
Extract logins to DynamoDB
username,
password,
date of birth,
old customer ID
Extract
Create
Join
DynamoDB
Denormalize Logins using dateOfBirth
USERNAME PASSWORD DATE_OF_BIRTH NEW_CUSTOMER_ID
AA_SMITH
0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
01-01-1985 0010E00001IfPmYQAV
AA_SMITH
0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
06-06-1980 0010E00001GgxM2QAJ
How to load it to Cognito?
✅ transparent to the users
❌ email missing - mandatory in our Cognito (alias and recovery method)
❌ phone missing - mandatory in our Cognito (MFA method)
Bulk import?
Migrate User Lambda trigger?
SignIn:
username/
password
user doesn’t
exist?
external user
directory
import username/
password
Migrate User Lambda - code
exports.handler = (event, context, callback) => {
var user;
if ( event.triggerSource == "UserMigration_Authentication" ) {
// authenticate the user with your existing user directory service
user = authenticateUser(event.userName, event.request.password);
if ( user ) {
storeCustomerId(event.userName, user.customerId);
event.response.userAttributes = {
"email": event.request.validationData.email,
"phone_number": event.request.validationData.phone_number,
};
event.response.finalUserStatus = "CONFIRMED";
event.response.messageAction = "SUPPRESS";
context.succeed(event);
}
else {
// Return error to Amazon Cognito
callback("Bad password");
}
}
};
But: password policy
Legacy app:
#yolo xD
Cognito:
Policies:
PasswordPolicy:
MinimumLength: 12
RequireLowercase: true
RequireNumbers: true
RequireSymbols: true
RequireUppercase: true
But: password policy..?
🤔
󰣼
🙀
⁉
Password policy 2021 vs 2022
✅ may be transparent to the user
✅ first sign in: custom authentication against pre-migrated logins
✅ ValidationData, ClientMetadata: user could add phone, email address…
❌ 2021: Password Policy applied on legacy passwords
✅ 2022: Password Policy no longer applied on legacy passwords!
Migrate User Lambda trigger?
The Masterplan
First SignUp…
…then check legacy login
SignUp: email,
password, phone…
ConfirmSignUp
(verify email)
InitiateAuth
GraphQL: migrateLegacyUser(
oldUsername, oldPassword,
dateOfBirth)
verifyLegacyLogin(
oldUsername, oldPassword,
dateOfBirth)
new UserId ⇒ new CustomerId
RespondToAuthChallenge
(MFA => verify phone)
How to do it securely?
● What if it leaks out?
● Oh, it’s just temp!
USERNAME PASSWORD DATE_OF_BIRTH NEW_CUSTOMER_ID
AA_SMITH
0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
01-01-1985 0010E00001IfPmYQAV
AA_SMITH
0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2
06-06-1980 0010E00001GgxM2QAJ
superCoolHashingFunction!
PK NEW_CUSTOMER_ID
a883a161f49e38d70bc17e0915d2faf0da58aaef7352f2204fdc916969d36cc69f9d
374cf764e210687633001bd6ac25d2bcbaf695e0e6ebb20893fa1f5603ac 0010E00001GgxM2QAJ
● This Dynamo table stays for the verifyLegacyLogin Lambda
SuperCoolHashingFunction
async generateHash(username: string, passwordHash: string, dateOfBirth: string) {
// So that identical passwords have unique hash:
const salt = `${username}#${dateOfBirth}`;
const hash = await this.hashWithSalt(passwordHash, salt);
// So that a leaked hash table can't be reverse engineered:
const pepperedHash = await this.hashWithSalt(hash, this.options.passwordSalt);
return pepperedHash;
}
The Reality
● check with test data:
○ generate fake credentials + date of birth, store in DDB, automate
○ worked (repeatedly) ✅
● check with a couple of “friendly” customers (knowing their passwords upfront)
○ worked ✅
So far, so good
Day 0
SMS Quota
● 7.5k people * $0.1189 / SMS ≈ $900
● quota at the time?
● $100…
● raised to $1000 right away
● enough for how long..?
UX failure #1: “Sign up” vs “Migrate”
● target group: 60+
● missed the “already have an account?” question
● solution: “sign in” is now on a different landing page than
“sign up”
UX failure #2 - no validation on username
● no prior idea of what usernames look like
● (black box)
● temp migration table only accessed by the Bank’s internal
employee
Security failure
● Customer: “password doesn’t work”
● …Engineers: added “reveal password” feature
● Customer: “password doesn’t work”
● CTO + Engineer on the line
● Customer, CTO, Engineer: “password doesn’t work”
● guessing game, reverse engineering legacy system…
● …
● …legacy system cropped long passwords
● solution: why not crop, too 🙈 (migration step only)
Lessons learned
Expect the unexpected
● UI changes on demand!
Expect a peak right after announcement
● expect a massive peak on the first day / week after the announced migration
● calculate the monthly quotas accordingly
● you can lower them after the first month
Lambda autoscaling worked like a charm
● there was no need for provisioned concurrency
● peak traffic gracefully handled
Migration Lambda Trigger - weak passwords work now!
● The Out-of-the-box AWS Cognito functionality would work now
● you can forget this presentation now 󰤆
tsh.io
Thank you for your attention.
Miłej środy!

Weitere ähnliche Inhalte

Ähnlich wie Zmigrujmy 30 tys. użytkowników ze starego systemu. Co może pójść nie tak?

Mozilla Persona for your domain
Mozilla Persona for your domainMozilla Persona for your domain
Mozilla Persona for your domainFrancois Marier
 
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...Nordic APIs
 
Providing security to online banking Project Presentation-3.pptx
Providing security to online banking Project Presentation-3.pptxProviding security to online banking Project Presentation-3.pptx
Providing security to online banking Project Presentation-3.pptxSanviSanvi11
 
Kym - GoJek GoPay integration
Kym - GoJek GoPay integration Kym - GoJek GoPay integration
Kym - GoJek GoPay integration Jay Lohokare
 
UX Strategy and The Questions; UX in AZ Meetup, May 2019
UX Strategy and The Questions; UX in AZ Meetup, May 2019UX Strategy and The Questions; UX in AZ Meetup, May 2019
UX Strategy and The Questions; UX in AZ Meetup, May 2019GoDaddy
 
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...MongoDB
 
Amol Chillarge Asp.net C# developer and Tester
Amol Chillarge Asp.net C# developer and TesterAmol Chillarge Asp.net C# developer and Tester
Amol Chillarge Asp.net C# developer and TesterAmol Chillarge
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchMongoDB
 
Bhaurao 2+ Experience in Node.js
Bhaurao 2+ Experience in Node.jsBhaurao 2+ Experience in Node.js
Bhaurao 2+ Experience in Node.jsBhaurao Birajdar
 
Stream me to the Cloud (and back) with Confluent & MongoDB
Stream me to the Cloud (and back) with Confluent & MongoDBStream me to the Cloud (and back) with Confluent & MongoDB
Stream me to the Cloud (and back) with Confluent & MongoDBconfluent
 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applicationsFrancois Marier
 
Luke's portfolio
Luke's portfolioLuke's portfolio
Luke's portfolioKe Lu
 
LoginCat - Zero Trust Integrated Cybersecurity
LoginCat - Zero Trust Integrated CybersecurityLoginCat - Zero Trust Integrated Cybersecurity
LoginCat - Zero Trust Integrated CybersecurityRohit Kapoor
 

Ähnlich wie Zmigrujmy 30 tys. użytkowników ze starego systemu. Co może pójść nie tak? (20)

Mozilla Persona for your domain
Mozilla Persona for your domainMozilla Persona for your domain
Mozilla Persona for your domain
 
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
How I Built Bill, the AI-Powered Chatbot That Reads Our Docs for Fun , by Tod...
 
Providing security to online banking Project Presentation-3.pptx
Providing security to online banking Project Presentation-3.pptxProviding security to online banking Project Presentation-3.pptx
Providing security to online banking Project Presentation-3.pptx
 
Resume Salmaan Ahamed AM
Resume Salmaan Ahamed AMResume Salmaan Ahamed AM
Resume Salmaan Ahamed AM
 
Kym - GoJek GoPay integration
Kym - GoJek GoPay integration Kym - GoJek GoPay integration
Kym - GoJek GoPay integration
 
UX Strategy and The Questions; UX in AZ Meetup, May 2019
UX Strategy and The Questions; UX in AZ Meetup, May 2019UX Strategy and The Questions; UX in AZ Meetup, May 2019
UX Strategy and The Questions; UX in AZ Meetup, May 2019
 
Are API Services Taking Over All the Interesting Data Science Problems?
Are API Services Taking Over All the Interesting Data Science Problems?Are API Services Taking Over All the Interesting Data Science Problems?
Are API Services Taking Over All the Interesting Data Science Problems?
 
Ankita kumthekar
Ankita kumthekarAnkita kumthekar
Ankita kumthekar
 
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...
MongoDB World 2018: Decentralized Identity Management with Blockchain and Mon...
 
Amol Chillarge Asp.net C# developer and Tester
Amol Chillarge Asp.net C# developer and TesterAmol Chillarge Asp.net C# developer and Tester
Amol Chillarge Asp.net C# developer and Tester
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Continuous delivery
Continuous deliveryContinuous delivery
Continuous delivery
 
Bhaurao 2+ Experience in Node.js
Bhaurao 2+ Experience in Node.jsBhaurao 2+ Experience in Node.js
Bhaurao 2+ Experience in Node.js
 
Stream me to the Cloud (and back) with Confluent & MongoDB
Stream me to the Cloud (and back) with Confluent & MongoDBStream me to the Cloud (and back) with Confluent & MongoDB
Stream me to the Cloud (and back) with Confluent & MongoDB
 
Kumar Kuppanna CV
Kumar Kuppanna CVKumar Kuppanna CV
Kumar Kuppanna CV
 
Nitin bondre
Nitin bondreNitin bondre
Nitin bondre
 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applications
 
Luke's portfolio
Luke's portfolioLuke's portfolio
Luke's portfolio
 
LoginCat - Zero Trust Integrated Cybersecurity
LoginCat - Zero Trust Integrated CybersecurityLoginCat - Zero Trust Integrated Cybersecurity
LoginCat - Zero Trust Integrated Cybersecurity
 
Mayank_Gupta
Mayank_GuptaMayank_Gupta
Mayank_Gupta
 

Mehr von The Software House

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...The Software House
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?The Software House
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?The Software House
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeThe Software House
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?The Software House
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSThe Software House
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptThe Software House
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptThe Software House
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLThe Software House
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychThe Software House
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciThe Software House
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case studyThe Software House
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejThe Software House
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachThe Software House
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsThe Software House
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeThe Software House
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduThe Software House
 

Mehr von The Software House (20)

Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
Jak kraść miliony, czyli o błędach bezpieczeństwa, które mogą spotkać również...
 
Uszanowanko Podsumowanko
Uszanowanko PodsumowankoUszanowanko Podsumowanko
Uszanowanko Podsumowanko
 
Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?Jak efektywnie podejść do certyfikacji w AWS?
Jak efektywnie podejść do certyfikacji w AWS?
 
O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?O co chodzi z tą dostępnością cyfrową?
O co chodzi z tą dostępnością cyfrową?
 
Chat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon ChimeChat tekstowy z użyciem Amazon Chime
Chat tekstowy z użyciem Amazon Chime
 
Migracje danych serverless
Migracje danych serverlessMigracje danych serverless
Migracje danych serverless
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?
 
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWSAnaliza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
Analiza semantyczna artykułów prasowych w 5 sprintów z użyciem AWS
 
Feature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScriptFeature flags na ratunek projektu w JavaScript
Feature flags na ratunek projektu w JavaScript
 
Typowanie nominalne w TypeScript
Typowanie nominalne w TypeScriptTypowanie nominalne w TypeScript
Typowanie nominalne w TypeScript
 
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQLAutomatyzacja tworzenia frontendu z wykorzystaniem GraphQL
Automatyzacja tworzenia frontendu z wykorzystaniem GraphQL
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danych
 
Testy API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięciTesty API: połączenie z bazą danych czy implementacja w pamięci
Testy API: połączenie z bazą danych czy implementacja w pamięci
 
Jak skutecznie read model. Case study
Jak skutecznie read model. Case studyJak skutecznie read model. Case study
Jak skutecznie read model. Case study
 
Firestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny KrzemowejFirestore czyli ognista baza od giganta z Doliny Krzemowej
Firestore czyli ognista baza od giganta z Doliny Krzemowej
 
Jak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzachJak utrzymać stado Lambd w ryzach
Jak utrzymać stado Lambd w ryzach
 
Jak poskromić AWS?
Jak poskromić AWS?Jak poskromić AWS?
Jak poskromić AWS?
 
O łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.jsO łączeniu Storyblok i Next.js
O łączeniu Storyblok i Next.js
 
Amazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurzeAmazon Step Functions. Sposób na implementację procesów w chmurze
Amazon Step Functions. Sposób na implementację procesów w chmurze
 
Od Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki koduOd Figmy do gotowej aplikacji bez linijki kodu
Od Figmy do gotowej aplikacji bez linijki kodu
 

Kürzlich hochgeladen

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 

Zmigrujmy 30 tys. użytkowników ze starego systemu. Co może pójść nie tak?

  • 1. Migrating 30k bank users - what can possibly go wrong? Anna Skawińska
  • 2. Anna Skawińska Node.js Team Manager, Senior Node.js Developer @TSH also: mom of 2, wife, self-taught musician, constant learner and doer, dad joke professional
  • 3. Agenda The Masterplan 2 The Challenge 1 The Reality 3 Lessons learned 4
  • 5.
  • 7. Cognito User Pool ● email used as username ● email used as password recovery method ● phone number used as MFA method ● so: both required
  • 8. Backend Legacy app ● blackbox ● > 26 000 users Migration of logins logins Greenfield app banking data ● 3 months on prod ● for new customers only ● < 100 users Cloud-native backend
  • 11. Two customers, one login ID USERNAME PASSWORD 123456 AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 423454 AA23456 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 423455 AB23456 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 LOGIN_ID FIRST_NAME LAST_NAME DATE_OF_BIRTH CUSTOMER_ID PHONE EMAIL 123456 Mrs Smith 01-01-1985 XXXXX null null 123456 Mr Smith 06-06-1980 YYYYY null null Logins Customers
  • 12.
  • 14. Extract logins to DynamoDB username, password, date of birth, old customer ID Extract Create Join DynamoDB
  • 15. Denormalize Logins using dateOfBirth USERNAME PASSWORD DATE_OF_BIRTH NEW_CUSTOMER_ID AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 01-01-1985 0010E00001IfPmYQAV AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 06-06-1980 0010E00001GgxM2QAJ
  • 16. How to load it to Cognito?
  • 17. ✅ transparent to the users ❌ email missing - mandatory in our Cognito (alias and recovery method) ❌ phone missing - mandatory in our Cognito (MFA method) Bulk import?
  • 18. Migrate User Lambda trigger? SignIn: username/ password user doesn’t exist? external user directory import username/ password
  • 19. Migrate User Lambda - code exports.handler = (event, context, callback) => { var user; if ( event.triggerSource == "UserMigration_Authentication" ) { // authenticate the user with your existing user directory service user = authenticateUser(event.userName, event.request.password); if ( user ) { storeCustomerId(event.userName, user.customerId); event.response.userAttributes = { "email": event.request.validationData.email, "phone_number": event.request.validationData.phone_number, }; event.response.finalUserStatus = "CONFIRMED"; event.response.messageAction = "SUPPRESS"; context.succeed(event); } else { // Return error to Amazon Cognito callback("Bad password"); } } };
  • 20. But: password policy Legacy app: #yolo xD Cognito: Policies: PasswordPolicy: MinimumLength: 12 RequireLowercase: true RequireNumbers: true RequireSymbols: true RequireUppercase: true
  • 23. ✅ may be transparent to the user ✅ first sign in: custom authentication against pre-migrated logins ✅ ValidationData, ClientMetadata: user could add phone, email address… ❌ 2021: Password Policy applied on legacy passwords ✅ 2022: Password Policy no longer applied on legacy passwords! Migrate User Lambda trigger?
  • 27. SignUp: email, password, phone… ConfirmSignUp (verify email) InitiateAuth GraphQL: migrateLegacyUser( oldUsername, oldPassword, dateOfBirth) verifyLegacyLogin( oldUsername, oldPassword, dateOfBirth) new UserId ⇒ new CustomerId RespondToAuthChallenge (MFA => verify phone)
  • 28. How to do it securely? ● What if it leaks out? ● Oh, it’s just temp! USERNAME PASSWORD DATE_OF_BIRTH NEW_CUSTOMER_ID AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 01-01-1985 0010E00001IfPmYQAV AA_SMITH 0x49FE91D153D79C57FA3EC25E1BB762EE9527313E7F02060E281AA36F5B6AE4E2 06-06-1980 0010E00001GgxM2QAJ superCoolHashingFunction! PK NEW_CUSTOMER_ID a883a161f49e38d70bc17e0915d2faf0da58aaef7352f2204fdc916969d36cc69f9d 374cf764e210687633001bd6ac25d2bcbaf695e0e6ebb20893fa1f5603ac 0010E00001GgxM2QAJ ● This Dynamo table stays for the verifyLegacyLogin Lambda
  • 29. SuperCoolHashingFunction async generateHash(username: string, passwordHash: string, dateOfBirth: string) { // So that identical passwords have unique hash: const salt = `${username}#${dateOfBirth}`; const hash = await this.hashWithSalt(passwordHash, salt); // So that a leaked hash table can't be reverse engineered: const pepperedHash = await this.hashWithSalt(hash, this.options.passwordSalt); return pepperedHash; }
  • 31. ● check with test data: ○ generate fake credentials + date of birth, store in DDB, automate ○ worked (repeatedly) ✅ ● check with a couple of “friendly” customers (knowing their passwords upfront) ○ worked ✅ So far, so good
  • 32. Day 0
  • 33. SMS Quota ● 7.5k people * $0.1189 / SMS ≈ $900 ● quota at the time? ● $100… ● raised to $1000 right away ● enough for how long..?
  • 34. UX failure #1: “Sign up” vs “Migrate” ● target group: 60+ ● missed the “already have an account?” question ● solution: “sign in” is now on a different landing page than “sign up”
  • 35. UX failure #2 - no validation on username ● no prior idea of what usernames look like ● (black box) ● temp migration table only accessed by the Bank’s internal employee
  • 36. Security failure ● Customer: “password doesn’t work” ● …Engineers: added “reveal password” feature ● Customer: “password doesn’t work” ● CTO + Engineer on the line ● Customer, CTO, Engineer: “password doesn’t work” ● guessing game, reverse engineering legacy system… ● … ● …legacy system cropped long passwords ● solution: why not crop, too 🙈 (migration step only)
  • 38. Expect the unexpected ● UI changes on demand!
  • 39. Expect a peak right after announcement ● expect a massive peak on the first day / week after the announced migration ● calculate the monthly quotas accordingly ● you can lower them after the first month
  • 40. Lambda autoscaling worked like a charm ● there was no need for provisioned concurrency ● peak traffic gracefully handled
  • 41. Migration Lambda Trigger - weak passwords work now! ● The Out-of-the-box AWS Cognito functionality would work now ● you can forget this presentation now 󰤆
  • 42. tsh.io Thank you for your attention.