Let a sandbox's people manage its ports - #37
Closed
vitramir wants to merge 2 commits into
Closed
Conversation
A browser is not the workload. Every path through AddExposure assumed it was -- the Gateway injects x-workload-id from a verified OpenZiti connection and the service checks identity equality against it -- so the only route left for a person was the explicit-workload_id path, which was cluster-admin-only. RemoveExposure fell back to organization owner. A sandbox owner could neither expose a port from outside the container nor take one away. Whoever can open a shell in the sandbox may now do both. can_connect grants nothing new: a shell can run agyn expose add already, so a button doing the same is the same capability, and a stricter gate would refuse someone the terminal in the next tab obeys. No new relation and no new tuple -- sandbox already defines can_connect and the Terminal Proxy already checks it. The decision now depends on what owns the workload, so the workload is read before it rather than after. A caller who is refused therefore reaches Runners.GetWorkload first, which authorizes that read itself; nothing is disclosed that Runners would not have disclosed anyway. Scoped to sandbox owners. An agent-instance workload has no comparable relation and no surface asking for one, so it stays cluster-admin-only -- there is a test holding that line for an identity that happens to hold can_connect on an object sharing the instance's id.
Every other service in the platform has one; expose did not, so verifying a change against the real Gateway, OpenFGA and Ziti controller meant a full image build. Modelled on networks, with one difference that matters: expose's buf.gen.yaml carries no inputs block -- CI passes the module and its --path filters on the command line -- so the generate command here is the one from the workflow rather than a bare --template invocation, which would fail with no input.
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.
Stacked on #36. Retarget to
mainonce that merges.A browser is not the workload. Every path through
AddExposureassumed it was — the Gateway injectsx-workload-idfrom a verified OpenZiti connection and the service checks identity equality against it — so the only route left for a person was the explicit-workload_idpath, which was cluster-admin-only.RemoveExposurefell back to organization owner. A sandbox owner could neither expose a port from outside the container nor take one away.can_connecton the sandbox now authorizes both. It grants nothing new: a shell can runagyn expose addalready, so a button doing the same is the same capability, and a stricter gate would refuse someone the terminal in the next tab obeys. No new relation and no new tuple.The decision depends on what owns the workload, so the workload is read before it rather than after. A caller who is refused therefore reaches
Runners.GetWorkloadfirst, which authorizes that read itself — nothing is disclosed that Runners would not have disclosed anyway.Scoped to sandbox owners; agent-instance workloads stay cluster-admin-only, with a test holding that line for an identity that happens to hold
can_connecton an object sharing the instance's id.Also adds
devspace.yaml— expose was the only service without one. Verified end to end against the live cluster: owner add/list/remove all succeed, and OpenFGA confirmscan_connectis what admits them.Spec: agynio/architecture#179 (merged).