SlideShare a Scribd company logo
An Architects Hands-on Experience in
Securing Microservices with JSON Web
Token using IBM Datapower
Sandip Gupta
Senior Client Architect
Cloud & Cognitive BU, IBM India
5th April 2020
Laptop
Deployment Topology
2
Datapower Container
Multiprotocol Gateway
Front Side
Handler
(Client)
Policy
(Client-to-Server
Backend
(Server)
https://mqserver:8000/crt/test
https://mqserver:9090/dp/login
Host: mqserver
Client Key
Client Certificate
Server Key
Server Certificate
Physical Layout of the components used and their interactions
https://mqserver:8000/vrf/test
Create JWT Token
Verify JWT Token
SoapUI
3
Setup Details
4
Topology Setup – Commands used
Component Versions Commands – First time Commands - Repeated
Operating
System
Macos Mojave
10.14.5
Add an entry in /etc/hosts
<laptop_ip> mqserver
#mkdir $HOME/mq
#mkdir $HOME/dp
IP Address of the laptop
#ifconfig | grep inet4
#ping mqserver
Laptop’s IP address needs to be used
instead of localhost or 127.0.0.1
between DP & MQ containers
Docker
Community
Edition
Docker CE
2.1.0.2
Kitematic 0.17.9
#docker ps
#docker images
# Start Docker Engine
Openssl 2.6.5 #mkdir $HOME/mq/certs
#cd $HOME/mq/certs
#openssl genrsa -out server.key 2048
#openssl req -new -x509 -key server.key -out
server.cert –days 365
#openssl genrsa -out client.key 2048
#openssl req -new -x509 -key client.key -out
client.cert –days 365
<Server Key>
Private key and Public Cert of
Datapower Server
<Client Key>
Private key and Public Cert of MQ
Server
SOAP UI 5.5.0
5
Topology Setup – Contd…
Component Versions Commands – First time Commands - Repeated
Datapower
Developer
Edition
2018.1.10 #docker pull ibmcom/datapower:latest
#cd $HOME/dp
#git clone https://github.com/ibm-
datapower/datapower-tutorials.git
#cd $HOME/dp/datapower-tutorials/getting-
started
# docker run -it 
-v $PWD/config:/drouter/config 
-v $PWD/local:/drouter/local 
-e DATAPOWER_ACCEPT_LICENSE=true 
-e DATAPOWER_INTERACTIVE=true 
-p 9090:9090 
-p 9022:22 
-p 5554:5554 
-p 8000-8010:8000-8010 
--name idg 
ibmcom/datapower
configure; web-mgmt 0 9090 9090;
Exit the container
Start IDG container using Kitematic
#docker run –it idg
#docker ps
#docker inspect <dp_container> | grep
IPAddress
<WebConsole>
URL: https://mqserver:9090/dp/login
User: admin:admin
6
JWT Structure
7
IBM Datapower
8
Crypto in Datapower
Two Keys – One named as Client Key & another one as Server Key. Each has their own public certificates.
Client Key & Certificate Server Key & Certificate
9
Multi-Protocol Gateway Services in Datapower
Created two multi-protocol gateway services
rest_mpgw: Multi-protocol gateway service to secure microservice using JWT
token with digital signing and/or encryption
10
Multi-protocol Security Policy in Datapower - 1
11
Multi-protocol Security Policy in Datapower - 2
12
Front Side Handler in Datapower
Acts as a Client to Datapower which is always the server!!
13
JSON Web Token
using IBM Datapower
14
JWT Create Policy in Datapower
15
Matching Rules in Datapower
16
Result Rule in Datapower
17
JWT Create AAA Policy in Datapower - 1
18
JWT Create AAA Policy in Datapower - 2
Select JSON Web Token policy
19
JWT with Signing Policy in Datapower
Server Private Key used for Signing
Encryption Algorithms
Additional Claims
Issuer & Expiry
20
JWT with Encryption Policy in Datapower
Encryption Algorithms
Issuer & Expiry
Server Private Key used for Signing
Client Public Certificate used for Encryption
21
JWT Validate Policy in Datapower
22
JWT Validate AAA Policy in Datapower - 1
Select the JWT validation policy
23
JWT Validate AAA Policy in Datapower - 2
24
JWT with Signing Validation Policy in Datapower
Server Certificate used for Sign Validation
Issuer
25
JWT with Encryption Validation Policy in Datapower
Issuer
Server Certificate used for Sign Verification
Client Public Key used for Decryption
26
Testing of the Policy
27
Base64 Encoding of User:Password for Basic HTTP Authentication
dG9ueWY6dG9ueWY=
User present in AAAInfo.xml
tonyf:tonyf
28
First Request sent to Datapower to generate the token after user
authentication
JWT returned in Authorization header
Base64 of Password
(User is in AAA file)
eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJpZGciLCJzdWIiOiJ0b255ZiIsImV4cCI6MTU
4NDg5MzI5OX0.ih6we3urbUDNo6Mkq1UBujUWXYK_ZInaEfH6ht_P3pT0LHjNa
ah6cUWBheWeARJ9ltHYW5HcYh8GzkQA5hL6cl_goXjnNlIWokfJAAYszJVGnmX
MrO0BHIFp2CaDdIFOf24ssdvigY51R9rhBOBTJNcsKlOhlZ_RUcohPCTYtCvFCza
gnMCc0rSTWUspEWtEt6UUzslnbO_dzdfut5NGh9nxYCd6E6CssdEb3sCJMXh38
D4xHEZD5bzA3guEjl9xXYSntF9jdtf4t81HoCWF9hQrESPzmpAWuCh4OpKD_Fqq
LmLbrfppex7fEPpUOja-ss3EdeLjA747MTTELKEwaw
29
JWT Validation in Datapower
Testing of the sample token in jwt.io external website
30
Request sent to Datapower for Validation of the Generated Token
JWT Sent in Authorization Header
31
First Request sent to Datapower to generate encrypted JWT Token
JWT with Encryption returned in Authorization header
Base64 of Password
(User is in AAA file)
eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBMV81IiwiY3R5IjoiSldUIn0.BaoEctr
BCPrwA5eHppZMN8-X0eP2m2KTsTin-SVPEaJko8upuBRBReFyjOJ9vdb-
uLmDdQWzdqEoa-6rV1N-AIbFn-
fubQnmJQAqSWrF9QvaARN1OatJhYOpo_NHBKzUa0VYeJ1IsBBP3wo5r7x2SaYb3kBDYi
RqzUzmVAThmuTcyRoASzmyjXw35IqHxqBMcUWrPALIgCySQdkTASK0iCMAXNdiBwm0j
2b1WlU7_UxjTqaYW85XpK0RY0aQ8IxZKe_0R5qt8kij3ghXVtEOQOxNRVOz4gXYdcTb60
9265tgFEssLc8TIwc70JIu9THLR38hz10CR7XGXVQrfLmZzw.nRAF3ZAHdUqM1Mq3CXx
3yA.1nl86tTcvk8sHWIyXzHhnVLC_4Uj4cUJTQHqun9mx-
rXP1h7v5Q8CkthT8Hly1eVEROtTJ4MnQWjYM8uQsZ6R5PJT4TBIWnh9DXWwWGizqJ9U
n6rK2ynOMzigMVIjpRkAvnfZ42EiOZaKoZ5OlsyHKoFuJqJqydcCDMsvmsK3Rf7T-
cChfSxnmuuBLff5X_3_0nVAAIUIhh2idfScM410JDJIel6ELChBzmpeYxQfRrczlbKk2-
RVS4ubQ8t-
HG8WnF4xadgmGmAssDb4TOdXm4G2l3r91aybhg7OlMeiWpuc2Ygkz0Nx4K6WDMnArQ
GoVQnXqbLtwBX0Xs6cNoAlVUagKTWHaN8Api1AFjN7MfJ-
_4kzgq28jT4upUTg00U9i5hqtf1sfLnI52R2P-v7POY2amNoDmzZYS-
TA0gEelX1ywpFdeErKIMxtIf3sAocekMyblkY0z5l6WXhUFXR_zWfZPjKAvjwloaeCXrsBli9
WmP3onFhtvIacqy0qic50QkLJlEsYQbhqrOchnmFUht4_Gvi74yjD9Ov6YMBZT6Gt0AfHZ
DkcKKdGzznbyD.NK-7Cz2YCIIcStUfc5SpVw
32
References
• Datapower Hello-World: https://developer.ibm.com/datapower/config/
• MQ: https://hub.docker.com/r/ibmcom/mq/
• MQ: https://github.com/ibm-messaging/mq-container
• MQ Admin Tool: https://sourceforge.net/projects/mqadmintool/
• ACE: https://github.com/ot4i/ace-docker
• JWT with X5C: https://github.com/pglezen/dpx5cjwt
• OAuth on DP: https://www.ibm.com/developerworks/websphere/library/techarticles/1208_rasmussen/1208_rasmussen.html
• OAuth on DP Git: https://github.com/pglezen/dp-article-oauth-clients
• SSKEY: http://rcbj.net/blog01/2012/03/17/generating-and-uploading-a-shared-key-symmetric-key-to-datapower-appliances/
• JOSE: https://jose.readthedocs.io/en/latest/
• Base64: https://www.base64encode.org/

More Related Content

What's hot

How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)
Shiu-Fun Poon
 
APIC/DataPower security
APIC/DataPower securityAPIC/DataPower security
APIC/DataPower security
Shiu-Fun Poon
 
DataPower API Gateway Performance Benchmarks
DataPower API Gateway Performance BenchmarksDataPower API Gateway Performance Benchmarks
DataPower API Gateway Performance Benchmarks
IBM DataPower Gateway
 
Datapower Steven Cawn
Datapower Steven CawnDatapower Steven Cawn
Datapower Steven Cawn
Valeri Illescas
 
APIConnect Security Best Practice
APIConnect Security Best PracticeAPIConnect Security Best Practice
APIConnect Security Best Practice
Shiu-Fun Poon
 
OpenID Connect Explained
OpenID Connect ExplainedOpenID Connect Explained
OpenID Connect Explained
Vladimir Dzhuvinov
 
Gateway/APIC security
Gateway/APIC securityGateway/APIC security
Gateway/APIC security
Shiu-Fun Poon
 
How to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credentialHow to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credential
Shiu-Fun Poon
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway
 
API Security : Patterns and Practices
API Security : Patterns and PracticesAPI Security : Patterns and Practices
API Security : Patterns and Practices
Prabath Siriwardena
 
Introduction to OpenID Connect
Introduction to OpenID Connect Introduction to OpenID Connect
Introduction to OpenID Connect
Nat Sakimura
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect
Saran Doraiswamy
 
OAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep DiveOAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep Dive
Nordic APIs
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
Apigee | Google Cloud
 
OAuth
OAuthOAuth
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...
Yuichi Nakamura
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
Knoldus Inc.
 
Keycloak Single Sign-On
Keycloak Single Sign-OnKeycloak Single Sign-On
Keycloak Single Sign-On
Ravi Yasas
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
Dan Brinkmann
 
도메인 주도 설계의 본질
도메인 주도 설계의 본질도메인 주도 설계의 본질
도메인 주도 설계의 본질
Young-Ho Cho
 

What's hot (20)

How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)
 
APIC/DataPower security
APIC/DataPower securityAPIC/DataPower security
APIC/DataPower security
 
DataPower API Gateway Performance Benchmarks
DataPower API Gateway Performance BenchmarksDataPower API Gateway Performance Benchmarks
DataPower API Gateway Performance Benchmarks
 
Datapower Steven Cawn
Datapower Steven CawnDatapower Steven Cawn
Datapower Steven Cawn
 
APIConnect Security Best Practice
APIConnect Security Best PracticeAPIConnect Security Best Practice
APIConnect Security Best Practice
 
OpenID Connect Explained
OpenID Connect ExplainedOpenID Connect Explained
OpenID Connect Explained
 
Gateway/APIC security
Gateway/APIC securityGateway/APIC security
Gateway/APIC security
 
How to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credentialHow to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credential
 
IBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use CasesIBM DataPower Gateway - Common Use Cases
IBM DataPower Gateway - Common Use Cases
 
API Security : Patterns and Practices
API Security : Patterns and PracticesAPI Security : Patterns and Practices
API Security : Patterns and Practices
 
Introduction to OpenID Connect
Introduction to OpenID Connect Introduction to OpenID Connect
Introduction to OpenID Connect
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect
 
OAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep DiveOAuth & OpenID Connect Deep Dive
OAuth & OpenID Connect Deep Dive
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
 
OAuth
OAuthOAuth
OAuth
 
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Keycloak Single Sign-On
Keycloak Single Sign-OnKeycloak Single Sign-On
Keycloak Single Sign-On
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
 
도메인 주도 설계의 본질
도메인 주도 설계의 본질도메인 주도 설계의 본질
도메인 주도 설계의 본질
 

Similar to IBM Datapower Security Scenarios - Using JWT to secure microservices

IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
Chris Bailey
 
Sp 29 two_factor_auth_guide
Sp 29 two_factor_auth_guideSp 29 two_factor_auth_guide
Sp 29 two_factor_auth_guide
Hai Nguyen
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
mfrancis
 
Contract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDContract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiD
CODEiD PHP Community
 
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Evgeniy Kuzmin
 
Netsft2017 day in_life_of_nfv
Netsft2017 day in_life_of_nfvNetsft2017 day in_life_of_nfv
Netsft2017 day in_life_of_nfv
Intel
 
Cloudstack Certification
Cloudstack CertificationCloudstack Certification
Cloudstack Certification
Vskills
 
Analyzing RDP traffc with Bro
Analyzing RDP traffc with BroAnalyzing RDP traffc with Bro
Analyzing RDP traffc with Bro
Josh Liburdi
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and moreWhere should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and more
Bret McGowen - NYC Google Developer Advocate
 
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
Indonesia Network Operators Group
 
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Geert van der Cruijsen
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
InfluxData
 
GCCP Session 3
GCCP Session 3GCCP Session 3
GCCP Session 3
DSCIITPatna
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
itplant
 
Juniper Contrail VNS A BASIC introduction
Juniper Contrail VNSA BASIC introductionJuniper Contrail VNSA BASIC introduction
Juniper Contrail VNS A BASIC introduction
MarketingArrowECS_CZ
 
How to install and use Kubernetes
How to install and use KubernetesHow to install and use Kubernetes
How to install and use Kubernetes
Luke Marsden
 
System installation in CCTV
System installation in CCTVSystem installation in CCTV
System installation in CCTV
hepzijustin
 
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
IBM System Networking
 
How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks
Weaveworks
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 

Similar to IBM Datapower Security Scenarios - Using JWT to secure microservices (20)

IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
 
Sp 29 two_factor_auth_guide
Sp 29 two_factor_auth_guideSp 29 two_factor_auth_guide
Sp 29 two_factor_auth_guide
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
 
Contract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDContract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiD
 
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
Contract testing. Isolated testing of microservices with pact.io - Evgeniy Ku...
 
Netsft2017 day in_life_of_nfv
Netsft2017 day in_life_of_nfvNetsft2017 day in_life_of_nfv
Netsft2017 day in_life_of_nfv
 
Cloudstack Certification
Cloudstack CertificationCloudstack Certification
Cloudstack Certification
 
Analyzing RDP traffc with Bro
Analyzing RDP traffc with BroAnalyzing RDP traffc with Bro
Analyzing RDP traffc with Bro
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and moreWhere should I run my code? Serverless, Containers, Virtual Machines and more
Where should I run my code? Serverless, Containers, Virtual Machines and more
 
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
 
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
Techdays Helsinki - Creating the distributed apps of the future using dapr - ...
 
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Te...
 
GCCP Session 3
GCCP Session 3GCCP Session 3
GCCP Session 3
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
 
Juniper Contrail VNS A BASIC introduction
Juniper Contrail VNSA BASIC introductionJuniper Contrail VNSA BASIC introduction
Juniper Contrail VNS A BASIC introduction
 
How to install and use Kubernetes
How to install and use KubernetesHow to install and use Kubernetes
How to install and use Kubernetes
 
System installation in CCTV
System installation in CCTVSystem installation in CCTV
System installation in CCTV
 
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
IBM Software Defined Networking for Virtual Environments (IBM SDN VE)
 
How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 

Recently uploaded

Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
aisafed42
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 

Recently uploaded (20)

Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 

IBM Datapower Security Scenarios - Using JWT to secure microservices

  • 1. An Architects Hands-on Experience in Securing Microservices with JSON Web Token using IBM Datapower Sandip Gupta Senior Client Architect Cloud & Cognitive BU, IBM India 5th April 2020
  • 2. Laptop Deployment Topology 2 Datapower Container Multiprotocol Gateway Front Side Handler (Client) Policy (Client-to-Server Backend (Server) https://mqserver:8000/crt/test https://mqserver:9090/dp/login Host: mqserver Client Key Client Certificate Server Key Server Certificate Physical Layout of the components used and their interactions https://mqserver:8000/vrf/test Create JWT Token Verify JWT Token SoapUI
  • 4. 4 Topology Setup – Commands used Component Versions Commands – First time Commands - Repeated Operating System Macos Mojave 10.14.5 Add an entry in /etc/hosts <laptop_ip> mqserver #mkdir $HOME/mq #mkdir $HOME/dp IP Address of the laptop #ifconfig | grep inet4 #ping mqserver Laptop’s IP address needs to be used instead of localhost or 127.0.0.1 between DP & MQ containers Docker Community Edition Docker CE 2.1.0.2 Kitematic 0.17.9 #docker ps #docker images # Start Docker Engine Openssl 2.6.5 #mkdir $HOME/mq/certs #cd $HOME/mq/certs #openssl genrsa -out server.key 2048 #openssl req -new -x509 -key server.key -out server.cert –days 365 #openssl genrsa -out client.key 2048 #openssl req -new -x509 -key client.key -out client.cert –days 365 <Server Key> Private key and Public Cert of Datapower Server <Client Key> Private key and Public Cert of MQ Server SOAP UI 5.5.0
  • 5. 5 Topology Setup – Contd… Component Versions Commands – First time Commands - Repeated Datapower Developer Edition 2018.1.10 #docker pull ibmcom/datapower:latest #cd $HOME/dp #git clone https://github.com/ibm- datapower/datapower-tutorials.git #cd $HOME/dp/datapower-tutorials/getting- started # docker run -it -v $PWD/config:/drouter/config -v $PWD/local:/drouter/local -e DATAPOWER_ACCEPT_LICENSE=true -e DATAPOWER_INTERACTIVE=true -p 9090:9090 -p 9022:22 -p 5554:5554 -p 8000-8010:8000-8010 --name idg ibmcom/datapower configure; web-mgmt 0 9090 9090; Exit the container Start IDG container using Kitematic #docker run –it idg #docker ps #docker inspect <dp_container> | grep IPAddress <WebConsole> URL: https://mqserver:9090/dp/login User: admin:admin
  • 8. 8 Crypto in Datapower Two Keys – One named as Client Key & another one as Server Key. Each has their own public certificates. Client Key & Certificate Server Key & Certificate
  • 9. 9 Multi-Protocol Gateway Services in Datapower Created two multi-protocol gateway services rest_mpgw: Multi-protocol gateway service to secure microservice using JWT token with digital signing and/or encryption
  • 12. 12 Front Side Handler in Datapower Acts as a Client to Datapower which is always the server!!
  • 13. 13 JSON Web Token using IBM Datapower
  • 14. 14 JWT Create Policy in Datapower
  • 15. 15 Matching Rules in Datapower
  • 16. 16 Result Rule in Datapower
  • 17. 17 JWT Create AAA Policy in Datapower - 1
  • 18. 18 JWT Create AAA Policy in Datapower - 2 Select JSON Web Token policy
  • 19. 19 JWT with Signing Policy in Datapower Server Private Key used for Signing Encryption Algorithms Additional Claims Issuer & Expiry
  • 20. 20 JWT with Encryption Policy in Datapower Encryption Algorithms Issuer & Expiry Server Private Key used for Signing Client Public Certificate used for Encryption
  • 21. 21 JWT Validate Policy in Datapower
  • 22. 22 JWT Validate AAA Policy in Datapower - 1 Select the JWT validation policy
  • 23. 23 JWT Validate AAA Policy in Datapower - 2
  • 24. 24 JWT with Signing Validation Policy in Datapower Server Certificate used for Sign Validation Issuer
  • 25. 25 JWT with Encryption Validation Policy in Datapower Issuer Server Certificate used for Sign Verification Client Public Key used for Decryption
  • 27. 27 Base64 Encoding of User:Password for Basic HTTP Authentication dG9ueWY6dG9ueWY= User present in AAAInfo.xml tonyf:tonyf
  • 28. 28 First Request sent to Datapower to generate the token after user authentication JWT returned in Authorization header Base64 of Password (User is in AAA file) eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJpZGciLCJzdWIiOiJ0b255ZiIsImV4cCI6MTU 4NDg5MzI5OX0.ih6we3urbUDNo6Mkq1UBujUWXYK_ZInaEfH6ht_P3pT0LHjNa ah6cUWBheWeARJ9ltHYW5HcYh8GzkQA5hL6cl_goXjnNlIWokfJAAYszJVGnmX MrO0BHIFp2CaDdIFOf24ssdvigY51R9rhBOBTJNcsKlOhlZ_RUcohPCTYtCvFCza gnMCc0rSTWUspEWtEt6UUzslnbO_dzdfut5NGh9nxYCd6E6CssdEb3sCJMXh38 D4xHEZD5bzA3guEjl9xXYSntF9jdtf4t81HoCWF9hQrESPzmpAWuCh4OpKD_Fqq LmLbrfppex7fEPpUOja-ss3EdeLjA747MTTELKEwaw
  • 29. 29 JWT Validation in Datapower Testing of the sample token in jwt.io external website
  • 30. 30 Request sent to Datapower for Validation of the Generated Token JWT Sent in Authorization Header
  • 31. 31 First Request sent to Datapower to generate encrypted JWT Token JWT with Encryption returned in Authorization header Base64 of Password (User is in AAA file) eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBMV81IiwiY3R5IjoiSldUIn0.BaoEctr BCPrwA5eHppZMN8-X0eP2m2KTsTin-SVPEaJko8upuBRBReFyjOJ9vdb- uLmDdQWzdqEoa-6rV1N-AIbFn- fubQnmJQAqSWrF9QvaARN1OatJhYOpo_NHBKzUa0VYeJ1IsBBP3wo5r7x2SaYb3kBDYi RqzUzmVAThmuTcyRoASzmyjXw35IqHxqBMcUWrPALIgCySQdkTASK0iCMAXNdiBwm0j 2b1WlU7_UxjTqaYW85XpK0RY0aQ8IxZKe_0R5qt8kij3ghXVtEOQOxNRVOz4gXYdcTb60 9265tgFEssLc8TIwc70JIu9THLR38hz10CR7XGXVQrfLmZzw.nRAF3ZAHdUqM1Mq3CXx 3yA.1nl86tTcvk8sHWIyXzHhnVLC_4Uj4cUJTQHqun9mx- rXP1h7v5Q8CkthT8Hly1eVEROtTJ4MnQWjYM8uQsZ6R5PJT4TBIWnh9DXWwWGizqJ9U n6rK2ynOMzigMVIjpRkAvnfZ42EiOZaKoZ5OlsyHKoFuJqJqydcCDMsvmsK3Rf7T- cChfSxnmuuBLff5X_3_0nVAAIUIhh2idfScM410JDJIel6ELChBzmpeYxQfRrczlbKk2- RVS4ubQ8t- HG8WnF4xadgmGmAssDb4TOdXm4G2l3r91aybhg7OlMeiWpuc2Ygkz0Nx4K6WDMnArQ GoVQnXqbLtwBX0Xs6cNoAlVUagKTWHaN8Api1AFjN7MfJ- _4kzgq28jT4upUTg00U9i5hqtf1sfLnI52R2P-v7POY2amNoDmzZYS- TA0gEelX1ywpFdeErKIMxtIf3sAocekMyblkY0z5l6WXhUFXR_zWfZPjKAvjwloaeCXrsBli9 WmP3onFhtvIacqy0qic50QkLJlEsYQbhqrOchnmFUht4_Gvi74yjD9Ov6YMBZT6Gt0AfHZ DkcKKdGzznbyD.NK-7Cz2YCIIcStUfc5SpVw
  • 32. 32 References • Datapower Hello-World: https://developer.ibm.com/datapower/config/ • MQ: https://hub.docker.com/r/ibmcom/mq/ • MQ: https://github.com/ibm-messaging/mq-container • MQ Admin Tool: https://sourceforge.net/projects/mqadmintool/ • ACE: https://github.com/ot4i/ace-docker • JWT with X5C: https://github.com/pglezen/dpx5cjwt • OAuth on DP: https://www.ibm.com/developerworks/websphere/library/techarticles/1208_rasmussen/1208_rasmussen.html • OAuth on DP Git: https://github.com/pglezen/dp-article-oauth-clients • SSKEY: http://rcbj.net/blog01/2012/03/17/generating-and-uploading-a-shared-key-symmetric-key-to-datapower-appliances/ • JOSE: https://jose.readthedocs.io/en/latest/ • Base64: https://www.base64encode.org/