Skip to content

feat(coder-templates/firewalled): add landjail-firewalled Claude Code template + AOI remediation plan#42

Open
ausbru87 wants to merge 3 commits into
mainfrom
ws-2x/firewalled-template
Open

feat(coder-templates/firewalled): add landjail-firewalled Claude Code template + AOI remediation plan#42
ausbru87 wants to merge 3 commits into
mainfrom
ws-2x/firewalled-template

Conversation

@ausbru87

@ausbru87 ausbru87 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses the critical AOI gap: no agent firewall. Adds a new firewalled workspace template (the claude-code template with the Coder Boundary agent firewall enabled) and lands the AOI gap remediation plan plus execution-ready briefs for the remaining tasks.

Claude Code now runs inside a landjail (Landlock LSM) process-level network egress jail that denies all HTTP(S) egress except an allowlist (the in-boundary AI Gateway and in-cluster GitLab). Every denied request is audit-logged to coderd with owner / workspace / agent / URL / template attribution. This is the data-exfiltration / DLP guardrail story for the AOI.

What changed

  • coder-templates/firewalled/ (new): copy of claude-code with, in module "claude_code", enable_boundary = true, use_boundary_directly = true, boundary_version = "latest", and a pre_install_script that writes ~/.config/coder_boundary/config.yaml (allowlist + jail_type: landjail) before Claude Code launches. Pushed live to the coder org.
  • aoi/plan-firewall-and-auth-mcp.md: remediation plan; the firewall section is updated to as-built and validated.
  • aoi/brief-github-auth-mcp.md, aoi/brief-observability-audit-readiness.md, aoi/brief-template-golden-path-e2e.md: execution-ready briefs so the remaining tasks (authenticated MCP, observability/audit readiness, template golden-path e2e WS-25) can be run in parallel.

Why use_boundary_directly = true

The default coder boundary subcommand verifies the deployment license through an authenticated client, but the workspace agent carries only an agent token (no user session), so that path errors with "not logged in". The standalone boundary binary (MIT) has no license/login dependency. The 4.7.3 module passes no --allow/--jail-type flags, so the allowlist and jail type come only from the config file written by pre_install_script.

Live validation on dev.usgov.coderdemo.io
  • Preflight: node LSM stack is lockdown,capability,landlock,yama,safesetid,selinux,bpf,ima (landlock present); AL2023 kernel 6.18 exceeds the Landlock 6.7 floor. landjail needs no added pod capabilities, so the pod security context is unchanged.
  • Build: the firewalled template builds to a healthy, connected workspace (austenplatform/firewall-test).
  • Jail confirmed: process tree is agentapi server ... -- boundary -- claude --session-id ... (Claude Code is a child of boundary).
  • Allow/deny enforced (terminal, free --proxy-port since the agent's boundary owns 8080): gateway buildinfo 200 (allow), gitlab 302 (allow), example.com 403 (deny), github.com 403 (deny).
  • Audit logs: coderd emits boundary_request lines with full attribution. Real captured denies include Claude Code's own calls to api.anthropic.com (eval + event_logging) and raw.githubusercontent.com (update check), while inference through the allowlisted gateway works. The shipped boundary Grafana dashboard parses these via Loki.

Rollback: use the un-firewalled claude-code template, or set enable_boundary = false and re-push. Running pods survive (ignore_changes = all).

Notes

  • Conventions: no emdash/endash; the only -- occurrences are literal boundary -- <cmd> CLI syntax inside code fences.
  • The firewalled template inherits the required GitLab external-auth from claude-code; the WS-25 brief documents the build gate and the admin REST create-for-authenticated-owner workaround used here.

Generated by Coder Agents, on behalf of @ausbru87.

ausbru87 added 3 commits June 9, 2026 13:40
… template

Add a new "firewalled" workspace template: the claude-code template with the
Coder Boundary agent firewall enabled. Claude Code runs inside a landjail
(Landlock LSM) process-level network egress jail that denies all HTTP(S)
egress except an allowlist (the in-boundary AI Gateway and in-cluster GitLab).
Every denied request is audit-logged to coderd with owner, workspace, agent,
URL, and template attribution.

Wiring (claude-code module 4.7.3): enable_boundary=true,
use_boundary_directly=true (standalone boundary binary; the coder boundary
subcommand needs a logged-in CLI session the agent lacks), and a
pre_install_script that writes ~/.config/coder_boundary/config.yaml with the
allowlist and jail_type=landjail before Claude Code launches.

Validated live on dev.usgov.coderdemo.io: build succeeds, the process tree
shows agentapi -> boundary -> claude, allow/deny enforced (gateway 200,
gitlab 302, example.com 403, github.com 403), and coderd emits boundary_request
audit lines for Claude Code's own blocked telemetry egress.

Generated by Coder Agents.
Add the AOI gap remediation plan (firewall + authenticated MCP, with the
firewall section updated to as-built and validated) and three execution-ready
briefs so the remaining tasks can be run in parallel:

- brief-github-auth-mcp.md: stand up an authenticated MCP (GitHub hosted MCP
  via PAT/OAuth), including the 200/202-vs-204 client gate to check first and
  an in-boundary datastore-mcp fallback.
- brief-observability-audit-readiness.md: verify the boundary and AI Gateway
  Grafana dashboards and the Coder audit log show live demo data; confirms the
  boundary forwarded-batch metric name from source.
- brief-template-golden-path-e2e.md: WS-25 per-template build + connectivity
  matrix, including the GitLab external-auth gate and the admin REST
  create-for-authenticated-owner workaround.

Generated by Coder Agents.
…owlist

Replace the minimal gateway+gitlab allowlist with the Red Hat Summit 2026 demo
allowlist (coder/demo-aigov-rhaiis-rhsummit-2026): Claude Code's default
allowed domains (most package managers, GitHub, container registries, cloud
SDKs) plus this deployment's Coder host and the in-cluster GitLab. npm is
intentionally omitted so `npm install` is the obvious DENY in the demo.

- Add boundary.config.yaml.tftpl (175 allow rules), rendered with
  templatefile() so ${coder_host} resolves from the access URL, and written
  via a base64 round-trip in pre_install_script.
- Set BOUNDARY_CONFIG and BOUNDARY_JAIL_TYPE=landjail agent env vars so
  boundary loads the config and uses landjail reliably (boundary v0.9.0
  dropped config auto-discovery).

Validated live: firewall-test rebuilt on the new version, Claude Code still
jailed, ALLOW gateway/pypi/github = 200, DENY registry.npmjs.org/example.com
= 403.

Generated by Coder Agents.
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