gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
16.97k stars 1.71k forks source link

RFD and implementation: Better SSO flow #7493

Open klizhentas opened 2 years ago

klizhentas commented 2 years ago

What

Current Teleport SSO protocol relies on redirects and encryption too much. As a result of that it is quite fragile (large redirects break).

We can borrrow from WebAuthn and use the fact that Teleport 7.0 will have SNI access to GRPC endpoints through web proxy. Once it's ready we can switch protocol to be server side:

This flow does not require any custom encryption or redirects and closer resembles WebAuthn. It might integrate better with WebAuthn as well.

How

Why

This feature is required for Desktop app to work better, improves SSO redirect flow to be more lightweight and not pass data in redriects.

Workaround

If a workaround exists, please include it.

Screen Shot 2021-06-10 at 12 06 09 PM Screen Shot 2021-06-10 at 12 06 14 PM

Flow

Diagram generated with

https://www.planttext.com/


@startuml

desktop_server <- desktop_web_ui: mTLS GRPC login acme.com
desktop_server -> acme.com_web_ui: HTTPS POST /login public key
acme.com_web_ui -> acme.com_server: Create registration attempt (public key)
acme.com_server -> acme.com_web_ui: 32 byte crypto random challenge, attempt id
acme.com_web_ui -> desktop_server: 32 byte crypto random challenge, attempt id
desktop_server -> desktop_web_ui: attempt=signed(public key, challenge, attempt id)
desktop_web_ui -> acme.com_web_ui: redirect /web/login?=attempt
desktop_web_ui -> acme.com_web_ui: POST /web/login (attempt, username, password)
acme.com_web_ui -> acme.com_server: POST /web/login (attempt, username, password)
acme.com_server -> acme.com_web_ui: OK certificate
acme.com_web_ui -> desktop_web_ui: redicrect certificate
desktop_web_ui -> desktop_server: OK certificate
@enduml
klizhentas commented 2 years ago

@codingllama I have chatted with @russjones about that, that would be the next issue for you to hack on after the #6478 issue. @russjones will provide more details.