S09-03 - Project Settings
Purpose: What a project’s settings hold, and what a repository’s own
.wraithbox/ configuration may add.
Design
Section titled “Design”Settings contents
Section titled “Settings contents”A project’s settings hold:
- the project toolchain manifest (Brewfile on macOS guests);
- extra writable repositories;
- the guest OS;
image, the named image its sessions need (S06-17-named-imagesS06-17-named-images: Named Images and RecipesThe build of a named image from a recipe on a clone of the sealed base., “The image a VM runs”);placement;shared;config_trust;- resource limits.
Clipboard and port-forwarding switches come after V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. (V1-08-no-forward-clipboardV1-08-no-forward-clipboard: No port forwarding or clipboardPort forwarding (FR11-port-forward) and the clipboard (FR12-clipboard) are out of scope for V1, so nothing new crosses the VM boundary for them (S06-vm-lifecycle).).
placement and config_trust are in the project’s row of the
projects table in state.db, which only wb-hostd writes. The rest
is in <config>/projects/<project-id>.toml (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., “Host
state”).
placement
Section titled “placement”placement is work or isolated: the VM the project’s sessions run
in. A new project gets work. --isolated overrides it for one
session (S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in.).
A project is set to isolated when its credentials or write grants
must stay apart from other projects, or when the user doesn’t trust its
repository. It then gets the isolated VM to itself, unless shared is
on (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.).
shared
Section titled “shared”shared is off by default. On for a project with
placement = isolated, it lets the project share the isolated VM with
--isolated sessions and other shared projects, and their grants
(S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in.). It has no effect with placement = work.
Learn mode
Section titled “Learn mode”A learn-mode session (FR10-learn-modeFR10-learn-mode: Learn modeA learn mode, available only to projects whose placement is work (S05-cli), records the destinations a project needs and proposes an allowlist.) needs placement = work, and is
refused with --isolated.
That isn’t a vouch for the repository, because every new project has
placement = work. The condition keeps learn mode in the work VM,
where the project’s sessions run and its learned allowlist applies. It
keeps learn mode out of sessions the user isolated.
A learn period stays attributable to one project for another reason:
wb-hostd runs it only while no other project has a session in the VM
(S07-17-approvals-and-learningS07-17-approvals-and-learning: Approvals and LearningHow an unknown destination reaches the user as an approval request, what an approval grants, and how learn mode collects names.).
config_trust
Section titled “config_trust”config_trust says whether the repository’s .wraithbox/ is read
(“Repository-supplied configuration”).
- It is off for a new project.
- Only
wb trustsets it, after the boundary check. wb untrustandwb project confirmclear it (S05-04-namingS05-04-naming: NamingHow wb identifies a project, a session and its branch, and how projects are registered, checked, moved and removed.).- Learn mode doesn’t look at it.
The word “trusted” alone names neither placement nor config_trust.
Repository-supplied configuration
Section titled “Repository-supplied configuration”A repository can hold a .wraithbox/ directory (config.toml,
policy.yaml). It is ignored unless the project’s config_trust is on
(wb trust).
Even then it may only add:
- allowed hosts;
- a toolchain manifest;
- HTTP rules.
Every addition is shown in wb policy explain.
It can never add credential bindings, switch hosts to pass-through, or add a raw TCP entry (SEC09-host-policySEC09-host-policy: Policy is held on the hostThe guest cannot read or change policy.).
Repository configuration that sets enforcement: audit on an endpoint
is refused at load, with an error that names the host, like a pass host
or a raw TCP entry. An approved rule can’t be in audit either
(S09-09-approvalsS09-09-approvals: ApprovalsWhat an approval adds, the checks that each request goes through, and approvals for a joining project., “Approved rule”).
Closed keys
Section titled “Closed keys”It is parsed against a closed list of those keys. Any other key is a
load error, so it can’t set placement, config_trust or image,
and never defines a recipe (S06-17-named-imagesS06-17-named-images: Named Images and RecipesThe build of a named image from a recipe on a clone of the sealed base., “Only from user
settings”).
A rule on a built-in host whose profile part is off is a load error too (S07-11-http-policyS07-11-http-policy: HTTP PolicyThe HTTP rules of inspected hosts, the built-in profiles, and the parts a user can turn off., “Profile parts”).
Which commit
Section titled “Which commit”It is read only from the host repository’s checked-out HEAD. It is
never read from the landing or export repository, or from a push’s
quarantine (S08-04-push-checksS08-04-push-checks: Push ChecksThe checks that bound the memory and work of a push before git unpacks it: git's allocation limit, the pack scanner, and the pre-receive check.). So the guest can’t change it by pushing.
Returned work that changes .wraithbox/ is flagged
(S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem.). The guest can still propose such a change. So
the parser has a fuzz target (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., network policy
YAML).
Decisions
Section titled “Decisions”placement and config_trust are two settings
Section titled “placement and config_trust are two settings”- Decided: I42I42 (closed): S05-cli, S06-vm-lifecycle, S09-policy-credentials-audit: separate configuration trust from VM placement; project identityThe specs use "trusted" for two different things and do not give a default: (B42-trust-placementB42-trust-placement: Where does a new project run, and what makes it the same project later?Split "trusted" into two named settings, start new projects in the isolated VM until the user moves them, and key project identity on the git directory rather than the remote URL.).
No audit from repository configuration
Section titled “No audit from repository configuration”Status: Draft