temporalio / temporalio/temporal-worker-controller
Narrow TemporalConnection RBAC: finalizer updates currently require main-resource writes
@jaypipes is already working on this.
Since May 13, 2026.
- Dominant language
- Go
- Stars
- 187
- Forks
- 70
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 31
Description
Problem
Downstream deployers want to grant the controller minimum RBAC on TemporalConnection.
The chart already declares a /finalizers RBAC rule:
- apiGroups: [temporal.io]
resources: [temporalconnections/finalizers]
verbs: [update]
Ideally, this would move finalizer writes out of the main-resource permission path, while keeping writes scoped to /status and /finalizers.
In practice, the current DeprecatedTCReconciler mutates finalizers via main-object Update:
Because this is r.Update(ctx, &tc) on the main resource, Kubernetes RBAC checks update on temporalconnections, not only temporalconnections/finalizers. As a result, downstream charts must still grant main-resource update / patch, which broadens the controller's write surface on user-owned TemporalConnection.spec.
The same pattern appears to exist for the modern Connection kind in internal/controller/worker_controller.go (lines 760-774, lines 817-820), where temporal.io/delete-protection is added/removed via main-object Update.
Desired outcome
One of:
- Switch finalizer mutation in
DeprecatedTCReconcilerand the equivalentConnectionfinalizer paths to use the/finalizerssubresource explicitly, for example via controller-runtime's finalizers subresource support or an equivalent patch helper. - Or document in the chart README / RBAC comments that main-resource
update/patchontemporalconnectionsandconnectionsis required for finalizer management, so downstream RBAC reviews can treat it as an intentional requirement rather than over-broad permission. - Or land an interim doc note now and track a later code refactor.
Context
This came up during a Coinbase InfraSec review of a sandbox deployment of the controller. Sandbox deployment can proceed with documented broad RBAC, but production rollout requires a narrower or better-justified TemporalConnection write surface.
Related issues:
- #311 covers Secret-read RBAC reduction through file-based mTLS.
- #317 reports another impact of finalizer mutation via main-object
UpdateonTemporalWorkerDeploymentfield ownership.
This issue tracks the RBAC/security impact for TemporalConnection and Connection.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.