Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SCB Connect inside Banking Infrastructure

SCB Connect inside Banking Infrastructure

LINE Thailand Developer Conference 2019
https://www.facebook.com/events/410021356453349/

LINE Developers

June 04, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Who

    are you ? Jo, Software Engineer from
 SCB Digital Banking !
  2. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD บริการแจŒงเตือนผ‹าน

    ฟรี! SCB Connect features © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ถอน/โอนเ&น 1,000.00บ บ/ชx123456 17/05@12:34 ใ*ไ, 120,400.00บ เ&นโอน/เ&นเ-อน 30,000บ เ.าบ/ชx123456 25/05@02:09 0รายการใ*4ตร SCB-1234 @CTW 1,200.00 THB 6น7 28/05 วงเ&นคงเห<อใ* ไ, 248,800 บ.
  3. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD บริการขŒอมูลบัญชี

    บัตรเครดิต และสินเชื่อ SCB Connect features © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ผ>ต?ณAของCน
  4. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD บริการพิเศษ

    SCB Connect features © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD !ท#$เศษของ+น ตรวจเEคการFบGทIJเศษหMอใ*GทN ของOานไ,7P ค>ก บ.การจอง3วสาขา ใQRณจองSวTวงหUา โดยไWXองรอ ค>ก บ.การ SCB ใก78ณ ATM, สาขา, QองFบรองJเศษ หMอZอง ทาง[วนJเศษ ค>ก
  5. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD คุยกับนŒองบอท

    SCB Connect features © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Rย\บUองบอท
  6. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Agenda

    SCB Connect inside Banking Infrastructure 1 2 3 4 5 Customer Identification The anatomy of SCB Connect Pushing tremendous messages Made the chatbot more intelligent Handling Chatbot Flow
  7. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD MISTER


    BOT Handling Chatbot Flow Chatbot Flow Message Events [Message]
  8. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD MISTER


    BOT Handling Chatbot Flow Chatbot Flow Message Events [Message] Reply (Message) Message
  9. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD SYNC


    BOT Handling Chatbot Flow Chatbot Flow Message Events [Message] Reply (Message) Message Success 200
  10. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ASYNC


    BOT Handling Chatbot Flow Chatbot Flow Message Events [Message] Reply (Message) Message Success 200
  11. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Handling

    Chatbot Flow Chatbot Flow B2 Message Events [Message] Reply (Message) Message Success 200 B1 Retryable!
  12. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Handling

    Chatbot Flow Chatbot Flow B2 Message Events [Message] Reply (Message) Message Success 200 B1 Retryable!
  13. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Secure

    Network & Server Environments Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD HTTPS X-LINE-Signature Verification
  14. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD X-LINE-Signature

    Verification Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Fake Unauthorized access Disposed without processing X-LINE-Signature
 - digest value in the request body using HMAC-SHA256 algorithm
 - encoded with Base64 Authorized access Processing
  15. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD X-LINE-Signature

    Verification Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Reference : LINE Business Connect Developer Operational Guidelines
  16. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Secure

    Network & Server Environments Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD HTTPS Push / Reply / Multicast, .. any API IP Whitelisting
 xxx.xxx.xxx.xxx/xx
  17. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD IP

    Whitelisting Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Reference : LINE Developer Console
  18. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Secure

    Network & Server Environments Security over LINE Messaging Platform © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD HTTPS Push / Reply / Multicast, .. any API IP Whitelisting
 xxx.xxx.xxx.xxx/xx X-LINE-Signature Verification
  19. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Customer

    On-boarding Know Your Customer Register Settings
  20. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Web

    Authentication Security over LINE Messaging Platform Channel Web App LINE Login LIFF line://ch/xxxxx https://access.line.me/oauth2/v2.1/authorize? response_type=type&client_id=channelId&redirect_ uri=encodedUrl&state=state&scope=scope&nonce =nonce line://app/xxxxx (Deprecated)
  21. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD LINE

    Login Security over LINE Messaging Platform LINE Login URI Access Authorize Page Redirect to LINE Login
  22. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD LINE

    Login Security over LINE Messaging Platform Automatically Login by LINE Open LINE Login Access Authorize Page Redirect to LINE Login Login with Username & Password Authorize Code Login Page
  23. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Automatically

    Login by LINE LINE Login Security over LINE Messaging Platform Open LINE Login Extract LINE UserId
 From JWT Authorized Access Authorize Page Redirect to LINE Login Login with Username & Password Authorize Code Login Page Passing Authorize Code Create Session :ดการ<อ=ล
 connect.scb Get Token JWT Token
  24. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD LINE

    Front-end Framework (LIFF) Security over LINE Messaging Platform Access Authorize Page Authentication Page LIFF URI
  25. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD 1


    2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 LINE Front-end Framework (LIFF) Security over LINE Messaging Platform <script src="https://d.line-scdn.net/liff/1.0/sdk.js"></script>
 
 <script th:inline="javascript"> window.onload = function (e) { liff.init(function (d) { passingAccessToken(d); }); };
 function passingAccessToken(d) {
 // passing access token to backends side liff.getAccessToken(); } </script>
  26. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD LINE

    Front-end Framework (LIFF) Security over LINE Messaging Platform liff.getAccessToken() Passing LIFF Access Token GET /v2/profile LINE UserId Create Session Authorized Access Authorize Page Authentication Page
  27. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Infrastructure

    The anatomy of SCB Connect INTRANET DMZ INTERNET
  28. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD APP

    APP APP APP Infrastructure The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub COREBANK CARDS … DEPOSIT … … PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET SERVICE LB Redis Database SERVICE LB SERVICE LB SERVICE LB Firewall & Load Balancer REVERSE PROXY REVERSE PROXY REVERSE PROXY
  29. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Infrastructure

    The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub COREBANK CARDS … DEPOSIT … … PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET Redis Database Firewall & Load Balancer REVERSE PROXY REVERSE PROXY REVERSE PROXY 
 
 
 KUBERNETES
 CLUSTER Internal Gateway
  30. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD KUBERNETES

    CLUSTER
 
 
 
 
 
 
 
 
 
 
 Infrastructure The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub SERVICE SERVICE SERVICE Firewall & Load Balancer Internal Gateway SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE COREBANK CARDS … DEPOSIT … … Events Web Push / Reply
 / Multicast REVERSE PROXY PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET REVERSE PROXY REVERSE PROXY ELK Grafana Promethus Redis Database KAFKA KAFKA KAFKA
  31. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Transactions

    flow The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub Firewall & Load Balancer COREBANK CARDS … DEPOSIT … … Events Web Push! REVERSE PROXY PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET REVERSE PROXY REVERSE PROXY KUBERNETES CLUSTER
 
 
 
 
 
 
 
 
 
 
 SERVICE SERVICE SERVICE Internal Gateway SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE ELK Grafana Promethus Redis Database KAFKA KAFKA KAFKA
  32. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Pushing

    tremendous messages to Messaging API 4
  33. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Pushing

    in the past Event sourcing WORKER API SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER 
 Redis API API SERVICE SERVICE SERVICE HTTPS Chat log
  34. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Pushing

    in the past Event sourcing WORKER API SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER 
 Redis API API SERVICE SERVICE SERVICE Chat log Lost!
  35. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD REST

    isn’t Always Best Event sourcing Synchronous integrations
 Externally facing APIs Point-to-Point
 Tight service coupling Not natively event-driven # $
  36. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Enabling

    event-driven communications behind “SCB Connect” from ‘Invoking services’ to ‘emit events’ inputs and outputs can be thought of as ‘events’
  37. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Message

    Exchange Patterns Event sourcing Request / Reply Publish / Subscribe Streaming CONSUMER SERVICE Request Reply EVENT BROKER SUBSCRIBER 2 SUBSCRIBER 1 x, y, z y, z PUBLISHER x y z STREAMING BROKER .
 SUBSCRIBER 2 SUBSCRIBER 1 x, y, z x, y, z PUBLISHER x y z With replay mechanism
  38. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Incoming

    events in the past Event sourcing WORKER API SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER API 
 Redis API WORKER SERVICE SERVICE SERVICE HTTPS Chat log
  39. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Revise

    new messaging system (Incoming) Event sourcing WORKER SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WEBHOOK SERVICE SERVICE SERVICE Chat log KAFKA KAFKA KAFKA MESSAGE FOLLOW UNFOLLOW JOIN LEAVE MEMBER JOIN MEMBER LEAVE POSTBACK Messages Topic Operations Topic Group Topic ACCOUNT LINK Others Topic BEACON
  40. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Outgoing

    events in the past Event sourcing WORKER API SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER 
 Redis API API SERVICE SERVICE SERVICE HTTPS Chat log
  41. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Revise

    new messaging system (Outgoing) Event sourcing WORKER API SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER API CONSUMER SERVICE SERVICE KAFKA KAFKA KAFKA 
 Redis Chat log
  42. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD API

    Rate Limits Event sourcing WORKER CONSUMER SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER CONSUMER CONSUMER SERVICE SERVICE KAFKA KAFKA KAFKA 
 Redis Chat log
  43. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD API

    Rate Limits Event sourcing WORKER CONSUMER SCB Enterprise Systems SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE WORKER WORKER CONSUMER CONSUMER SERVICE SERVICE KAFKA KAFKA KAFKA 
 Redis Chat log
  44. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD API

    Rate Limits Event sourcing WORKER WORKER WORKER 50 TPS 50 TPS 50 TPS 10,000 Request / Min
 ~166 TPS 50 TPS / Worker
 ~150 TPS
  45. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD API

    Rate Limits Event sourcing New Rate Limits (After LINE Redesign 18 April 2019) 
 
 Multicast
 - 100,000 calls / min
 - 2,000,000 recipients / min / bot
 
 Broadcast
 - 60 requested / hour
 
 Others API - 100,000 requested / min Rate Limits
 
 10,000 calls / min (~ 166 calls / sec)
 200,000 recipients / min / bot Reference : https://developers.line.biz/en/reference/messaging-api/#rate-limits
  46. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Message

    Type Classification Message Prioritization Transaction Alert Chatbot / Inquiry Personalize Campaign Batch / Reminder Broadcast Campaign Retargeting
  47. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Inquiry

    flow The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub Firewall & Load Balancer COREBANK CARDS … DEPOSIT … … Events Web REVERSE PROXY PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET REVERSE PROXY REVERSE PROXY KUBERNETES CLUSTER
 
 
 
 
 
 
 
 
 
 
 SERVICE SERVICE SERVICE Internal Gateway SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE ELK Grafana Promethus Redis Database KAFKA KAFKA KAFKA Reply!
  48. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Inquiry

    flow The anatomy of SCB Connect SCB Enterprise Systems SCB Enterprise API Enterprise PubSub Firewall & Load Balancer COREBANK CARDS … DEPOSIT … … Events Web REVERSE PROXY PROXY Datalake & Analytic Systems Partner API INTRANET DMZ INTERNET REVERSE PROXY REVERSE PROXY KUBERNETES CLUSTER
 
 
 
 
 
 
 
 
 
 
 SERVICE SERVICE SERVICE Internal Gateway SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE ELK Grafana Promethus Redis Database KAFKA KAFKA KAFKA Reply!
  49. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Response

    of Chatbot Fulfilment data with chatbot Chatbot Response
 Fulfilment response from core-bank วงเ&นคงเห<อ SCB JCB PLATINUM - XXXX วงเ&นคงเห<อ 300,000.00 บาท .อ]ล 25 พ.ค. 62 (14:00 น.)
  50. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Intelligent

    Chatbot
 Powered by Response of Chatbot Fulfilment data with chatbot Auto Response
 Exactly Match วงเ&นคงเห<อ SCB JCB PLATINUM - XXXX วงเ&นคงเห<อ 300,000.00 บาท .อ]ล 25 พ.ค. 62 (14:00 น.) SCB JCB PLATINUM - XXXX วงเ&นคงเห<อ 300,000.00 บาท .อ]ล 25 พ.ค. 62 (14:00 น.) วงเ&นใน4ตรเห<อเOาไร`า
  51. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ©

    2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ห6ดa ส6สabะ UองบอทdนaใQบeการbะ % Response of Chatbot Fulfilment data with chatbot
  52. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD ©

    2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD . PfอgดเhมXนความFกของเราjเปTาคะ & Response of Chatbot Fulfilment data with chatbot
  53. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Next,

    
 Made the chatbot more intelligent
 by GDialogflow 5
  54. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Who

    are you ? Mike, Tech Lead from
 SCB10X1
  55. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD How

    to make good chatbot? No you are not done after creating chatbot… NLU UX +
  56. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD Chatbot

    Maintenance Model How to give bot insight to maintainer? ADAPTER Data Studio Monitoring & Logging FULFILLMENT Chatbase Create/Update intents Request for fulfillment Develop fulfillment BigQuery Intent ideas
  57. © 2019 THE SIAM COMMERCIAL BANK PUBLIC COMPANY LTD The

    Great SBD Monitoring Stack This can be used with other app as well!