SlideShare a Scribd company logo
Copyright© Nomura Research Institute, Ltd. All rights reserved.
FAPI and beyond
よりよいセキュリティのために
Nat Sakimura, Research Fellow, NRI
Chairman, OpenID Foundation
@_nat_en
🌏 https://nat.sakimura.org/
linkedin.com/in/natsakimura
Copyright© Nomura Research Institute, Ltd. All rights reserved.
JWT
JWS
OAuth PKCE
OpenID Connect
Copyright© Nomura Research Institute, Ltd. All rights reserved.
崎村夏彦(Nat Sakimura)
• 著作:
– OpenID Connect Core 1.0
– JSON Web Token [RFC7519]
– JSON Web Signature [7515]
– OAuth PKCE [RFC7636]
– OAuth JAR [IETF Last Call]
– Etc.
• Editor of:
– ISO/IEC 29184 Guidelines for online notice and consent
– ISO/IEC 29100 AMD: Privacy Framework – Amendment 1
– ISO/IEC 27551 Requirements for attribute based
unlinkable entity authentication
– Etc.
• OpenID Foundation 理事長
• Financial API WG議長
• ISO/IEC JTC 1/SC 27/WG5国
内小委員会主査
• WG5〜OECD/SPDEリエゾン
• 野村総合研究所上席研究員
3
• https://www.sakimura.org
• https://nat.sakimura.org
• @_nat_en (English)
• @_nat (日本語)
• https://www.linkedin.com/
in/natsakimura
• https://ja.wikipedia.org/wi
ki/崎村夏彦
Copyright© Nomura Research Institute, Ltd. All rights reserved.
APIセキュリティ
4
Copyright© Nomura Research Institute, Ltd. All rights reserved.
え、OAuth使えばそれで
問題解決なんじゃ?!
Copyright© Nomura Research Institute, Ltd. All rights reserved.
“部品を正しく組み合わせることが
重要だ。#oauth を使えば良いと言う
だけでは解決策になっていない。”
6
-- Mark O’Neill, Gartner
(SOURCE) Photo taken by Nat Sakimura @APIDays on 13th Dec. 2016
@APIDays Paris 2016
モバイルファーストの時代には,
API保護にOAuth 2.0 を使うのは当然だが、
なぜならば…
Copyright© Nomura Research Institute, Ltd. All rights reserved.
OAuth はフレームワークで、
実際に使う前にプロファイル作成が必要
This framework was designed with the clear expectation that
future work will define prescriptive profiles and extensions
necessary to achieve full web-scale interoperability.
“
Copyright© Nomura Research Institute, Ltd. All rights reserved.
一言でOAuthと言って
も、いったいどの仕様
のどのオプションを
使ったら
Copyright© Nomura Research Institute, Ltd. All rights reserved.
必要な中~高レベルのセキュリティを達成す
ることができるのか?
9
資源の価値
環境制御レベルHigh Low
High
Low
ソーシャル共有
閉域網アプリ
ケーション
金融 API
– Read & Write
e.g.,
Basic choices ok.
Bearer token Not OK
Basic choices
NOT OK
金融 API
– Read only
Copyright© Nomura Research Institute, Ltd. All rights reserved.
それに応えるのが
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Financial-
Grade
Financial-Grade API (FAPI) Security Profile
11
Valueoftheresource
Environment control levelHigh Low
High
Low
Social sharing
Closed circuit
Factory
application
e.g.,
Basic choices ok.
No need to satisfy all the security
requirments by OAuth
© 2017 by Nat Sakimura. CC-BY-SA.
Copyright © 2016 Nat Sakimura. All Rights Reserved.
12
II. What is OpenID Foundation
Working Together
12
OpenID FAPI
(Chair)
(Co-Chair)(Co-Chair)
(UK OBIE Liaison)
Liaison Organizations
TC 68
JTC 1/SC 27/WG 5
Nat Sakimura
Tony NadalinAnoop Saxena
fido 2.0 WG Chair
W3C Web Authn WG
Chair
Copyright© Nomura Research Institute, Ltd. All rights reserved.
金融APIのためのプロファイルを作る上で
は、複数の要因を考慮する必要がある。
13
これらの多くはしばしば無視
され、結果として非常に危な
いOAuth 2.0実装を産ん
でいる。
金融機関向けのプロファイ
ルはこれら全てを解決する
必要がある。
• 1クライアント1サーバの前提
• メッセージ認証(要求・応答)
• 送信者認証
• 受信者認証
• 利用者認証
• メッセージ秘匿性
• トークンフィッシング/リプレイ
Copyright© Nomura Research Institute, Ltd. All rights reserved.
パラフレーズ版 BCM*1 原則
14
4 つのクライテリア
(a) ユニークな送信者識別子 (Source Identifier)
(b)プロトコル + バージョン+ メッセージ 識別子
(c) 全actor/rolesの一覧
(d)メッセージの改善検知
Basin, D., Cremers, C., Meier, S.: Provably Repairing the ISO/IEC 9798
Standard for Entity Authentication. Journal of Computer Security - Security and Trust Principles
archive Volume 21 Issue 6, 817-846 (2013)
*1
Copyright© Nomura Research Institute, Ltd. All rights reserved.
RFC6749 OAuth – code grant protocol メッセージs
• Authorization Request
• Authorization Response
• Token Request
• Token Response
• Assume:
– a network attacker (e.g. Browser malware)
– the crypto & TLS are not broken
– pure RFC6749 – Three parties static OAuth 2.0
15
UA
Client AS
Copyright© Nomura Research Institute, Ltd. All rights reserved.
RFC 6749の対応状況
Message Parameters (a) Unique Source
Identifier
(b) Protocol +
version identifier
(c) Full list of
actor/roles
(d) Message
Authentication
Authorization
Request
response type
client id
redirect uri
scope
state
Authorization
Response
code
state
other extension
parameters
Token Request grant type
code
redirect uri
client
credential/client id
.
Token Response access token
token_type
expires_in
refresh_token
others
16
メッセージ種別毎にパラメー
タの組み合わせは異なるの
で、 (b)= Good!
Legend
Required Parameter
Optional Parameter
Recommended Parameter
でも、喜ぶのはそこまでだ!
Copyright© Nomura Research Institute, Ltd. All rights reserved.
RFC 6749の対応状況
Message Parameters (a) Unique Source
Identifier
(b) Protocol +
version identifier
(c) Full list of
actor/roles
(d) Message
Authentication
Authorization
Request
response type
client id
redirect uri
scope
state
Client ID is not
globally unique.
Tampering possible
OK, but it is not
integrity protected
No. No.
Authorization
Response
code
state
other extension
parameters
No source identifier OK, but it is not
integrity protected
No No
Token Request grant type
code
redirect uri
client
credential/client id
Client ID is not
globally unique.
OK (as long as there
is no OAuth 3.0)
No. OK
Token Response access token
token_type
expires_in
refresh_token
others
No source identifier As above No. OK
17
Copyright© Nomura Research Institute, Ltd. All rights reserved.
RFC6749における、発信者(sender)・受信者(receiver)・
メッセージ(message)認証(authentication)の状況
18
送信者認証 受信者認証 メッセージ認証
認可要求 Indirect None None
認可応答 None None None
トークン要求 Weak Good Good
トークン応答 Good Good Good
Copyright© Nomura Research Institute, Ltd. All rights reserved.
19
泣けてくる
Copyright© Nomura Research Institute, Ltd. All rights reserved.
OAuth 2.0 関連のオプション機能とセキュリティレベル
セキュリ
ティ・レベ
ル
機能セット 適用
JWS Authz Req
w/Hybrid Flow
認可要求の保護
Hybrid Flow*1
(confidential
client)
認可応答の保護
Code Flow
(confidential
client)
+ PKCE + MTLS
code injectionへの対応
長期Bearer Tokenの排除
Code Flow
(confidential
client)
クライアント認証
Implicit Flow クライアント認証無し
Plain OAuth Anonymous
*1) stateインジェクションの回避のために、‘s_hash’ を含む。
認証要求・応答の種類とセキュリティ・レベル トークンの種類とセキュリティ・レベル
セキュリ
ティ・レ
ベル
トークンの種類 適用
記名式トークン
(Sender
Constrained
Token)
発行をうけた者しかトー
クン利用不能
持参人トークン
(Bearer Token)
盗難されたトークンも
利用可能
20
Part 1
Part 2
Copyright© Nomura Research Institute, Ltd. All rights reserved.
強化することは可能
Message Parameters (a) Unique Source
Identifier
(b) Protocol +
version identifier
(c) Full list of
actor/roles
(d) Message
Authentication
Authorization
Request
response type
client id
redirect uri
scope
state
Unique redirect URI
+ Client ID
OK (Unique
Parameter List)
(a) + state as the UA
identifier / TBID as
UA identifier
Request signing by
JAR
Authorization
Response
code
state
other extension
parameters
Unique redirect URI OK (Unique
Parameter List)
(a) + client_id + state
as the UA identifier /
TBID as UA identifier
Response signing by
ID Token + s_hash
Token Request grant type
code
redirect uri
client
credential/client id
Unique redirect URI
+ Client ID
OK (Unique
Parameter List)
(a) + state as the UA
identifier / TBID as
UA identifier
TLS Protected
Token Response access token
token_type
expires_in
refresh_token
others
Unique redirect URI OK (Unique
Parameter List)
(a) + client_id + state
as the UA identifier /
TBID as UA identifier
TLS Protected
21
Copyright© Nomura Research Institute, Ltd. All rights reserved.
FAPI RWセキュリティプロファイルで
は、
送信者・受信者・メッセージ認証を
強化
22
送信者認証 受信者認証 メッセージ認証
認可要求 Request Object Request Object Request object
認可応答 Hybrid Flow Hybrid Flow Hybrid Flow
トークン要求 Good Good Good
トークン応答 Good Good Good
Copyright© Nomura Research Institute, Ltd. All rights reserved.
PKCE [RFC7636]
+
JAR [RFCxxxx]
+
Hybrid Flow [OIDC]
+
Sender Constrained Tokens
(MTLS / Token Binding)
23
FAPI
Security
Profile
=
Copyright© Nomura Research Institute, Ltd. All rights reserved.
PKCE: RFC7636
• 認可リクエスト、認可レスポンス、トークンリク
エストを結びつけるための仕組み。
• 1回限りの鍵を認可リクエスト送信時に生成、そ
のハッシュを認可リクエストにつけて送る。
• 認可サーバは、このハッシュとcodeを結びつけ
ておく。
• トークン要求には、生成した鍵をつけて送ること
により、一連のメッセージフローを紐付けること
ができる。
Copyright© Nomura Research Institute, Ltd. All rights reserved.
JAR (JWS Authorization Request)
• 認可リクエストに署名をつけることによ
り、改ざんを検知。
• 公開鍵署名を使うことによって、証拠性
を向上、否認を難しくしている。
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Hybrid Flow
• 認可応答に署名を掛ける方式
(Detatched Signature)
• IDトークンを認可応答に含めて返す。
– このIDトークンはDetached Signatureであ
り、個人を識別するものではないことに注意
– c_hash
– s_hash
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Access Token from the token endpoint
• SHOULD include at_hash in ID Token.
• ID Token signature SHALL be checked
ここまでやると、極めて強い攻撃者を前提にしても、安全であることの形式証明が
できます。
(参考)Pedram Hosseyni (SEC, University of Stuttgart): ”Formal Security Analysis of
the OpenID Financial-grade API”
https://sec.uni-
stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid
_financial-grade_api
Copyright© Nomura Research Institute, Ltd. All rights reserved.
https://sec.uni-
stuttgart.de/_media/events/osw2019/slides/hosseyni_-
_formal-analysis-fapi.pdf
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Sender Constrained Token
• Bearer Token がだれでも使えるのに対して、
Sender Constrained Tokenは、対応する鍵
を持っていないと使えないタイプのトーク
ン
– MTLS https://datatracker.ietf.org/doc/draft-
ietf-oauth-mtls/
– Token Binding
https://tools.ietf.org/html/draft-ietf-oauth-
token-binding-07
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Formally Verified
Copyright© Nomura Research Institute, Ltd. All rights reserved.
It has been adopted by Open Banking UK
31
Copyright© Nomura Research Institute, Ltd. All rights reserved.
32
(出所)https://twitter.com/IdentityMonk/status/1011960862272294912
Copyright© Nomura Research Institute, Ltd. All rights reserved.
(Source) Chris Mitchel, “Banking is now more open”, Identify 2017
(出所) @UKOpenBanking https://twitter.com/UKOpenBanking/status/1017675263243702272
Copyright© Nomura Research Institute, Ltd. All rights reserved.
https://www.zdnet.com/article/australian-big-four-to-align-
their-data-sharing-ducks-ahead-of-open-banking/
Copyright© Nomura Research Institute, Ltd. All rights reserved.
35
https://www.prnewswire.com/news-releases/financial-data-
exchange-openid-foundation-take-step-towards-global-
standard-for-financial-data-sharing-300818210.html
Copyright© Nomura Research Institute, Ltd. All rights reserved.
そのほかにも
• Berlin Group
• STET
• EBA etc. へアウトリーチ
Copyright© Nomura Research Institute, Ltd. All rights reserved.
37
(source) https://www.zenginkyo.or.jp/fileadmin/res/news/news290713_1.pdf
Copyright© Nomura Research Institute, Ltd. All rights reserved.
• 2つのImplementer’s Draft を策定。(近々Updateの予定)
Valueoftheresource
Environment control levelHigh Low
High
Low
Social sharing
Closed circuit
Factory
application
Financial-grade API
– Read & Write
e.g.,
Basic choices ok.
Financial-grade API
– Read only
Copyright© Nomura Research Institute, Ltd. All rights reserved.
これらはリダイレクト・アプローチを採用
• Part 1: Read Only Security Profile
• Part 2: Read and Write Security Profile
39
Redirect
Approach
Decoupled
Approach
Embedded
Approach
Copyright© Nomura Research Institute, Ltd. All rights reserved.
すべての要件に番号がついたチェックリスト形式なの
で、対応のチェックも簡単。
(source) https://bitbucket.org/openid/fapi/src/master/Financial_API_WD_002.md
Copyright© Nomura Research Institute, Ltd. All rights reserved.
暗号要件も絞り込んであるため、安全
かつ相互運用性高く運用可能
(source)
https://bitbucket.org/openid/f
api/src/master/Financial_API_
WD_002.md
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Decoupled アプローチも検討中
• CIBA (client initiated backchannel authentication) profile.
42
Redirect
Approach
Decoupled
Approach
Embedded
Approach
https://bitbucket.org/openid/fapi/src/master/Financial_API_WD_CIBA.md
Copyright© Nomura Research Institute, Ltd. All rights reserved.
Embedded Approachもあるが…
• 第三者にベアラ・クレデンシャルを渡すのは悪い考え。
• アプリケーション・パスワード(別名:アクセストークン)を手動渡し
する方法が良いか?
43
Redirect
Approach
Decoupled
Approach
Embedded
Approach
Copyright© Nomura Research Institute, Ltd. All rights reserved.
その他にも…
44
• E.g. The
OpenBanking
OpenID
Dynamic Client
Registration
Specification
Copyright© Nomura Research Institute, Ltd. All rights reserved.
• Intent registration endpoint
45
Intent Registration EP
Authorization EP
Token EP
ServerPushing the intent,
e.g., to send $1,000 to
Bob’s account
Intent ID
AuthZ Req w/Intent ID
AuthZ Response
Redirect URI
Client
Copyright© Nomura Research Institute, Ltd. All rights reserved.
これらの実装が正しく仕様を実装しているかはど
うしたらわかるでしょうか?
46
Copyright© Nomura Research Institute, Ltd. All rights reserved.
47
(SOURCE) https://openid.net/2019/02/21/openid-certification-
program-expansion-and-fee-update/
Copyright© Nomura Research Institute, Ltd. All rights reserved.
join us at
https://openid.net/wg/fapi/
Copyright© Nomura Research Institute, Ltd. All rights reserved.
@_nat_en (English)
@_nat (Japanese)
🌏 https://nat.sakimura.org/
https://linkedin.com/in/natsakimura
https://nat.sakimura.org/youtube.php
Subscribe!

More Related Content

PDF
金融 API 時代のセキュリティ: OpenID Financial API (FAPI) WG
PDF
IDガバナンス&管理の基礎
PDF
なぜOpenID Connectが必要となったのか、その歴史的背景
PPTX
NGINXをBFF (Backend for Frontend)として利用した話
PDF
AWSのPCI DSSへの取り組みと 押さえておきたい耳寄り情報
PPTX
KeycloakでAPI認可に入門する
PDF
Fido認証概要説明
PDF
認証の課題とID連携の実装 〜ハンズオン〜
金融 API 時代のセキュリティ: OpenID Financial API (FAPI) WG
IDガバナンス&管理の基礎
なぜOpenID Connectが必要となったのか、その歴史的背景
NGINXをBFF (Backend for Frontend)として利用した話
AWSのPCI DSSへの取り組みと 押さえておきたい耳寄り情報
KeycloakでAPI認可に入門する
Fido認証概要説明
認証の課題とID連携の実装 〜ハンズオン〜

What's hot (20)

PDF
SSIとDIDで何を解決したいのか?(β版)
PPTX
Keycloakのステップアップ認証について
PPTX
Keycloak入門
PDF
Keycloak拡張入門
PPTX
KeycloakでFAPIに対応した高セキュリティなAPIを公開する
PDF
PDSを実現するにあたっての技術動向の紹介 (OAuth, OpenID Connect, UMAなど)
PDF
KeycloakのDevice Flow、CIBAについて
PPTX
20220409 AWS BLEA 開発にあたって検討したこと
PDF
OAuth / OpenID Connectを中心とするAPIセキュリティについて #yuzawaws
PDF
Kongの概要と導入事例
PDF
シングルサインオンの歴史とSAMLへの道のり
PDF
FIDO認証によるパスワードレスログイン実装入門
PDF
Modern Authentication -- FIDO2 Web Authentication (WebAuthn) を学ぶ --
PDF
知っているようで知らないPAMのお話
PPTX
Hybrid Azure AD Join 動作の仕組みを徹底解説
PDF
20200219 AWS Black Belt Online Seminar オンプレミスとAWS間の冗長化接続
PDF
OpenID Connect 入門 〜コンシューマーにおけるID連携のトレンド〜
PDF
IETF111 RATS: Remote Attestation ProcedureS 報告
PPTX
ウェブセキュリティのありがちな誤解を解説する
SSIとDIDで何を解決したいのか?(β版)
Keycloakのステップアップ認証について
Keycloak入門
Keycloak拡張入門
KeycloakでFAPIに対応した高セキュリティなAPIを公開する
PDSを実現するにあたっての技術動向の紹介 (OAuth, OpenID Connect, UMAなど)
KeycloakのDevice Flow、CIBAについて
20220409 AWS BLEA 開発にあたって検討したこと
OAuth / OpenID Connectを中心とするAPIセキュリティについて #yuzawaws
Kongの概要と導入事例
シングルサインオンの歴史とSAMLへの道のり
FIDO認証によるパスワードレスログイン実装入門
Modern Authentication -- FIDO2 Web Authentication (WebAuthn) を学ぶ --
知っているようで知らないPAMのお話
Hybrid Azure AD Join 動作の仕組みを徹底解説
20200219 AWS Black Belt Online Seminar オンプレミスとAWS間の冗長化接続
OpenID Connect 入門 〜コンシューマーにおけるID連携のトレンド〜
IETF111 RATS: Remote Attestation ProcedureS 報告
ウェブセキュリティのありがちな誤解を解説する
Ad

Similar to FAPI and beyond - よりよいセキュリティのために (20)

PDF
FAPI and Beyond: From an specification author's point of view #fapisum - Japa...
PDF
FAPI Security について聞いてきた話(2017/08/18 社内勉強会)
PDF
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
PDF
Authentication and Authorization of The Latest Keycloak
PDF
Mobage Connect と Identity 関連技術への取り組み - OpenID Summit Tokyo 2015
PDF
API認可を支えるKeycloakの基本と設計の考え方 ~ OAuth/OIDCによるAPI保護のベストプラクティス ~
PDF
Authlete: セキュアな金融 API 基盤の実現と Google Cloud の活用 #gc_inside
PDF
「金融API向けOAuth」にみるOAuthプロファイリングの実際 #secjaws #finsecjaws01 #oauth #oidc #api
PDF
OpenID Connect入門
PDF
OAuthのHolder of Key Token
PDF
OAuth Security Workshop 2017 #osw17
PDF
OAuth 2.0のResource Serverの作り方
PDF
Ietf95 http2
PDF
OCHaCafe #4 Hyperledger Fabric アプリケーション設計入門ガイドでしゃべった内容+おまけ資料
PDF
OCHaCafe#5 - 避けては通れない!認証・認可
PDF
Keycloakの最近のトピック
PDF
Iddance2 fido
PDF
IETF96 Update oauth tokbind
PDF
OAuth / OpenID Connect (OIDC) の最新動向と Authlete のソリューション
PDF
IETF90 Web関連WG報告 #isocjp
FAPI and Beyond: From an specification author's point of view #fapisum - Japa...
FAPI Security について聞いてきた話(2017/08/18 社内勉強会)
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
Authentication and Authorization of The Latest Keycloak
Mobage Connect と Identity 関連技術への取り組み - OpenID Summit Tokyo 2015
API認可を支えるKeycloakの基本と設計の考え方 ~ OAuth/OIDCによるAPI保護のベストプラクティス ~
Authlete: セキュアな金融 API 基盤の実現と Google Cloud の活用 #gc_inside
「金融API向けOAuth」にみるOAuthプロファイリングの実際 #secjaws #finsecjaws01 #oauth #oidc #api
OpenID Connect入門
OAuthのHolder of Key Token
OAuth Security Workshop 2017 #osw17
OAuth 2.0のResource Serverの作り方
Ietf95 http2
OCHaCafe #4 Hyperledger Fabric アプリケーション設計入門ガイドでしゃべった内容+おまけ資料
OCHaCafe#5 - 避けては通れない!認証・認可
Keycloakの最近のトピック
Iddance2 fido
IETF96 Update oauth tokbind
OAuth / OpenID Connect (OIDC) の最新動向と Authlete のソリューション
IETF90 Web関連WG報告 #isocjp
Ad

More from Nat Sakimura (20)

PDF
OpenID in the Digital ID Landscape: A Perspective From the Past to the Future
PDF
170724 JP/UK Open Banking Summit English Translation
PDF
Introduction to 
the FAPI Read & Write OAuth Profile - Jan 2018 Updates
PPTX
Introduction to the FAPI Read & Write OAuth Profile
PPTX
ブロックチェーン〜信頼の源泉の民主化のもたらす変革
PPTX
Future Proofing the OAuth 2.0 Authorization Code Grant Protocol by the applic...
PDF
OpenID Foundation FAPI WG: June 2017 Update
PDF
API Days 2016 Day 1: OpenID Financial API WG
PPTX
Financial Grade OAuth & OpenID Connect
PPTX
OpenID Foundation Foundation Financial API (FAPI) WG
PPTX
OpenID Foundation Foundation Financial API (FAPI) WG
PPTX
車輪は丸くなったか?~デジタル・アイデンティティの標準化動向とそのゴール
PDF
OAuth SPOP @ IETF 91
PPTX
Oidc how it solves your problems
PPTX
Transient client secret extension
PDF
Introduction to OpenID Connect
PPTX
Nc 30 sakimura-distribution_0604
PPTX
Smartphone Native Application OP
PPTX
Open idとcyber空間
PDF
サイバー空間上の信頼フレームワークとパーソナルデータ経済
OpenID in the Digital ID Landscape: A Perspective From the Past to the Future
170724 JP/UK Open Banking Summit English Translation
Introduction to 
the FAPI Read & Write OAuth Profile - Jan 2018 Updates
Introduction to the FAPI Read & Write OAuth Profile
ブロックチェーン〜信頼の源泉の民主化のもたらす変革
Future Proofing the OAuth 2.0 Authorization Code Grant Protocol by the applic...
OpenID Foundation FAPI WG: June 2017 Update
API Days 2016 Day 1: OpenID Financial API WG
Financial Grade OAuth & OpenID Connect
OpenID Foundation Foundation Financial API (FAPI) WG
OpenID Foundation Foundation Financial API (FAPI) WG
車輪は丸くなったか?~デジタル・アイデンティティの標準化動向とそのゴール
OAuth SPOP @ IETF 91
Oidc how it solves your problems
Transient client secret extension
Introduction to OpenID Connect
Nc 30 sakimura-distribution_0604
Smartphone Native Application OP
Open idとcyber空間
サイバー空間上の信頼フレームワークとパーソナルデータ経済

FAPI and beyond - よりよいセキュリティのために

  • 1. Copyright© Nomura Research Institute, Ltd. All rights reserved. FAPI and beyond よりよいセキュリティのために Nat Sakimura, Research Fellow, NRI Chairman, OpenID Foundation @_nat_en 🌏 https://nat.sakimura.org/ linkedin.com/in/natsakimura
  • 2. Copyright© Nomura Research Institute, Ltd. All rights reserved. JWT JWS OAuth PKCE OpenID Connect
  • 3. Copyright© Nomura Research Institute, Ltd. All rights reserved. 崎村夏彦(Nat Sakimura) • 著作: – OpenID Connect Core 1.0 – JSON Web Token [RFC7519] – JSON Web Signature [7515] – OAuth PKCE [RFC7636] – OAuth JAR [IETF Last Call] – Etc. • Editor of: – ISO/IEC 29184 Guidelines for online notice and consent – ISO/IEC 29100 AMD: Privacy Framework – Amendment 1 – ISO/IEC 27551 Requirements for attribute based unlinkable entity authentication – Etc. • OpenID Foundation 理事長 • Financial API WG議長 • ISO/IEC JTC 1/SC 27/WG5国 内小委員会主査 • WG5〜OECD/SPDEリエゾン • 野村総合研究所上席研究員 3 • https://www.sakimura.org • https://nat.sakimura.org • @_nat_en (English) • @_nat (日本語) • https://www.linkedin.com/ in/natsakimura • https://ja.wikipedia.org/wi ki/崎村夏彦
  • 4. Copyright© Nomura Research Institute, Ltd. All rights reserved. APIセキュリティ 4
  • 5. Copyright© Nomura Research Institute, Ltd. All rights reserved. え、OAuth使えばそれで 問題解決なんじゃ?!
  • 6. Copyright© Nomura Research Institute, Ltd. All rights reserved. “部品を正しく組み合わせることが 重要だ。#oauth を使えば良いと言う だけでは解決策になっていない。” 6 -- Mark O’Neill, Gartner (SOURCE) Photo taken by Nat Sakimura @APIDays on 13th Dec. 2016 @APIDays Paris 2016 モバイルファーストの時代には, API保護にOAuth 2.0 を使うのは当然だが、 なぜならば…
  • 7. Copyright© Nomura Research Institute, Ltd. All rights reserved. OAuth はフレームワークで、 実際に使う前にプロファイル作成が必要 This framework was designed with the clear expectation that future work will define prescriptive profiles and extensions necessary to achieve full web-scale interoperability. “
  • 8. Copyright© Nomura Research Institute, Ltd. All rights reserved. 一言でOAuthと言って も、いったいどの仕様 のどのオプションを 使ったら
  • 9. Copyright© Nomura Research Institute, Ltd. All rights reserved. 必要な中~高レベルのセキュリティを達成す ることができるのか? 9 資源の価値 環境制御レベルHigh Low High Low ソーシャル共有 閉域網アプリ ケーション 金融 API – Read & Write e.g., Basic choices ok. Bearer token Not OK Basic choices NOT OK 金融 API – Read only
  • 10. Copyright© Nomura Research Institute, Ltd. All rights reserved. それに応えるのが
  • 11. Copyright© Nomura Research Institute, Ltd. All rights reserved. Financial- Grade Financial-Grade API (FAPI) Security Profile 11 Valueoftheresource Environment control levelHigh Low High Low Social sharing Closed circuit Factory application e.g., Basic choices ok. No need to satisfy all the security requirments by OAuth
  • 12. © 2017 by Nat Sakimura. CC-BY-SA. Copyright © 2016 Nat Sakimura. All Rights Reserved. 12 II. What is OpenID Foundation Working Together 12 OpenID FAPI (Chair) (Co-Chair)(Co-Chair) (UK OBIE Liaison) Liaison Organizations TC 68 JTC 1/SC 27/WG 5 Nat Sakimura Tony NadalinAnoop Saxena fido 2.0 WG Chair W3C Web Authn WG Chair
  • 13. Copyright© Nomura Research Institute, Ltd. All rights reserved. 金融APIのためのプロファイルを作る上で は、複数の要因を考慮する必要がある。 13 これらの多くはしばしば無視 され、結果として非常に危な いOAuth 2.0実装を産ん でいる。 金融機関向けのプロファイ ルはこれら全てを解決する 必要がある。 • 1クライアント1サーバの前提 • メッセージ認証(要求・応答) • 送信者認証 • 受信者認証 • 利用者認証 • メッセージ秘匿性 • トークンフィッシング/リプレイ
  • 14. Copyright© Nomura Research Institute, Ltd. All rights reserved. パラフレーズ版 BCM*1 原則 14 4 つのクライテリア (a) ユニークな送信者識別子 (Source Identifier) (b)プロトコル + バージョン+ メッセージ 識別子 (c) 全actor/rolesの一覧 (d)メッセージの改善検知 Basin, D., Cremers, C., Meier, S.: Provably Repairing the ISO/IEC 9798 Standard for Entity Authentication. Journal of Computer Security - Security and Trust Principles archive Volume 21 Issue 6, 817-846 (2013) *1
  • 15. Copyright© Nomura Research Institute, Ltd. All rights reserved. RFC6749 OAuth – code grant protocol メッセージs • Authorization Request • Authorization Response • Token Request • Token Response • Assume: – a network attacker (e.g. Browser malware) – the crypto & TLS are not broken – pure RFC6749 – Three parties static OAuth 2.0 15 UA Client AS
  • 16. Copyright© Nomura Research Institute, Ltd. All rights reserved. RFC 6749の対応状況 Message Parameters (a) Unique Source Identifier (b) Protocol + version identifier (c) Full list of actor/roles (d) Message Authentication Authorization Request response type client id redirect uri scope state Authorization Response code state other extension parameters Token Request grant type code redirect uri client credential/client id . Token Response access token token_type expires_in refresh_token others 16 メッセージ種別毎にパラメー タの組み合わせは異なるの で、 (b)= Good! Legend Required Parameter Optional Parameter Recommended Parameter でも、喜ぶのはそこまでだ!
  • 17. Copyright© Nomura Research Institute, Ltd. All rights reserved. RFC 6749の対応状況 Message Parameters (a) Unique Source Identifier (b) Protocol + version identifier (c) Full list of actor/roles (d) Message Authentication Authorization Request response type client id redirect uri scope state Client ID is not globally unique. Tampering possible OK, but it is not integrity protected No. No. Authorization Response code state other extension parameters No source identifier OK, but it is not integrity protected No No Token Request grant type code redirect uri client credential/client id Client ID is not globally unique. OK (as long as there is no OAuth 3.0) No. OK Token Response access token token_type expires_in refresh_token others No source identifier As above No. OK 17
  • 18. Copyright© Nomura Research Institute, Ltd. All rights reserved. RFC6749における、発信者(sender)・受信者(receiver)・ メッセージ(message)認証(authentication)の状況 18 送信者認証 受信者認証 メッセージ認証 認可要求 Indirect None None 認可応答 None None None トークン要求 Weak Good Good トークン応答 Good Good Good
  • 19. Copyright© Nomura Research Institute, Ltd. All rights reserved. 19 泣けてくる
  • 20. Copyright© Nomura Research Institute, Ltd. All rights reserved. OAuth 2.0 関連のオプション機能とセキュリティレベル セキュリ ティ・レベ ル 機能セット 適用 JWS Authz Req w/Hybrid Flow 認可要求の保護 Hybrid Flow*1 (confidential client) 認可応答の保護 Code Flow (confidential client) + PKCE + MTLS code injectionへの対応 長期Bearer Tokenの排除 Code Flow (confidential client) クライアント認証 Implicit Flow クライアント認証無し Plain OAuth Anonymous *1) stateインジェクションの回避のために、‘s_hash’ を含む。 認証要求・応答の種類とセキュリティ・レベル トークンの種類とセキュリティ・レベル セキュリ ティ・レ ベル トークンの種類 適用 記名式トークン (Sender Constrained Token) 発行をうけた者しかトー クン利用不能 持参人トークン (Bearer Token) 盗難されたトークンも 利用可能 20 Part 1 Part 2
  • 21. Copyright© Nomura Research Institute, Ltd. All rights reserved. 強化することは可能 Message Parameters (a) Unique Source Identifier (b) Protocol + version identifier (c) Full list of actor/roles (d) Message Authentication Authorization Request response type client id redirect uri scope state Unique redirect URI + Client ID OK (Unique Parameter List) (a) + state as the UA identifier / TBID as UA identifier Request signing by JAR Authorization Response code state other extension parameters Unique redirect URI OK (Unique Parameter List) (a) + client_id + state as the UA identifier / TBID as UA identifier Response signing by ID Token + s_hash Token Request grant type code redirect uri client credential/client id Unique redirect URI + Client ID OK (Unique Parameter List) (a) + state as the UA identifier / TBID as UA identifier TLS Protected Token Response access token token_type expires_in refresh_token others Unique redirect URI OK (Unique Parameter List) (a) + client_id + state as the UA identifier / TBID as UA identifier TLS Protected 21
  • 22. Copyright© Nomura Research Institute, Ltd. All rights reserved. FAPI RWセキュリティプロファイルで は、 送信者・受信者・メッセージ認証を 強化 22 送信者認証 受信者認証 メッセージ認証 認可要求 Request Object Request Object Request object 認可応答 Hybrid Flow Hybrid Flow Hybrid Flow トークン要求 Good Good Good トークン応答 Good Good Good
  • 23. Copyright© Nomura Research Institute, Ltd. All rights reserved. PKCE [RFC7636] + JAR [RFCxxxx] + Hybrid Flow [OIDC] + Sender Constrained Tokens (MTLS / Token Binding) 23 FAPI Security Profile =
  • 24. Copyright© Nomura Research Institute, Ltd. All rights reserved. PKCE: RFC7636 • 認可リクエスト、認可レスポンス、トークンリク エストを結びつけるための仕組み。 • 1回限りの鍵を認可リクエスト送信時に生成、そ のハッシュを認可リクエストにつけて送る。 • 認可サーバは、このハッシュとcodeを結びつけ ておく。 • トークン要求には、生成した鍵をつけて送ること により、一連のメッセージフローを紐付けること ができる。
  • 25. Copyright© Nomura Research Institute, Ltd. All rights reserved. JAR (JWS Authorization Request) • 認可リクエストに署名をつけることによ り、改ざんを検知。 • 公開鍵署名を使うことによって、証拠性 を向上、否認を難しくしている。
  • 26. Copyright© Nomura Research Institute, Ltd. All rights reserved. Hybrid Flow • 認可応答に署名を掛ける方式 (Detatched Signature) • IDトークンを認可応答に含めて返す。 – このIDトークンはDetached Signatureであ り、個人を識別するものではないことに注意 – c_hash – s_hash
  • 27. Copyright© Nomura Research Institute, Ltd. All rights reserved. Access Token from the token endpoint • SHOULD include at_hash in ID Token. • ID Token signature SHALL be checked ここまでやると、極めて強い攻撃者を前提にしても、安全であることの形式証明が できます。 (参考)Pedram Hosseyni (SEC, University of Stuttgart): ”Formal Security Analysis of the OpenID Financial-grade API” https://sec.uni- stuttgart.de/events/osw2019/agenda#talkformal_security_analysis_of_the_openid _financial-grade_api
  • 28. Copyright© Nomura Research Institute, Ltd. All rights reserved. https://sec.uni- stuttgart.de/_media/events/osw2019/slides/hosseyni_- _formal-analysis-fapi.pdf
  • 29. Copyright© Nomura Research Institute, Ltd. All rights reserved. Sender Constrained Token • Bearer Token がだれでも使えるのに対して、 Sender Constrained Tokenは、対応する鍵 を持っていないと使えないタイプのトーク ン – MTLS https://datatracker.ietf.org/doc/draft- ietf-oauth-mtls/ – Token Binding https://tools.ietf.org/html/draft-ietf-oauth- token-binding-07
  • 30. Copyright© Nomura Research Institute, Ltd. All rights reserved. Formally Verified
  • 31. Copyright© Nomura Research Institute, Ltd. All rights reserved. It has been adopted by Open Banking UK 31
  • 32. Copyright© Nomura Research Institute, Ltd. All rights reserved. 32 (出所)https://twitter.com/IdentityMonk/status/1011960862272294912
  • 33. Copyright© Nomura Research Institute, Ltd. All rights reserved. (Source) Chris Mitchel, “Banking is now more open”, Identify 2017 (出所) @UKOpenBanking https://twitter.com/UKOpenBanking/status/1017675263243702272
  • 34. Copyright© Nomura Research Institute, Ltd. All rights reserved. https://www.zdnet.com/article/australian-big-four-to-align- their-data-sharing-ducks-ahead-of-open-banking/
  • 35. Copyright© Nomura Research Institute, Ltd. All rights reserved. 35 https://www.prnewswire.com/news-releases/financial-data- exchange-openid-foundation-take-step-towards-global- standard-for-financial-data-sharing-300818210.html
  • 36. Copyright© Nomura Research Institute, Ltd. All rights reserved. そのほかにも • Berlin Group • STET • EBA etc. へアウトリーチ
  • 37. Copyright© Nomura Research Institute, Ltd. All rights reserved. 37 (source) https://www.zenginkyo.or.jp/fileadmin/res/news/news290713_1.pdf
  • 38. Copyright© Nomura Research Institute, Ltd. All rights reserved. • 2つのImplementer’s Draft を策定。(近々Updateの予定) Valueoftheresource Environment control levelHigh Low High Low Social sharing Closed circuit Factory application Financial-grade API – Read & Write e.g., Basic choices ok. Financial-grade API – Read only
  • 39. Copyright© Nomura Research Institute, Ltd. All rights reserved. これらはリダイレクト・アプローチを採用 • Part 1: Read Only Security Profile • Part 2: Read and Write Security Profile 39 Redirect Approach Decoupled Approach Embedded Approach
  • 40. Copyright© Nomura Research Institute, Ltd. All rights reserved. すべての要件に番号がついたチェックリスト形式なの で、対応のチェックも簡単。 (source) https://bitbucket.org/openid/fapi/src/master/Financial_API_WD_002.md
  • 41. Copyright© Nomura Research Institute, Ltd. All rights reserved. 暗号要件も絞り込んであるため、安全 かつ相互運用性高く運用可能 (source) https://bitbucket.org/openid/f api/src/master/Financial_API_ WD_002.md
  • 42. Copyright© Nomura Research Institute, Ltd. All rights reserved. Decoupled アプローチも検討中 • CIBA (client initiated backchannel authentication) profile. 42 Redirect Approach Decoupled Approach Embedded Approach https://bitbucket.org/openid/fapi/src/master/Financial_API_WD_CIBA.md
  • 43. Copyright© Nomura Research Institute, Ltd. All rights reserved. Embedded Approachもあるが… • 第三者にベアラ・クレデンシャルを渡すのは悪い考え。 • アプリケーション・パスワード(別名:アクセストークン)を手動渡し する方法が良いか? 43 Redirect Approach Decoupled Approach Embedded Approach
  • 44. Copyright© Nomura Research Institute, Ltd. All rights reserved. その他にも… 44 • E.g. The OpenBanking OpenID Dynamic Client Registration Specification
  • 45. Copyright© Nomura Research Institute, Ltd. All rights reserved. • Intent registration endpoint 45 Intent Registration EP Authorization EP Token EP ServerPushing the intent, e.g., to send $1,000 to Bob’s account Intent ID AuthZ Req w/Intent ID AuthZ Response Redirect URI Client
  • 46. Copyright© Nomura Research Institute, Ltd. All rights reserved. これらの実装が正しく仕様を実装しているかはど うしたらわかるでしょうか? 46
  • 47. Copyright© Nomura Research Institute, Ltd. All rights reserved. 47 (SOURCE) https://openid.net/2019/02/21/openid-certification- program-expansion-and-fee-update/
  • 48. Copyright© Nomura Research Institute, Ltd. All rights reserved. join us at https://openid.net/wg/fapi/
  • 49. Copyright© Nomura Research Institute, Ltd. All rights reserved. @_nat_en (English) @_nat (Japanese) 🌏 https://nat.sakimura.org/ https://linkedin.com/in/natsakimura https://nat.sakimura.org/youtube.php Subscribe!

Editor's Notes

  • #2: Nat Sakimura Research Fellow  Nomura Research Institute, Ltd. In the mobile-first world that we live, OAuth 2.0 as in RFC6749 and RFC6750 is the de-facto method for protecting your APIs. It is very simple to use while it is a vast improvement compared to API Key or shared password approach as far as security properties are concerned. However, it has given up some security properties as well. This session explains where the weakness of the basic OAuth exists by considering the source, destination, and message authentication as well as considering the recommendation based on the formal security analysis of ISO/IEC 9798 Standard for Entity Authentication by Basin, Cremers, and Meler. Then, explains how it can be solved using JWT Authorization Request and Sender Constrained Tokens based on the Financial API Security profile developed by OpenID Foundation’s FAPI WG and deployed in UK banks and other financial institutions elsewhere in the world. Such profile should be very useful not only for financial transactions but for other higher risk APIs.
  • #4: Hi, I am Nat Sakimura. It is an honor to be able to present in front of the distinguished audience, and I am very thankful to the APIDays committee for letting it happen. I am a Research Fellow at Nomura Research Institute, Chairman of the Board of the OpenID Foundation, and Chair of the Financial API WG among other things. If you are in API security field, you probably heard about me because I am an author of OpenID Connect, JSON Web Token, JSON Web Signature, OAuth PKCE, etc. OK. Now, here is the first Proposition to be discussed today:
  • #7: The answer is of course “NO”. Like Mark O’Neill of Gartner spoke yesterday, Building blocks needs to be combined correctly. Just saying #oauth does not do the job.
  • #14: And, to create such profile for Financial APIs, there are multiple factors that you actually have to take care of, many of which are often ignored and results in awfully insecure OAuth 2.0 implementations.