SlideShare a Scribd company logo
© Hitachi, Ltd. 2020. All rights reserved.
Toward certifying Financial-grade API security profile
with Keycloak
APIdays London 2020
Hitachi, Ltd.
OSS Solution Center
Yoshiyuki Tabata
1© Hitachi, Ltd. 2020. All rights reserved.
About the speaker
• Consultant of API system
• For example, building a high-security banking API system.
• Contributor of 3scale (OSS of API Management)
• Developed functions around security and access control.
• “Edge Limiting”, “RBAC”, “OAuth MTLS”, …
• Contributor of Keycloak (OSS of Identity Management)
• Developed functions required for API use cases based on OAuth/OIDC.
• “Token Revocation”, “Refresh token setting per client”, …
Yoshiyuki Tabata
Software Engineer
OSS Solution Center, Hitachi, Ltd.
GitHub: @y-tabata
© Hitachi, Ltd. 2020. All rights reserved.
Contents
2
1. Introduction: Financial-grade API (FAPI) and Keycloak
2. "Client Policy": how to satisfy FAPI security profile easily
3. Other activities help engineers to build FAPI compliant
system
© Hitachi, Ltd. 2020. All rights reserved.
Contents
3
1. Introduction: Financial-grade API (FAPI) and Keycloak
2. "Client Policy": how to satisfy FAPI security profile easily
3. Other activities help engineers to build FAPI compliant
system
4© Hitachi, Ltd. 2020. All rights reserved.
What is FAPI (Financial-grade API)?
OAuth 2.0
OpenID
Connect
(OIDC)
FAPI
OAuth 2.0 is the de fact standard to secure API.
However, lots are left to implementers,
insecure usage can easily happen.
OIDC standardizes user verification using
ID token.
FAPI standardizes secure usage of OAuth 2.0
and OIDC.
Expected to be used mainly in the financial field.
FAPI is a hardened standard of "OAuth 2.0" and "OpenID Connect (OIDC)".
Formulated by the OpenID Foundation.
5© Hitachi, Ltd. 2020. All rights reserved.
FAPI Milestone
6© Hitachi, Ltd. 2020. All rights reserved.
FAPI: needs and difficulties
However, since authorization server requires various functions/settings, and sometimes
changes of implementation are required, it’s difficult to meet FAPI security profile.
PSD2 (2015/11)
revised Banking Act (2017/6)
OBIE announced its collaboration
with FAPI WG (2017/5)
Japanese Bankers Association
recommended conforming to FAPI (2017/7)
Following this, the movement of open APIs
had become active mainly in EU member states.
The UK came to be recognized as a leader in this field.
FAPI is gaining attention both in Japan and globally.
In response to the above movements.
Each bank was required to make efforts for open APIs.
Japan
UK
Open Banking Standard (2016/2)
7© Hitachi, Ltd. 2020. All rights reserved.
Keycloak
Identity Federation
(OpenID Connect, OAuth 2.0, SAML)
Social Login
(Identity Brokering)
Identity Management
Authentication
LDAP
Active
Directory
RDB
OpenID SAML XML.org
GitHub
Twitter Facebook
What is Keycloak?
OSS for Identity Management, community is led by Red Hat: https://www.keycloak.org
Keycloak provides single sign-on and authentication/authorization based on OAuth 2.0.
8© Hitachi, Ltd. 2020. All rights reserved.
Keycloak acts as OAuth2 authorization server
3. API Request w/ Token
5. Authorized
API Request
1. Authentication
Resource
Server
End User
4. Token Introspection
Keycloak
API systemAuthorization Server
API Gateway
Client
Application
Orthodox API system: Authorization Server + API Gateway + Resource Server
e.g.) OAuth2 Authorization Code Grant
9© Hitachi, Ltd. 2020. All rights reserved.
Our colleague @tnorimat is mainly working.
We'd finished implementing all functions required for FAPI-RW.
• KEYCLOAK-6767 FAPI (Financial API) Security Profile Support
Our activities toward certifying FAPI security profile
JIRA Description PR Opened by
KEYCLOAK-2604 Support PKCE (RFC7636) 3831 tnorimat
KEYCLOAK-5661 Return allowed scopes with access token 4527 tnorimat
KEYCLOAK-5811 Support client_secret_jwt 4835 tnorimat
KEYCLOAK-6700 Support s_hash 5022 tnorimat
KEYCLOAK-6768 Support signed and encrypted ID token 5779 tnorimat
KEYCLOAK-6770 Support signature algorithm ES256 5533 tnorimat
KEYCLOAK-6771 Support holder of key (RFC8705) 5083 tnorimat
10© Hitachi, Ltd. 2020. All rights reserved.
Next assignment: pass all conformance tests for FAPI-RW
We'd finished implementing all functions required for FAPI.
-> However, this is not enough to pass all conformance tests.
To pass these tests, it's necessary to implement fine-grained checks to the authorization
server, i.e. Keycloak.
e.g.)
• Check a client uses request objects at a sufficiently high-security level. (KEYCLOAK-14204)
• Check a client uses suitable response types in OIDC Hybrid Flow. (KEYCLOAK-14205)
There were difficulties:
 Regarding usability
 Settings for clients and realms (i.e. services) will increase too much.
 Regarding implementation
 Implementing check logics to each endpoint will increase conditional branches and
impair readability.
-> We proposed “Client Policy”!
© Hitachi, Ltd. 2020. All rights reserved.
Contents
11
1. Introduction: Financial-grade API (FAPI) and Keycloak
2. "Client Policy": how to satisfy FAPI security profile easily
3. Other activities help engineers to build FAPI compliant
system
12© Hitachi, Ltd. 2020. All rights reserved.
What is Client Policy? – Concept
A framework for applying security
profiles to client applications.
 Executor : “what action”
Execute actions for security
profiles.
 Condition : “which client”
Select client applications based on
conditions.
 Policy :
Manage sets of executors and
conditions.
13© Hitachi, Ltd. 2020. All rights reserved.
What is Client Policy? – Processing Flow
Client Policy Manager monitors requests
from client applications to each endpoint.
 Determine if the client is subject to
client policies.
 Static characteristics
Client application's metadata.
 Dynamic characteristics
Requests to endpoints.
 Execute actions for security profiles.
14© Hitachi, Ltd. 2020. All rights reserved.
What is Client Policy? – How to implement
Design Pattern: Abstract Factory Pattern
All of Executor, Condition, Policy are
implemented as Java interfaces.
 Since client policies can be set separately
from settings for clients and realms, the
settings do not become complicated.
 Since client policies can be implemented
separately from each endpoint
implementation, the readability of the
endpoint implementation is not impaired.
Security profiles other than FAPI, such as
UK Open Banking, can be easily added
without affecting Keycloak original source
code.
15© Hitachi, Ltd. 2020. All rights reserved.
Our colleague @tnorimat is mainly working.
• Due to our contribution FAPI-SIG (Financial-grade API Security: Special Interest Group) was
founded.
• https://github.com/keycloak/kc-sig-fapi
• Main activity is supporting FAPI and its related specifications to Keycloak.
• Communication Channels: Google Group, Zulip, and Web meeting on a regular basis.
• Anyone can join it anytime!
• KEYCLOAK-10331 Pass All Conformance Tests for Certified Financial-grade API (FAPI)
OpenID Providers by OpenID Foundation
• This activity is being accelerated by client policy and FAPI-SIG.
Our activities toward passing conformance tests for FAPI-RW
JIRA Description Progress
KEYCLOAK-10332 Conformance Tests for FAPI R/W OP w/ MTLS 30%
KEYCLOAK-10333 Conformance Tests for FAPI R/W OP w/ Private Key 30%
16© Hitachi, Ltd. 2020. All rights reserved.
Next assignment: considering whole API system
3. API Request w/ Token
5. Authorized
API Request
1. Authentication
Resource
Server
End User
4. Token Introspection
Keycloak
API systemAuthorization Server
MUST
consider
security!
API Gateway
MUST consider
security!
Client
Application
Security of the API system is not ensured only by the authorization server.
© Hitachi, Ltd. 2020. All rights reserved.
Contents
17
1. Introduction: Financial-grade API (FAPI) and Keycloak
2. "Client Policy": how to satisfy FAPI security profile easily
3. Other activities help engineers to build FAPI compliant
system
18© Hitachi, Ltd. 2020. All rights reserved.
Overview: whole API system
3. API Request w/ Token
5. Authorized
API Request
1. Authentication
Resource
Server
End User
4. Token Introspection
Keycloak
API systemAuthorization Server
3scale
API Gateway
Hitachi’s Sample OIDC
Client Application
Client
Application
Implementing functions relating to FAPI to the client application and the API Gateway,
and considering a kind of FAPI sandbox.
19© Hitachi, Ltd. 2020. All rights reserved.
What is 3scale?
OSS for API Management, community is led by Red Hat: https://github.com/3scale
End User
App
Developer
REST API
Server
Legacy
Backend
Applications
(Web, Mobile)
Admin
Admin PortalDev Portal
Container Platform
Authorization
Server
API Gateway
(APIcast)
API Manager
(Porta)
20© Hitachi, Ltd. 2020. All rights reserved.
Our activities for API gateway
Implemented necessary functions for FAPI.
e.g.) OAuth MTLS (RFC8705) PR #1101
3. API Request w/ Token
w/ Client Certificate
5. Authorized
API Request
1. Authentication
Resource
Server
End User
4. Token Introspection
Keycloak
API systemAuthorization Server
3scale
API Gateway
Client
Application
Token includes hash value
of Client Certificate.
Calculate hash value of Client Certificate
and compare it with token's one.
21© Hitachi, Ltd. 2020. All rights reserved.
What is Hitachi’s Sample OIDC Client Application?
A sample client application* created for testing a high-security API system we built.
https://github.com/Hitachi/sample-oidc-client-application
It follows OAuth 2.0 Security Best Practice.
It has following functions, including FAPI-RW requirements:
 Act as a client application of Keycloak
 TLS
 OAuth 2.0 (RFC6749) / OIDC
 Authorization Code Grant
 Scope claim
 Audience claim
 State value
 Nonce value
 Proof Key for Code Exchange by OAuth Public Clients (RFC7636)
 OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens (RFC8705)
 OAuth 2.0 Form Post Response Mode
* This sample source code is just a sample and not intended for applying to the product directly.
22© Hitachi, Ltd. 2020. All rights reserved.
Summary
• Keycloak has already had all functions required for FAPI-RW.
• We are actively moving toward passing all conformance tests for FAPI-RW
with Keycloak.
• We are also considering preparing a FAPI sandbox which is a demo set we
can try FAPI with Keycloak easily.
• Let's join FAPI-SIG!
https://github.com/keycloak/kc-sig-fapi
23© Hitachi, Ltd. 2020. All rights reserved.
Trademarks
• OpenID is a trademark or registered trademark of OpenID Foundation in the United States and other
countries.
• GitHub is a trademark or registered trademark of GitHub, Inc. in the United States and other
countries.
• Twitter is a trademark or registered trademark of Twitter, Inc. in the United States and other countries.
• Facebook is a trademark or registered trademark of Facebook, Inc. in the United States and other
countries.
• Red Hat, and OpenShift are registered trademarks of Red Hat, Inc. in the United States and other
countries.
• Other brand names and product names used in this material are trademarks, registered trademarks,
or trade names of their respective holders.
APIdays London 2020: Toward certifying Financial-grade API security profile with Keycloak
25© Hitachi, Ltd. 2020. All rights reserved.
What is Client Policy? – Architecture
Policy
Condition
Executor
Realm
Client
Keycloak
Attribute
Request
apply
Client Policy
1
0..*
0..*
1
0..*
1
1 0..*
1
0..*
0..*
1
1
0..*
Manager Framework
“Client Policy Basics”
Components
hook & call
 Separate security profile
processing from
Keycloak original source
code and provide "Client
Policy Basics" which is a
framework for
dynamically loading and
unloading.
 Separate the client from
its settings, treat them
as logical components
(Executor), and apply
them to the client
(Condition).

More Related Content

PPTX
Implementing security and availability requirements for banking API system us...
PDF
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
PDF
Implementing security requirements for banking API system using Open Source ...
PDF
Implementing WebAuthn & FAPI supports on Keycloak
PPTX
What API Specifications and Tools Help Engineers to Construct a High-Security...
PDF
Consideration on Holder-of-Key Bound Token < from Financial-grade API (FAPI) ...
PPTX
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
PDF
APIdays Paris 2019 : Financial-grade API (FAPI) Security Profile
Implementing security and availability requirements for banking API system us...
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
Implementing security requirements for banking API system using Open Source ...
Implementing WebAuthn & FAPI supports on Keycloak
What API Specifications and Tools Help Engineers to Construct a High-Security...
Consideration on Holder-of-Key Bound Token < from Financial-grade API (FAPI) ...
Lightweight Zero-trust Network Implementation and Transition with Keycloak an...
APIdays Paris 2019 : Financial-grade API (FAPI) Security Profile

What's hot (20)

PPTX
Overall pictures of Identity provider mix-up attack patterns and trade-offs b...
PDF
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
PDF
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
PDF
Enterprise Single Sign On
PDF
WSO2 API Microgateway for Easier Development and Greater Scalability
PDF
OpenID Foundation RISC WG Update - 2017-10-16
PPTX
OpenID Connect - a simple[sic] single sign-on & identity layer on top of OAut...
PDF
How WSO2 API Manager Supports the Ministry of Hajj and Umrah
PPTX
Criticality of identity
PPTX
MODRNA WG Update - April 2021
PDF
OIDF Workshop at Verizon Media -- 9/30/2019 -- OpenID Connect Federation Update
PDF
WSO2 API Manager 2.0 - Overview
PDF
Open APIs - Risks and Rewards (Øredev 2013)
PDF
Case Study of Financial Web System Development and Operations with Oracle Web...
PPTX
Swagger & OpenAPI Spec #openapi
PDF
Open source iam value, benefits, and risks
PDF
CIS 2015 Easy Federation in Cloud and on Premises - Ian Jaffe
PDF
42Crunch Security Audit for WSO2 API Manager 3.1
PPTX
OpenID Foundation iGov Working Group Update - October 22, 2018
PDF
Strong Customer Authentication - All Your Questions Answered
Overall pictures of Identity provider mix-up attack patterns and trade-offs b...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
Enterprise Single Sign On
WSO2 API Microgateway for Easier Development and Greater Scalability
OpenID Foundation RISC WG Update - 2017-10-16
OpenID Connect - a simple[sic] single sign-on & identity layer on top of OAut...
How WSO2 API Manager Supports the Ministry of Hajj and Umrah
Criticality of identity
MODRNA WG Update - April 2021
OIDF Workshop at Verizon Media -- 9/30/2019 -- OpenID Connect Federation Update
WSO2 API Manager 2.0 - Overview
Open APIs - Risks and Rewards (Øredev 2013)
Case Study of Financial Web System Development and Operations with Oracle Web...
Swagger & OpenAPI Spec #openapi
Open source iam value, benefits, and risks
CIS 2015 Easy Federation in Cloud and on Premises - Ian Jaffe
42Crunch Security Audit for WSO2 API Manager 3.1
OpenID Foundation iGov Working Group Update - October 22, 2018
Strong Customer Authentication - All Your Questions Answered
Ad

Similar to APIdays London 2020: Toward certifying Financial-grade API security profile with Keycloak (20)

PPTX
apidays LIVE LONDON - Toward certifying Financial-grade API profile with Keyc...
PDF
KubeConRecap_nakamura.pdf
PPTX
Hitachi’s Keycloak Journey - Evolution of Business and Community
PPT
Modernizing an Existing SOA-based Architecture with APIs
PDF
APIdays Paris 2019 - What are protected and secured by security requirements ...
PPTX
Webinar: ForgeRock Identity Platform Preview (Dec 2015)
PPTX
Exploring Best Practices for Implementing Authn and Authz in a Cloud-Native E...
PPTX
Webinar: Identity Wars: The Unified Platform Awakens
PDF
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
PPTX
PSD2: Implementing APIs that interoperate with ISO 20022
PDF
APIsecure 2023 - Security Considerations for API Gateway Aggregation, Yoshiyu...
PPTX
Security Considerations for API Gateway Aggregation
PDF
Exploring Best Practice for Implementing Authn and Authz in a Cloud-Native En...
PDF
WSO2 ITALIA SMART TALK #4 - Telefonica Use Case
PPTX
MuleSoft Meetup Charlotte 2019
PDF
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
PDF
Presentation at the 2016 Linux Foundation Collab Summit
PPTX
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
PDF
Case study - Using OSGi within the salesforce.com Data Center Automation Init...
PDF
EduID Mobile App - Use-Cases, Concepts and Implementation
apidays LIVE LONDON - Toward certifying Financial-grade API profile with Keyc...
KubeConRecap_nakamura.pdf
Hitachi’s Keycloak Journey - Evolution of Business and Community
Modernizing an Existing SOA-based Architecture with APIs
APIdays Paris 2019 - What are protected and secured by security requirements ...
Webinar: ForgeRock Identity Platform Preview (Dec 2015)
Exploring Best Practices for Implementing Authn and Authz in a Cloud-Native E...
Webinar: Identity Wars: The Unified Platform Awakens
Oracle API Platform Cloud Service Best Practices & Lessons Learnt
PSD2: Implementing APIs that interoperate with ISO 20022
APIsecure 2023 - Security Considerations for API Gateway Aggregation, Yoshiyu...
Security Considerations for API Gateway Aggregation
Exploring Best Practice for Implementing Authn and Authz in a Cloud-Native En...
WSO2 ITALIA SMART TALK #4 - Telefonica Use Case
MuleSoft Meetup Charlotte 2019
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Presentation at the 2016 Linux Foundation Collab Summit
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
Case study - Using OSGi within the salesforce.com Data Center Automation Init...
EduID Mobile App - Use-Cases, Concepts and Implementation
Ad

More from Hitachi, Ltd. OSS Solution Center. (20)

PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
PDF
API認可を支えるKeycloakの基本と設計の考え方 ~ OAuth/OIDCによるAPI保護のベストプラクティス ~
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
PDF
KubeCon + CloudNativeCon North America セキュリティ周りrecap
PDF
Let’s Join Cloud Native Computing Foundation TAG Security APAC!
PPTX
CloudNativeSecurityCon North America 2024 Overview
PPTX
How Does a Workload Authenticate an API Request?: Implementing Transaction To...
PDF
Authentication and Authorization of The Latest Keycloak
PDF
Guide of authentication and authorization for cloud native applications with ...
PDF
KeycloakのCNCF incubating project入りまでのアップストリーム活動の歩み
PDF
KubeCon NA 2023 Recap: Challenge to Implementing “Scalable” Authorization wit...
PPTX
パスキーでリードする: NGINXとKeycloakによる効率的な認証・認可
PPTX
Keycloakの全体像: 基本概念、ユースケース、そして最新の開発動向
PPTX
Challenge to Implementing "Scalable" Authorization with Keycloak
PPTX
NGINXでの認可について考える
PPTX
KeycloakでFAPIに対応した高セキュリティなAPIを公開する
PDF
IDガバナンス&管理の基礎
PPTX
Keycloakのステップアップ認証について
PPTX
NGINXをBFF (Backend for Frontend)として利用した話
PPTX
Why Assertion-based Access Token is preferred to Handle-based one?
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
API認可を支えるKeycloakの基本と設計の考え方 ~ OAuth/OIDCによるAPI保護のベストプラクティス ~
Mastering Authorization: Integrating Authentication and Authorization Data in...
KubeCon + CloudNativeCon North America セキュリティ周りrecap
Let’s Join Cloud Native Computing Foundation TAG Security APAC!
CloudNativeSecurityCon North America 2024 Overview
How Does a Workload Authenticate an API Request?: Implementing Transaction To...
Authentication and Authorization of The Latest Keycloak
Guide of authentication and authorization for cloud native applications with ...
KeycloakのCNCF incubating project入りまでのアップストリーム活動の歩み
KubeCon NA 2023 Recap: Challenge to Implementing “Scalable” Authorization wit...
パスキーでリードする: NGINXとKeycloakによる効率的な認証・認可
Keycloakの全体像: 基本概念、ユースケース、そして最新の開発動向
Challenge to Implementing "Scalable" Authorization with Keycloak
NGINXでの認可について考える
KeycloakでFAPIに対応した高セキュリティなAPIを公開する
IDガバナンス&管理の基礎
Keycloakのステップアップ認証について
NGINXをBFF (Backend for Frontend)として利用した話
Why Assertion-based Access Token is preferred to Handle-based one?

Recently uploaded (20)

PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mushroom cultivation and it's methods.pdf
PDF
August Patch Tuesday
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
1. Introduction to Computer Programming.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Univ-Connecticut-ChatGPT-Presentaion.pdf
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A comparative study of natural language inference in Swahili using monolingua...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Programs and apps: productivity, graphics, security and other tools
Mushroom cultivation and it's methods.pdf
August Patch Tuesday
cloud_computing_Infrastucture_as_cloud_p
1. Introduction to Computer Programming.pptx
OMC Textile Division Presentation 2021.pptx
A comparative analysis of optical character recognition models for extracting...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
Per capita expenditure prediction using model stacking based on satellite ima...
Getting Started with Data Integration: FME Form 101
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Accuracy of neural networks in brain wave diagnosis of schizophrenia

APIdays London 2020: Toward certifying Financial-grade API security profile with Keycloak

  • 1. © Hitachi, Ltd. 2020. All rights reserved. Toward certifying Financial-grade API security profile with Keycloak APIdays London 2020 Hitachi, Ltd. OSS Solution Center Yoshiyuki Tabata
  • 2. 1© Hitachi, Ltd. 2020. All rights reserved. About the speaker • Consultant of API system • For example, building a high-security banking API system. • Contributor of 3scale (OSS of API Management) • Developed functions around security and access control. • “Edge Limiting”, “RBAC”, “OAuth MTLS”, … • Contributor of Keycloak (OSS of Identity Management) • Developed functions required for API use cases based on OAuth/OIDC. • “Token Revocation”, “Refresh token setting per client”, … Yoshiyuki Tabata Software Engineer OSS Solution Center, Hitachi, Ltd. GitHub: @y-tabata
  • 3. © Hitachi, Ltd. 2020. All rights reserved. Contents 2 1. Introduction: Financial-grade API (FAPI) and Keycloak 2. "Client Policy": how to satisfy FAPI security profile easily 3. Other activities help engineers to build FAPI compliant system
  • 4. © Hitachi, Ltd. 2020. All rights reserved. Contents 3 1. Introduction: Financial-grade API (FAPI) and Keycloak 2. "Client Policy": how to satisfy FAPI security profile easily 3. Other activities help engineers to build FAPI compliant system
  • 5. 4© Hitachi, Ltd. 2020. All rights reserved. What is FAPI (Financial-grade API)? OAuth 2.0 OpenID Connect (OIDC) FAPI OAuth 2.0 is the de fact standard to secure API. However, lots are left to implementers, insecure usage can easily happen. OIDC standardizes user verification using ID token. FAPI standardizes secure usage of OAuth 2.0 and OIDC. Expected to be used mainly in the financial field. FAPI is a hardened standard of "OAuth 2.0" and "OpenID Connect (OIDC)". Formulated by the OpenID Foundation.
  • 6. 5© Hitachi, Ltd. 2020. All rights reserved. FAPI Milestone
  • 7. 6© Hitachi, Ltd. 2020. All rights reserved. FAPI: needs and difficulties However, since authorization server requires various functions/settings, and sometimes changes of implementation are required, it’s difficult to meet FAPI security profile. PSD2 (2015/11) revised Banking Act (2017/6) OBIE announced its collaboration with FAPI WG (2017/5) Japanese Bankers Association recommended conforming to FAPI (2017/7) Following this, the movement of open APIs had become active mainly in EU member states. The UK came to be recognized as a leader in this field. FAPI is gaining attention both in Japan and globally. In response to the above movements. Each bank was required to make efforts for open APIs. Japan UK Open Banking Standard (2016/2)
  • 8. 7© Hitachi, Ltd. 2020. All rights reserved. Keycloak Identity Federation (OpenID Connect, OAuth 2.0, SAML) Social Login (Identity Brokering) Identity Management Authentication LDAP Active Directory RDB OpenID SAML XML.org GitHub Twitter Facebook What is Keycloak? OSS for Identity Management, community is led by Red Hat: https://www.keycloak.org Keycloak provides single sign-on and authentication/authorization based on OAuth 2.0.
  • 9. 8© Hitachi, Ltd. 2020. All rights reserved. Keycloak acts as OAuth2 authorization server 3. API Request w/ Token 5. Authorized API Request 1. Authentication Resource Server End User 4. Token Introspection Keycloak API systemAuthorization Server API Gateway Client Application Orthodox API system: Authorization Server + API Gateway + Resource Server e.g.) OAuth2 Authorization Code Grant
  • 10. 9© Hitachi, Ltd. 2020. All rights reserved. Our colleague @tnorimat is mainly working. We'd finished implementing all functions required for FAPI-RW. • KEYCLOAK-6767 FAPI (Financial API) Security Profile Support Our activities toward certifying FAPI security profile JIRA Description PR Opened by KEYCLOAK-2604 Support PKCE (RFC7636) 3831 tnorimat KEYCLOAK-5661 Return allowed scopes with access token 4527 tnorimat KEYCLOAK-5811 Support client_secret_jwt 4835 tnorimat KEYCLOAK-6700 Support s_hash 5022 tnorimat KEYCLOAK-6768 Support signed and encrypted ID token 5779 tnorimat KEYCLOAK-6770 Support signature algorithm ES256 5533 tnorimat KEYCLOAK-6771 Support holder of key (RFC8705) 5083 tnorimat
  • 11. 10© Hitachi, Ltd. 2020. All rights reserved. Next assignment: pass all conformance tests for FAPI-RW We'd finished implementing all functions required for FAPI. -> However, this is not enough to pass all conformance tests. To pass these tests, it's necessary to implement fine-grained checks to the authorization server, i.e. Keycloak. e.g.) • Check a client uses request objects at a sufficiently high-security level. (KEYCLOAK-14204) • Check a client uses suitable response types in OIDC Hybrid Flow. (KEYCLOAK-14205) There were difficulties:  Regarding usability  Settings for clients and realms (i.e. services) will increase too much.  Regarding implementation  Implementing check logics to each endpoint will increase conditional branches and impair readability. -> We proposed “Client Policy”!
  • 12. © Hitachi, Ltd. 2020. All rights reserved. Contents 11 1. Introduction: Financial-grade API (FAPI) and Keycloak 2. "Client Policy": how to satisfy FAPI security profile easily 3. Other activities help engineers to build FAPI compliant system
  • 13. 12© Hitachi, Ltd. 2020. All rights reserved. What is Client Policy? – Concept A framework for applying security profiles to client applications.  Executor : “what action” Execute actions for security profiles.  Condition : “which client” Select client applications based on conditions.  Policy : Manage sets of executors and conditions.
  • 14. 13© Hitachi, Ltd. 2020. All rights reserved. What is Client Policy? – Processing Flow Client Policy Manager monitors requests from client applications to each endpoint.  Determine if the client is subject to client policies.  Static characteristics Client application's metadata.  Dynamic characteristics Requests to endpoints.  Execute actions for security profiles.
  • 15. 14© Hitachi, Ltd. 2020. All rights reserved. What is Client Policy? – How to implement Design Pattern: Abstract Factory Pattern All of Executor, Condition, Policy are implemented as Java interfaces.  Since client policies can be set separately from settings for clients and realms, the settings do not become complicated.  Since client policies can be implemented separately from each endpoint implementation, the readability of the endpoint implementation is not impaired. Security profiles other than FAPI, such as UK Open Banking, can be easily added without affecting Keycloak original source code.
  • 16. 15© Hitachi, Ltd. 2020. All rights reserved. Our colleague @tnorimat is mainly working. • Due to our contribution FAPI-SIG (Financial-grade API Security: Special Interest Group) was founded. • https://github.com/keycloak/kc-sig-fapi • Main activity is supporting FAPI and its related specifications to Keycloak. • Communication Channels: Google Group, Zulip, and Web meeting on a regular basis. • Anyone can join it anytime! • KEYCLOAK-10331 Pass All Conformance Tests for Certified Financial-grade API (FAPI) OpenID Providers by OpenID Foundation • This activity is being accelerated by client policy and FAPI-SIG. Our activities toward passing conformance tests for FAPI-RW JIRA Description Progress KEYCLOAK-10332 Conformance Tests for FAPI R/W OP w/ MTLS 30% KEYCLOAK-10333 Conformance Tests for FAPI R/W OP w/ Private Key 30%
  • 17. 16© Hitachi, Ltd. 2020. All rights reserved. Next assignment: considering whole API system 3. API Request w/ Token 5. Authorized API Request 1. Authentication Resource Server End User 4. Token Introspection Keycloak API systemAuthorization Server MUST consider security! API Gateway MUST consider security! Client Application Security of the API system is not ensured only by the authorization server.
  • 18. © Hitachi, Ltd. 2020. All rights reserved. Contents 17 1. Introduction: Financial-grade API (FAPI) and Keycloak 2. "Client Policy": how to satisfy FAPI security profile easily 3. Other activities help engineers to build FAPI compliant system
  • 19. 18© Hitachi, Ltd. 2020. All rights reserved. Overview: whole API system 3. API Request w/ Token 5. Authorized API Request 1. Authentication Resource Server End User 4. Token Introspection Keycloak API systemAuthorization Server 3scale API Gateway Hitachi’s Sample OIDC Client Application Client Application Implementing functions relating to FAPI to the client application and the API Gateway, and considering a kind of FAPI sandbox.
  • 20. 19© Hitachi, Ltd. 2020. All rights reserved. What is 3scale? OSS for API Management, community is led by Red Hat: https://github.com/3scale End User App Developer REST API Server Legacy Backend Applications (Web, Mobile) Admin Admin PortalDev Portal Container Platform Authorization Server API Gateway (APIcast) API Manager (Porta)
  • 21. 20© Hitachi, Ltd. 2020. All rights reserved. Our activities for API gateway Implemented necessary functions for FAPI. e.g.) OAuth MTLS (RFC8705) PR #1101 3. API Request w/ Token w/ Client Certificate 5. Authorized API Request 1. Authentication Resource Server End User 4. Token Introspection Keycloak API systemAuthorization Server 3scale API Gateway Client Application Token includes hash value of Client Certificate. Calculate hash value of Client Certificate and compare it with token's one.
  • 22. 21© Hitachi, Ltd. 2020. All rights reserved. What is Hitachi’s Sample OIDC Client Application? A sample client application* created for testing a high-security API system we built. https://github.com/Hitachi/sample-oidc-client-application It follows OAuth 2.0 Security Best Practice. It has following functions, including FAPI-RW requirements:  Act as a client application of Keycloak  TLS  OAuth 2.0 (RFC6749) / OIDC  Authorization Code Grant  Scope claim  Audience claim  State value  Nonce value  Proof Key for Code Exchange by OAuth Public Clients (RFC7636)  OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens (RFC8705)  OAuth 2.0 Form Post Response Mode * This sample source code is just a sample and not intended for applying to the product directly.
  • 23. 22© Hitachi, Ltd. 2020. All rights reserved. Summary • Keycloak has already had all functions required for FAPI-RW. • We are actively moving toward passing all conformance tests for FAPI-RW with Keycloak. • We are also considering preparing a FAPI sandbox which is a demo set we can try FAPI with Keycloak easily. • Let's join FAPI-SIG! https://github.com/keycloak/kc-sig-fapi
  • 24. 23© Hitachi, Ltd. 2020. All rights reserved. Trademarks • OpenID is a trademark or registered trademark of OpenID Foundation in the United States and other countries. • GitHub is a trademark or registered trademark of GitHub, Inc. in the United States and other countries. • Twitter is a trademark or registered trademark of Twitter, Inc. in the United States and other countries. • Facebook is a trademark or registered trademark of Facebook, Inc. in the United States and other countries. • Red Hat, and OpenShift are registered trademarks of Red Hat, Inc. in the United States and other countries. • Other brand names and product names used in this material are trademarks, registered trademarks, or trade names of their respective holders.
  • 26. 25© Hitachi, Ltd. 2020. All rights reserved. What is Client Policy? – Architecture Policy Condition Executor Realm Client Keycloak Attribute Request apply Client Policy 1 0..* 0..* 1 0..* 1 1 0..* 1 0..* 0..* 1 1 0..* Manager Framework “Client Policy Basics” Components hook & call  Separate security profile processing from Keycloak original source code and provide "Client Policy Basics" which is a framework for dynamically loading and unloading.  Separate the client from its settings, treat them as logical components (Executor), and apply them to the client (Condition).