Repository navigation
[feat] Add optional dedicated service accounts for the code and JS executors - #432
Open
cameronattard wants to merge 1 commit into
Open
cameronattard wants to merge 1 commit into
cameronattard wants to merge 1 commit into
Conversation
…ecutors Every workload shared one service account, so a cloud identity annotation on it (EKS IRSA, GKE Workload Identity) also reached the executors, which run user code. codeExecutor.serviceAccount and rr.jsExecutor.serviceAccount can now create a dedicated account (create: true, optional name, annotations, automountToken) or point at an existing one (name). Left unset, both keep using the top-level serviceAccount, so existing installs render identically.
Contributor
[Medium impact] The PR appears safe to merge and preserves existing account choices by default. Reviews (1) · Last reviewed commit: "[feat] Add optional dedicated service ac..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
codeExecutor.serviceAccountandrr.jsExecutor.serviceAccount, so the two executors that run user code can use a different service account from the rest of Retool.rr.jsExecutor.serviceAccountis the same (default name<fullname>-js-executor). With both left at their defaults, the executors keep the top-levelserviceAccountand the render is unchanged.Why
Every Retool workload uses the one top-level service account. On EKS the usual way to give Retool AWS access (S3, Bedrock, Secrets Manager) is an IRSA annotation on that account, and GKE Workload Identity works the same way. The pod identity webhook then projects a cloud token into every pod that uses the account, including the code executor and JS executor. Those pods run user-supplied code, so they hold credentials they never need. nsjail limits what sandboxed code can reach, but a sandbox escape, or code in the JS executor, would get the backend's cloud role.
With
create: truethe executor gets its own account without the annotation, so the webhook injects no token. The account hasautomountServiceAccountToken: falseby default; neither executor calls the Kubernetes API.This is limited to the two executors. Other workloads (backend, workflows, workers, MCP) need the same permissions as the backend in practice, and the agent sandbox controller already has its own account.
Verified
.github/test_executor_service_accounts.py, wired intoci.yaml, covers:create: truewith and withoutname, while the backend keeps the shared account and its annotation;automountTokenon the created account;namewithoutcreate;maindiffers only in the chart version label.helm lintandschema/generate.sh --checkpass; the twovalues.yamlfiles are in sync.charts/retool/ci/test-executor-service-accounts-option.yaml, so kubeconform validates the new path (passes locally with kubeconform 0.6.7 against Kubernetes 1.31.1).