Skip to content

Let a sandbox's people manage its ports - #37

Closed
vitramir wants to merge 2 commits into
entity-named-port-exposurefrom
sandbox-managed-exposures
Closed

Let a sandbox's people manage its ports#37
vitramir wants to merge 2 commits into
entity-named-port-exposurefrom
sandbox-managed-exposures

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

Stacked on #36. Retarget to main once that merges.

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.

can_connect on the sandbox now authorizes both. It 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.

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.GetWorkload first, 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_connect on 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 confirms can_connect is what admits them.

Spec: agynio/architecture#179 (merged).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant