flyteorg / flyte

Scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks.
https://flyte.org
Apache License 2.0
5.57k stars 607 forks source link

[Core feature] Make Flyte work with GCP Identity Aware Proxy (IAP) #3965

Closed fg91 closed 12 months ago

fg91 commented 1 year ago

Motivation: Why do you think this is important?

GCP Identity Aware Proxy (IAP) is a managed service that makes it easy to protect applications deployed on GCP by verifying user identity and using context to determine whether a user should be granted access.

Because requests to applications protected with IAP first have to pass IAP before they can reach the protected application, IAP provides a convenient way to implement a zero-trust access model.

(In contrast, if applications are protected using their own auth mechanism, unauthenticated requests typically first hit the application which only then redirects to e.g. a google login page. With IAP, no unauthenticated request can ever hit the application.)

Since IAP makes it very easy to implement a zero-trust model, many organizations using GCP have a security policy that any internal tool has to be protected with it.

Goal: What should the final outcome look like, ideally?

Flyte currently does not work with IAP but there is a need in the community to enable this integration:

Describe alternatives you've considered

In organizations where there is a security policy to use IAP, workarounds typically include 1) deploying flyte itself without authentication enabled and instead with IAP in front of flyteconsole and 2) port-forwarding flyteadmin's gRPC server to localhost or interacting with it only from within the cluster/the VPC (as pyflyte and flytectl cannot reach flyteadmin through IAP).

None of this is great.

Propose: Link/Inline OR Additional context

This issue tracks the integration of flyte with IAP, consisting of the following tickets:

Are you sure this issue hasn't been raised already?

Have you read the Code of Conduct?

fg91 commented 1 year ago

There is one important design choice I made:

There are two ways clients can authenticate with IAP. Let's say we have an ID token valid for IAP:

While the first option would be a deeper integration of IAP into Flyte (admin), I chose - as a first step - to go for option 2.

Reasoning:

Finally, I see this as the first step in integrating Flyte with IAP in order to fulfil a need that we have. I found the "proxy-authorization" way the better first step but this choice does not prevent a deeper integration of IAP into flyteadmin in the future.


TL;DR:

I chose to add logic that can be reused for other proxies on the client side instead of adding non-reusable logic pertaining to a specific managed cloud service to the server side.