[solver] Agent workers and permissioned_as
Hi there, I'm trying to execute some script in an un-trusted environments, I organized my scripts and secrets inside folder, and I currently have:
- /f/customer1/remote_exec.ts
- /f/customer2/remote_exec.ts
Those two scripts are quite simple for now, they are simply doing
I created two groups: - g/customer1 - g/customer2 Is there a way to prevent the script from customer1 to be able to read secret from customer2, and the other way around ? In the documentation I saw something about the
await wmill.getVariable("f/customer1/secret_value"); await wmill.getVariable("f/customer2/secret_value")
I created two groups: - g/customer1 - g/customer2 Is there a way to prevent the script from customer1 to be able to read secret from customer2, and the other way around ? In the documentation I saw something about the
permissioned_at
but I can't find anyway to "downgrade" my permission to g/customer1 or g/customer2 to run the script (both from the UI and the CLI).
Am I missing something ? Is what I want to do even possible ?
Thanks6 Replies
The permissionned_as is tied to the caller, not executor
So as long as caller has the reduced permissions yes it will work
Thanks ! That completely makes complete sense
So now my question is: how can I reduce the permission of the caller, or create a caller (token?) that only has access to one of those two groups
You can create users with those permissions and do that on the fly with the jwt EE feature
We will bill for those users as operators
Very interesting, thanks for the information that's exactly how I would have see this working ! Is this the documentation about the feature: https://www.windmill.dev/docs/advanced/external_auth_with_jwt ? I think that it's perfect for what I want to achieve
External auth with JWT | Windmill
Instead of using the built-in authentication and authorization mechanisms, you can generate your own JWT tokens with the desired permissions for your already authenticated users and pass them to Windmill.
Yes correct
This is working as expected, thanks a lot !
Side note: I created a JWT with is_admin: false and is_operator: false (copy pasted from the doc), and all the permissions seems to be respected (tried with an empty
folders
attribute, and then added the folder I wanted to grant access to. However when testing the token against the whoami endpoint, I noticed that the role was superadmin
:
This does not seem to have any impact on anything, but I wanted to raise this in case it was an issue. What is this role used for ?