S13 - Guest Confinement
Purpose: Controls inside the guest that narrow what a project user’s processes can do, and tell the host which program opened each connection. They add a layer on top of the host-side controls and never replace them.
Requirements: SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable., SEC06-repo-writesSEC06-repo-writes: Repository-scoped writesGit pushes and repository-mutating API calls are allowed only for the repositories of the projects that have a session in the VM., SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another., SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy., FR15-inspectFR15-inspect: Inspect what happenedThe user can inspect what happened: per-session audit log, policy explanation, diff of returned work with risky changes flagged., NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it..
Tests: C03-policy-and-approvalsC03-policy-and-approvals: Policy and ApprovalsThe test cases for network policy: loading it, combining the policies of the projects in one VM, modes per host, profile parts, learn mode, and the approval flow., C09-guest-and-sessionsC09-guest-and-sessions: Guest and SessionsThe test cases for what a project user can reach inside the guest, wb-guestd's update and the guest clock, the shared toolchain prefix, the guest admin password, and the session lifecycle.
Briefs: B20-guest-xcodeB20-guest-xcode: Can Xcode builds, tests and simulators run for a project user without a GUI login?Yes, with conditions., B29-vsock-handoffB29-vsock-handoff: Can wb-vmd hand guest connections to our Go daemons as descriptors, also across a restore?Yes, with conditions.
Design
Section titled “Design”This spec describes macOS guests, the v1 target. OpenShell’s Linux
sandbox runtime is the model for this layer: Landlock, seccomp, and
process identity from /proc. Linux and Windows guests get their own
mechanisms in S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL. when they arrive.
Principle: narrow, never widen
Section titled “Principle: narrow, never widen”The guest kernel, or software that guest root can reach, enforces each control here. T00-indexT00-indexboundary 6 is the host terminal stream. assumes the attacker may hold guest root (SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy.). So:
- The host floor is complete. The host meets each
SEC*control (S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. to S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded.) with this layer absent, disabled, or compromised. - Guest controls can only deny. A rule that uses a program identity narrows an allow rule that the host would grant anyway. A missing or malformed identity matches no narrowed rule, so narrowed rules fail closed.
- Identities are labels. They are recorded in the audit log as reported by the guest (S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded.), never as proof.
Guest root can forge identities. Per-program and per-project rules then come down to the union of the VM’s grants. That is residual risk T06-forged-labelsT06-forged-labels: Forged program labels after guest rootAfter a guest root escalation, forged program identities in the guest confinement layer (S13-guest-confinement)..
The floor is per VM
Section titled “The floor is per VM”The host floor is per VM, not per project (S07-01-per-vm-policyS07-01-per-vm-policy: Enforced per VMWhy the VM is the unit the gateway enforces, how the policies of its projects combine, and what happens when they conflict or change.). Any process in a VM can use the network grants and credential bindings of every project with a session in it, without guest root (T11-shared-vm-grantsT11-shared-vm-grants: Projects in one VM share network grantsThe host sees one guest address per VM, and can't tell which project user, session or program opened a connection.).
Only a label from this layer can tell projects apart on the network (S13-03-network-attributionS13-03-network-attribution: Layer 3: Per-Program Network Attribution (after X14-flow-attribution)How a Network Extension in the guest labels each flow with the program and user that opened it, and how rules match on the label.). It does so only against a process without guest root.
Status: Draft