Skip to content

S09-09 - Approvals

Purpose: What an approval adds, the checks that each request goes through, and approvals for a joining project.

Requirements: SEC14-no-fake-approvalsSEC14-no-fake-approvals: Approvals cannot be spoofed by the guestApproval prompts are never rendered in the agent's terminal stream.

Before an approval request is shown, the rule it would add goes through a risk check. The check compares the policy with and without the rule, and reports what the rule adds. Findings are part of the request.

Only the user approves a request.

An approval adds one rule of a fixed form:

  • one exact host, with no wildcard;
  • protocol: rest;
  • enforcement: enforce;
  • access: read-only (GET, HEAD and OPTIONS);
  • binaries: /**.

A write method needs a separate request (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., “What an approval grants”). It adds a rule of the same fixed form, with one named method and the exact path, or path prefix, that the request used, in place of access: read-only.

Both forms only allow: no denies, no audit mode, no extension keys.

wb allow adds only a rule of the first form. It never adds a pass host or a raw TCP entry (S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP.).

The host in an approved rule comes from the guest. It must pass the same ASCII, control-byte and length rules as policy strings before the risk check or the prover sees it. Otherwise the request stays denied, and is logged with the rule.

Each check reports under a name. The first four take their names from OpenShell’s proposal risk check.

wb-proxyd injects credentials only into inspected HTTP. So no program that doesn’t speak HTTP gets a credential, and this is the bypass that matters.

OpenShell keys this check on its list of known programs. It never reports a /** rule (X24-openshell-artifactsX24-openshell-artifacts: OpenShell artifactsDo the OpenShell parts that S07-egress-gateway, S09-policy-credentials-audit and S10-tech-stack build on exist in the assumed form, under a permissive license, at a version that can be pinned: the networkpolicies sche…).

The risk check is Go code in wb-hostd. It:

  • follows the four categories and names of OpenShell’s check at v0.1.2;
  • adds Wraith Box’s own checks (“Checks”);
  • runs OpenShell’s cases as its tests.

A request whose rule would leave the boundary isn’t shown.

The prover checks the rule alone, in the approved form, against the boundary. An approved rule only allows. So a rule inside the boundary can’t take a policy that is inside it outside. The user’s own policy is checked at session start for that reason (S09-04-boundary-checkS09-04-boundary-check: Boundary CheckThe check of a project's policy against the boundary policy with OpenShell's prover, and which policy it checks when.).

A refusal is logged as a Device Config State Change (5019) event.

The guest triggers approval requests: one per unknown name it looks up, outside the guest OS’s background list and the hosts of parts that are off (S07-03-dnsS07-03-dns: DNSHow wb-netd answers the guest's DNS queries: synthetic addresses, the name form, negative answers and the wildcard budget.). So prover runs are bounded (SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped.).

A request over a limit stays denied, and is logged with the rule that limited it.

A request whose risk check or boundary check fails or can’t run can’t be approved. The destination stays denied, and the failure is logged.

The risk check can find something in a joining project’s rules and bindings, compared with the VM’s current union (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.). The session start then waits on a join approval.

It is delivered like any approval request. It lists:

  • the joining project;
  • the projects already in the VM;
  • each finding.

The answer is a Device Config State Change (5019) event. It records:

An approval is cached on that pair. So the next start with the same policy and the same union doesn’t ask again. Any change to either asks again.

A denial, or no answer before the request expires, refuses the start.

The set a join approval records holds the sessions in the VM and the waiting wb process. The request expires:

  • when that wb exits;
  • when the VM’s set of sessions changes before the answer.

The expiry is a Device Config State Change (5019) event, with the rule approval-expired, and the start is refused.

Approval requests are delivered:

They are never written to the terminal stream of an agent session, which the guest controls.

Guest-influenced text in a request is stripped of control and escape sequences wherever it is shown.

Status: Draft