S15-04 - The Guest Admin User
Purpose: How the host keeps the password of the guest admin user
wbadmin, from the image build to each VM’s first contact.
Design
Section titled “Design”The guest admin user
Section titled “The guest admin user”The provisioning options create the user wbadmin. It is the volume’s
only secure-token holder, which macOS refuses to delete
(X17-image-buildX17-image-build: Unattended image buildCan a macOS guest installed from an Apple restore image get past Setup Assistant, with wb-guestd running as a root LaunchDaemon, without SSH, scripted clicks, or MDM?).
wbadmin stays in the image as a host-administered account
(S06-02-image-buildS06-02-image-build: Image BuildHow wb image build makes a guest image: the build VM, its two provisioning stages, terminfo, sealing, and storage., “Sealing”):
- disabled;
- hidden;
- without a shell;
- out of
admin.
The host keeps its password in the store, and the secure token keeps working.
That keeps 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.: guest root gains no control over the host, because the asset never leaves its VM.
- The password and the token unlock only that VM’s disk.
- Nothing they unlock crosses the Virtualization boundary.
- No VM can reach another VM’s
wbadmin. - Guest root can’t read the password back. The guest keeps only what
macOS keeps for any account, and the build deletes
wbadmin’s keychains before sealing.
wb-guestadmin (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.) does each step below, and only it
reads or writes wbadmin/*.
The admin path for the person at the host’s terminal doesn’t use
wbadmin or its password (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.).
wb-guestadmin-build generates the build password and writes
wbadmin/build/<build>. Then:
wb-hostdcreates two pipes.wb-launcherhands one read end to the build’swb-vmd, and the other towb-build-sshas its standard input.- Once
Installhas finished,wb-guestadmin-buildwrites the password to the first, and one newline-terminated copy to the second. The password is then in the pipe before the provisioning boot’s start call, which reads it within a short deadline (S04-10-vmd-installS04-10-vmd-install: Installing macOS in `wb-vmd`The wb-vmd-install entry of an image build: its install rules, the restore image it reads, the build bundle it installs into, and its Install call., “The build password pipe”).
The build’s SSH session
Section titled “The build’s SSH session”wb-build-ssh (S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh.) speaks SSH in its own process,
with Go’s SSH library. It doesn’t run an ssh program or an
askpass helper.
- It logs in as
wbadminwith SSH password authentication, using the line from its standard input, and offers no other method. - It writes the same password into the session’s standard input, where
the guest’s
sudo -Sreads it. - It doesn’t request a terminal.
The session installs wb-guestd and writes cron’s and at’s allow
files, and does nothing else. As a Remote Login session it has Full
Disk Access, which writing those files needs and wb-guestd lacks
(S06-02-image-buildS06-02-image-build: Image BuildHow wb image build makes a guest image: the build VM, its two provisioning stages, terminfo, sealing, and storage., “Guest confinement”).
The session runs only on the build VM’s own file-handle network,
through the host’s userspace stack. wb-netd connects to the guest’s
port 22 for the build VM only, and hands the socket on
(S07-18-build-networkS07-18-build-network: Build NetworkThe build VM's network: what its wb-netd serves, the one connection to the guest's port 22, and its refusal for session VMs.). No third party can join
that network, so the channel authenticates the guest
(S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does.).
wb-build-ssh therefore doesn’t check the guest’s host key. It
accepts the key the guest offers, and logs its fingerprint. The design
relies on this (“What first contact relies on”).
A session that doesn’t complete, or that passes one of its deadlines (S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh., “Deadlines”), burns the build password:
- the build fails;
- its bundle is deleted;
- cleanup removes its items.
The build never writes the password into the build bundle, and its test searches the bundle for it.
One password per VM
Section titled “One password per VM”Every system disk is a clone of the image. At first contact in each
fresh clone, wb-guestadmin-rotate runs before any other request. It
runs before wb-hostd sends the time, and before wb-guestd lists
its sessions (S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does.).
- It refuses when the store already holds
wbadmin/vm/<vm>/<disk>, whateverwb-hostdor the guest reports. - Otherwise it fetches the image’s item, and generates the new password.
- It writes
wbadmin/vm/<vm>/<disk>. - It sends the old and new password to
wb-guestd, on a host-guest connection of its own. That connection goes to a port below 1024 that serves only this. It never reads from that connection. wb-guestd, as root, enableswbadmin. It runssysadminctl -resetPasswordFor wbadmin -newPassword - -adminUser wbadmin -adminPassword -with both passwords on standard input. Then it disableswbadminagain, and reports the result towb-hostd.- On success,
wb-hostdmarks the VM item current.
The build VM rotates the same way, from the build password to the image password.
The layer VM of a Claude Code layer build rotates the same way, from
the parent’s password to the new image’s (S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “The
Claude Code layer”). There, wb-guestadmin-rotate:
- refuses when the store already holds the new image’s item;
- fetches the parent’s item, and generates the new image’s password;
- writes
wbadmin/image/<image>for the new image, in place of a VM item, before it sends both passwords.
So each image has a password of its own, and the parent’s password opens nothing in the images built on it, or in their VMs.
Rotation failure
Section titled “Rotation failure”On a failed report or no answer:
- both items stay;
wb-hostdmarks the disk “rotation unknown”;- every session start in that VM is refused with the rule
admin-rotation-unknown.
Recovery replaces the system disk, and cleanup removes the disk’s item.
What first contact relies on
Section titled “What first contact relies on”wb-guestd is honest at first contact. The disk is a fresh clone of a
sealed image, and no project code has run on it.
Nothing from the data disk runs before rotation. wb-guestd starts no
project process and no session until rotation has succeeded, and no
user is logged in.
wbadmin is enabled only during the reset, when nothing else runs
that could use it. 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. has the conformance case.
The build’s SSH session relies on its channel, not on a host key. The
channel is the build VM’s own file-handle attachment to wb-netd’s
stack, so the only peer wb-build-ssh can reach is the build guest
behind that stack. To sit in the middle, an attacker would already
have to control a host process on that path: wb-vmd, wb-netd or
wb-hostd. A fresh build
guest also has no host key the host could know in advance.
Break-glass
Section titled “Break-glass”When wb-guestd is dead or wedged, wb-hostd replaces the VM’s
system disk with a fresh clone of the image. The data disk stays, and
first contact rotates again. No password is fetched and nobody logs
in. wb-guestadmin-cleanup removes the old disk’s item.
What guest root wrote to the data disk stays through break-glass (T18-data-disk-persistenceT18-data-disk-persistence: Guest root persists on the data diskAn update and break-glass replace a VM's system disk (and, for an update, its auxiliary storage), and keep its data disk (S06-03-image-updates, "Updates", and S15-04-guest-admin, "Break-glass").).
The same replacement runs at the next start of a VM whose system
disk the admin path marked (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach., “Marked”). To look
inside a VM before its disk is replaced, the person at the host’s
terminal uses the admin path, whose guest end runs apart from
wb-guestd.
Refused outside the path
Section titled “Refused outside the path”wb-vmd refuses provisioning options unless its slot is build. That
is the slot of wb-vmd-install, whose only bundle is the new build
bundle under <data>/images/. The layer slot of wb-vmd-layer uses
the same bundle and refuses them. It logs vmd-provisioning-refused
(S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.).
wb-launcher and wb-guestadmin accept only requests whose fields
are item names in the fixed format of S15-03-access-rulesS15-03-access-rules: Access RulesHow each host process gets only the credentials it needs, for only as long as it needs them, and which process may access which item., “Declared access”. Each refusal is logged with its rule.
No step of this page goes through wb-guestroot’s port, and the admin
path fetches no wbadmin/* item (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.).
Not readable in the image
Section titled “Not readable in the image”The image has no automatic login, no /etc/kcpassword, and no
keychain of wbadmin’s. The sealing scan checks that
(S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does.).
Decisions
Section titled “Decisions”The password on standard input, not through a terminal
Section titled “The password on standard input, not through a terminal”wb-build-ssh gets the build password on its standard input, logs in
with it, and writes it into the session’s standard input for
sudo -S. It never answers a prompt through a terminal.
- Why: the password then never passes through a terminal stream, and no askpass program sits between the pipe and the login.
Status: Draft