Skip to content

fix(daveahr2172/governed-agents-nitro): disk limits, valid GitHub probes, gate wording - #1268

Merged
DevelopmentCats merged 6 commits into
coder:mainfrom
daveahr2172:daveahr2172-nitro-sandbox-defaultdeny
Nov 23, 2026
Merged

DevelopmentCats merged 6 commits into
coder:mainfrom
daveahr2172:daveahr2172-nitro-sandbox-defaultdeny

Conversation

@daveahr2172

@daveahr2172 daveahr2172 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Brings registry/daveahr2172/templates/governed-agents-nitro up to date with the Nov 18 changes from the live Nitro Sandbox deployment (EKS 1.37, Auto Mode), after review of #1253.

  • Disk limits: ephemeral-storage 8 GiB on the workspace and 256 MiB on the proxy, and a 2 GiB size limit on /tmp. In a Nitro Sandbox the kubelet cannot measure disk use; the sandbox gets a disk the size of the limit and writes past it fail with ENOSPC (measured live; /tmp sizeLimit is not enforced there, so the README says so).
  • Firewall demo, GitHub rows: an unauthenticated 401 now reads "no credential sent; the network allowed it" instead of "only credentials stop it". With github_external_auth_id set, new rows use the owner's linked GitHub credential with writes that are well formed but cannot succeed (a branch at an all-zero commit, a gist with an empty file), so nothing is created. A 403 or 404 is reported as denied, with GitHub's reason. A 422 is reported as unclear: the request is invalid, so it does not show that the credential may write, and no permitted write was tested. Empty request bodies were not a valid test: GitHub answered a branch creation in coder/coder with 422 although the token has no push access there.
  • Policy gate: described as a readiness check, not a security boundary (the workspace user can kill it, and any failed connection counts as closed).
  • README: recommends networkPolicy: DefaultDeny on the Auto Mode NodeClass, adds a stop procedure with an optional quarantine ClusterNetworkPolicy, and notes that network stops leave established connections open.
  • README, enforce placement: the cluster does not require the template's node pool or sandbox RuntimeClass, so the README adds an example ValidatingAdmissionPolicy that does (node affinity required, no spec.nodeName, sandbox RuntimeClass except for the proxy), rolled out with Warn/Audit first. Checked with a server-side dry run on EKS 1.37 (compiles, nothing created) and with cel-go against 11 Pod shapes; not yet enforced on a live cluster. A new test run, pods_meet_the_readme_placement_policy, fails if the template's Pods stop matching the policy's node affinity, RuntimeClass, or proxy label rules.
  • README, stop procedure: the proxy log lives only in the proxy container's stdout, so coder stop deletes it. The README now says to ship proxy container logs to a log store first, for example with a platform-owned log DaemonSet on the agent nodes. Tested on EKS with Fluent Bit: a request made just before coder stop was in CloudWatch Logs after the Pod was gone.
  • Providers: pinned with ~> to the tested versions.

Type of Change

  • Bug fix
  • Feature/enhancement
  • Documentation

Template Information

Path: registry/daveahr2172/templates/governed-agents-nitro

Testing & Validation

  • terraform validate and terraform test (15 passing, 2 new runs and 4 new assertions)
  • After review: the 422 wording fix (57d0300) was checked with stubbed responses and live on labs with the same probe code
  • bun run fmt, ShellCheck (--severity=warning, including the rendered demo script), cmd/readmevalidation, and typos
  • Live on EKS 1.37 Auto Mode with Nitro Sandboxes, from the source repo at the same changes: disk limit (ENOSPC at 8 GiB), DefaultDeny and quarantine (new connections blocked, open connections stay up), and the GitHub rows with Coder's built-in GitHub provider (/user 200; branch in an org repo, branch in a personal repo, and gist all denied with 403 "Resource not accessible by integration"; nothing created).

Related Issues

Follow-up to #1253.

Generated with Coder Agents on behalf of @daveahr2172.

…bes, gate wording

- Ephemeral-storage limits on the workspace (8 GiB) and proxy
  (256 MiB), and a 2 GiB size limit on /tmp. In a Nitro Sandbox the
  disk is sized from the limit and writes past it fail with ENOSPC.
- Firewall demo: an unauthenticated 401 reads "no credential sent; the
  network allowed it". With github_external_auth_id set, new rows use
  the owner's GitHub credential with well-formed writes that cannot
  succeed, so 403 and 422 mean refused and permitted and nothing is
  created. Empty bodies were not a valid test.
- The policy gate is described as a readiness check, not a boundary.
- README: recommend DefaultDeny on the Auto Mode NodeClass, add a stop
  procedure and a quarantine option, and note that network stops leave
  open connections up.
- Pin providers to the tested versions. Tests for both.

Generated with Coder Agents.
@daveahr2172

Copy link
Copy Markdown
Collaborator Author

@bpmct follow-up to #1253: brings the template up to date with the Nov 18 changes (disk limits, a valid GitHub credential test, the policy gate described as a readiness check, a stop procedure, pinned providers). Could you review?

bpmct
bpmct previously approved these changes Nov 18, 2026
A well-formed request that cannot succeed is still invalid, so a 422
does not show that the credential may write. The firewall demo now
reports a 422 as unclear, and a 403 as denied with GitHub's message,
since 403 has causes other than credential scope. The README says the
same. Verified on EKS 1.37 Auto Mode with the same probe code: all
three writes denied ("Resource not accessible by integration"), nothing
created.

Generated with Coder Agents.
The template schedules workspace and proxy Pods onto the node_pool
nodes and the workspace into the sandbox, but the cluster does not
require it, so anyone who can change what the provisioner deploys can
run a Pod outside the firewalled nodes. Add an example
ValidatingAdmissionPolicy that requires the agent node affinity,
forbids spec.nodeName, and requires the sandbox RuntimeClass except
for the proxy, with a Warn/Audit rollout and the label-based gap.

Checked with a server-side dry run on EKS 1.37 (compiles; nothing
created) and with cel-go against 11 Pod shapes: the template's Pods
pass and the bypasses fail, except the documented proxy-label gap.

Generated with Coder Agents.
…s meet the README placement policy

Generated with Coder Agents.
… coder stop deletes the proxy log

Generated with Coder Agents.
@DevelopmentCats
DevelopmentCats enabled auto-merge (squash) November 20, 2026 21:08
@DevelopmentCats
DevelopmentCats merged commit 8ccd2fd into coder:main Nov 23, 2026
7 checks passed
@daveahr2172
daveahr2172 deleted the daveahr2172-nitro-sandbox-defaultdeny branch November 23, 2026 16:58
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.

3 participants