id連携入門 (実習編) - security camp 2016

73
ID - - Nov Matake

Upload: nov-matake

Post on 24-Jan-2017

696 views

Category:

Art & Photos


0 download

TRANSCRIPT

Page 1: ID連携入門 (実習編) - Security Camp 2016

ID - -

Nov Matake

Page 2: ID連携入門 (実習編) - Security Camp 2016

http://bit.ly/sec2016nov

Page 3: ID連携入門 (実習編) - Security Camp 2016

Definition of “Federation” in NIST SP 800-63-3

“A process that allows for the conveyance of identity and authentication information across

a set of networked systems.”

https://pages.nist.gov/800-63-3/

Page 4: ID連携入門 (実習編) - Security Camp 2016

Definition of “Federation” in NIST SP 800-63-3

“ Identity ”

https://openid-foundation-japan.github.io/800-63-3/index.ja.html

Page 5: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Assertion

Authentication Event

Issue an Assertion

Request Attributes

Attributes Welcome, Nov!

Verify the Assertion

Page 6: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Assertion

Authentication Event

Issue an Artifact

Send the Artifact

Request Attributes

Attributes Welcome, Nov!

Assertion

Page 7: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Assertion

Authentication Event

Issue an Assertion w/ Attributes

Verify the Assertion

Welcome, Nov!

Page 8: ID連携入門 (実習編) - Security Camp 2016

SAML (Security Assertion Markup Language)

OpenID Connect

Page 9: ID連携入門 (実習編) - Security Camp 2016

OpenID Connect~ OAuth 2.0 + Identity Layer ~

Page 10: ID連携入門 (実習編) - Security Camp 2016
Page 11: ID連携入門 (実習編) - Security Camp 2016

OAuth !!

Twitter API, Facebook API, GitHub API etc.

Page 12: ID連携入門 (実習編) - Security Camp 2016

https://developers.google.com/oauthplayground/

https://developers.facebook.com/tools/explorer

Page 13: ID連携入門 (実習編) - Security Camp 2016

OAuth Server Resource Owner

OAuth Client Resource Owner

Page 14: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token

Page 15: ID連携入門 (実習編) - Security Camp 2016

https://sec-camp-idp.herokuapp.com

Page 16: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token

Page 17: ID連携入門 (実習編) - Security Camp 2016
Page 18: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token

Page 19: ID連携入門 (実習編) - Security Camp 2016
Page 20: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token

Page 21: ID連携入門 (実習編) - Security Camp 2016
Page 22: ID連携入門 (実習編) - Security Camp 2016
Page 23: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token

Page 24: ID連携入門 (実習編) - Security Camp 2016
Page 25: ID連携入門 (実習編) - Security Camp 2016

response_type=code

response_type=token

response_type=code+token

Page 26: ID連携入門 (実習編) - Security Camp 2016
Page 27: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Access Token

Request Attributes

Attributes Welcome, Nov!

response_type=token

Page 28: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Access Token + Code

Request Attributes

Attributes Welcome, Nov!

Code

Access Token

Code

??

App Backend

response_type=code+token

Page 29: ID連携入門 (実習編) - Security Camp 2016

Code Flow• “response_type=code”

• Token Endpoint

• Access Token User Agent

• ( ) Client

• Access Token

Page 30: ID連携入門 (実習編) - Security Camp 2016

Implicit Flow• “response_type=token”

• Token Endpoint

• Access Token User Agent

• Client (client_secret )

• End-User (Client ) Access Token

Page 31: ID連携入門 (実習編) - Security Camp 2016

Hybrid Flow• “response_type=code+token”

• Token Endpoint Access Token Token Endpoint Access Token

• Implicit Flow Access Token Code Flow Access Token

Page 32: ID連携入門 (実習編) - Security Camp 2016

User Agent User Agent

Page 33: ID連携入門 (実習編) - Security Camp 2016
Page 34: ID連携入門 (実習編) - Security Camp 2016
Page 35: ID連携入門 (実習編) - Security Camp 2016
Page 36: ID連携入門 (実習編) - Security Camp 2016
Page 37: ID連携入門 (実習編) - Security Camp 2016

(SSL/TLS etc.)

Page 38: ID連携入門 (実習編) - Security Camp 2016
Page 39: ID連携入門 (実習編) - Security Camp 2016

• RFC 6749 - OAuth 2.0 Core

• RFC 6750 - OAuth 2.0 Bearer Token Usage

• RFC 6819 - OAuth 2.0 Threat Model

• RFC 7519 - JSON Web Token

• RFC 7636 - OAuth 2.0 PKCE (Proof Key for Code Exchange)

• RFC 7800 - OAuth 2.0 PoP Token (Proof of Possession)

Page 40: ID連携入門 (実習編) - Security Camp 2016

• RFC 6749 - OAuth 2.0 Core

• RFC 6750 - OAuth 2.0 Bearer Token Usage

• RFC 6819 - OAuth 2.0 Threat Model

• RFC 7519 - JSON Web Token

• RFC 7636 - OAuth 2.0 PKCE (Proof Key for Code Exchange)

• RFC 7800 - OAuth 2.0 PoP Token (Proof of Possession)

[ ] http://openid-foundation-japan.github.io

Page 41: ID連携入門 (実習編) - Security Camp 2016

OpenID Connect~ OAuth 2.0 + Identity Layer ~

Page 42: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token + ID Token

Page 43: ID連携入門 (実習編) - Security Camp 2016
Page 44: ID連携入門 (実習編) - Security Camp 2016
Page 45: ID連携入門 (実習編) - Security Camp 2016
Page 46: ID連携入門 (実習編) - Security Camp 2016
Page 47: ID連携入門 (実習編) - Security Camp 2016
Page 48: ID連携入門 (実習編) - Security Camp 2016
Page 49: ID連携入門 (実習編) - Security Camp 2016

response_type=code

response_type=code+id_token

response_type=token+id_token

response_type=code+token+id_token

Page 50: ID連携入門 (実習編) - Security Camp 2016

• iss (issuer)

• (ID Provider)

• sub (subject)

• aud (audience)

• Client

• exp / iat (expires_at / issued_at)

Page 51: ID連携入門 (実習編) - Security Camp 2016

• auth_time

• ( Authentication Event )

• nonce

• Authorization Request Token Response

• at_hash

• Access Token

• c_hash

• Authorization Code

Page 52: ID連携入門 (実習編) - Security Camp 2016

OAuth OpenID Connect

OAuth

Page 53: ID連携入門 (実習編) - Security Camp 2016

http://bitly.com/sec2016nov

Page 54: ID連携入門 (実習編) - Security Camp 2016

CSRF

Page 55: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token (+ ID Token)

response_type=code

Page 56: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token (+ ID Token)

response_type=code

Page 57: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token (+ ID Token)

response_type=code

Page 58: ID連携入門 (実習編) - Security Camp 2016

https://sec-camp-rp-code.herokuapp.com

Page 59: ID連携入門 (実習編) - Security Camp 2016

Code

Page 60: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Authorization Code

Send the Code

Request Attributes

Attributes Welcome, Nov!

Access Token (+ ID Token)

response_type=code

Page 61: ID連携入門 (実習編) - Security Camp 2016

https://sec-camp-rp-code.herokuapp.com

Page 62: ID連携入門 (実習編) - Security Camp 2016

Token

Page 63: ID連携入門 (実習編) - Security Camp 2016

Login / Sign-up

Request an Access Token

Authentication Event

Issue an Access Token

Welcome, Nov!

Token

Attributes

Token

Session

App Backend

response_type=token

Page 64: ID連携入門 (実習編) - Security Camp 2016

https://sec-camp-rp-implicit.herokuapp.com

Page 65: ID連携入門 (実習編) - Security Camp 2016
Page 66: ID連携入門 (実習編) - Security Camp 2016

prompt=login & max_age=N @

https://sec-camp-rp-code.herokuapp.com

Page 67: ID連携入門 (実習編) - Security Camp 2016

OAuth …•

• OAuth …

• state

• OpenID Connect (max_age etc.)

• Token

• nonce

• ( )

• ID Token aud, sub, auth_time etc.

• OAuth API (Token Introspection)

Page 68: ID連携入門 (実習編) - Security Camp 2016

OAuth …

API or

OpenID Connect

Page 69: ID連携入門 (実習編) - Security Camp 2016

OpenID Connect~ OAuth 2.0 + Identity Layer ~

Page 70: ID連携入門 (実習編) - Security Camp 2016
Page 71: ID連携入門 (実習編) - Security Camp 2016

• RFC 6749 - OAuth 2.0 Core

• RFC 6750 - OAuth 2.0 Bearer Token Usage

• RFC 6819 - OAuth 2.0 Threat Model

• RFC 7519 - JSON Web Token

• RFC 7636 - OAuth 2.0 PKCE (Proof Key for Code Exchange)

• RFC 7800 - OAuth 2.0 PoP Token (Proof of Possession)

Page 72: ID連携入門 (実習編) - Security Camp 2016
Page 73: ID連携入門 (実習編) - Security Camp 2016

https://connect-rp.herokuapp.com

&

https://connect-op.herokuapp.com