Jonathan Wright

03/06/2021, 11:52 AM
I am trying to understand how Prefect deals with the concept of running a flow as a user, with respect to Cloud and Server.  I believe that I’m correct to say that Server has no concept of a user. That is: users don’t login, there are no secrets and flows running on agents have no knowledge of if they were started by a schedule or a user interaction (e.g. UI, CLI, or API client). Whereas, Cloud does authenticate users and does support secrets. However I can see no controls that allow an admin to say which secrets are accessible to which users?  The context of my question is to understand our options for protecting data in databases where our users have their own credentials, which limits access to all the data, and the secrets/credential on our Prefect Server agents would likely allow access to all data. I welcome any thoughts on this topic, thank you.

Chris White

03/07/2021, 12:41 AM
Hi Jonathan - great questions; you are correct that Server has no concept of user, and thus no permissions system built in. (Side note: you can detect whether a flow was scheduled or not via the
flag on `flow_run`s) For Cloud, Enterprise licenses come with a customizable permissioning system that can optionally include multiple tenants for fine grained access controls to things like secrets or collections of flows. I’ve seen some other patterns that are more complicated, where teams will separate out registration into a permissioned CI job and keep the agent machines tightly permissioned as well; additionally the agent machines are authenticated (without Cloud secrets) to the relevant third party services / DBs + generous use of labels to make sure the right agent runs the right flow.
👍 1