S10-01 - Libraries
Purpose: The libraries and programs Wraith Box uses, and their licenses.
Design
Section titled “Design”Permissive licenses only (Apache-2.0, MIT, BSD, ISC), or a public domain dedication such as SQLite’s. No copyleft and no source-available licenses. This includes programs Wraith Box ships or downloads and runs, such as a VMM on Linux.
| Need | Choice |
|---|---|
| Userspace TCP/IP | gVisor pkg/tcpip, from gVisor’s go branch (Apache-2.0) |
| RPC | protobuf + gRPC: google.golang.org/grpc (Apache-2.0) and google.golang.org/protobuf (BSD-3-Clause) in Go, grpc-swift 2 with grpc-swift-protobuf and swift-protobuf (all Apache-2.0) in Swift, Grpc.Net when .NET arrives. Code generated with buf (Apache-2.0) |
| DHCP server | Wraith Box’s own Go code in internal/netd/dhcp. It reads the few fields and options the server needs and rejects the rest. A library would parse every option the guest sends and add modules to the dependency set |
| DNS server | Wraith Box’s own Go code in internal/netd/dns. It reads the one-question subset of 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., “Messages”, and writes its responses itself. golang.org/x/net/dns/dnsmessage (BSD-3-Clause) is the independent decoder in its tests and fuzz target |
| OpenPGP signature check | Wraith Box’s own Go code in internal/releasecheck/pgpsig, over crypto/rsa and crypto/sha256/sha512, in wb-release-check only. It reads one form: one armored v4 RSA binary signature with SHA-256 or SHA-512, by the compiled-in key (S14-01-installS14-01-install: InstallHow the image build downloads Claude Code on the host, checks it, and installs it in the guest image, and which version a guest runs., “Check”), and refuses the rest. An OpenPGP library would parse every packet and algorithm, and add modules to the dependency set (I676I676 (closed): wb-release-check and the agent interface: check a Claude Code release's signed manifestPackage IMG.7 of docs/implementation-plan.md, part 1 of 5 (IMG.7a).) |
| TLS/HTTP proxying | Go standard library (crypto/tls, net/http, httputil), golang.org/x/net/http2 |
| SSH client (image build) | golang.org/x/crypto/ssh (BSD-3-Clause), in wb-build-ssh only (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.) |
| TLS record and ClientHello parsing | golang.org/x/crypto/cryptobyte (BSD-3-Clause), in wb-proxyd (internal/proxyd/tlsparse), for the first-byte and pass relay checks of 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. and S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes. |
| Java trust store (PKCS12) | software.sslmate.com/src/go-pkcs12 (BSD-3-Clause), in wb-guestd (internal/guestd/trust), to write the passwordless trust store of S09-08-guest-trustS09-08-guest-trust: Guest TrustHow wb-guestd makes the guest's clients trust the VM's CAs., “Files” |
| PTY | creack/pty (Unix), ConPTY through golang.org/x/sys/windows; golang.org/x/term |
| Windows host APIs | golang.org/x/sys/windows; Microsoft’s Go libraries for HCS and named pipes / Hyper-V sockets (MIT) |
| Linux host APIs | golang.org/x/sys/unix (KVM device checks, Landlock, seccomp, vsock); a pure-Go D-Bus client (Secret Service, notifications) |
| Linux VMM | decided by spike X10-linux-hypervisorX10-linux-hypervisor: Linux VMM and packet transportPick a permissively licensed VMM over KVM that supports vsock, save/restore, copy-on-write disks, and a virtual TPM (for Windows guests), and a way to deliver guest Ethernet frames to wb-netd as an unprivileged user (…; must be permissively licensed |
| TPM | a Go TPM 2.0 library (Linux); CNG through golang.org/x/sys/windows (Windows) |
| Keychain / Secure Enclave from Go | a thin cgo shim over Security.framework, owned by this repo, linked on macOS only into the processes that S15-least-privilegeS15-least-privilege: Least Privilege on the HostThe security design for SEC12-least-privilege: which rights Wraith Box takes on the host, where credentials are held, and how each host process gets only the credentials it needs, for only as long as it needs them. declares store access for |
| State | SQLite (public domain), through the cgo-free Go driver modernc.org/sqlite (BSD-3-Clause). Every OS builds it the same way |
| Settings files | TOML, read with github.com/pelletier/go-toml/v2 (MIT) with unknown keys refused (S17-install-and-upgradeS17-install-and-upgrade: Install, Downloads and UpgradesBuild, install, upgrade and remove a Wraith Box bundle, move its stored data to a new version, and download what an image build needs from the internet.) |
| Vulnerability data | OSV API |
| Network policy schema | OpenShell’s network_policies schema, version 1, with the keys of OpenShell v0.1.2 (commit 6648bd0c, Apache-2.0), implemented in Go by this repo. YAML is read with go.yaml.in/yaml/v3 (MIT and Apache-2.0) into a node tree, bounded in size, depth and nodes, with no anchors or aliases (S09-01-policy-filesS09-01-policy-files: Policy FilesWhere policy is written, the network policy schema Wraith Box accepts, how the prover sees it, and narrowing by program and project., “Loading”) |
| Policy prover | OpenShell’s standalone openshell-prover 0.1.2 release binary (“Policy prover” below) |
| Approval risk check | Go code in wb-hostd (“Approval risk check” below) |
| Dependency-gate API | OpenShell’s supervisor_middleware.proto and extension.proto (“Dependency-gate API” below) |
| Audit event schema | OCSF 1.8.0 (ocsf-schema commit 6fa6499a, Apache-2.0), the version OpenShell v0.1.2 emits |
| Guest confinement (macOS guest) | Seatbelt profiles applied by wb-guestd; a Network Extension system extension in Swift (S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection.) |
| Image distribution (later) | go-containerregistry |
Policy prover
Section titled “Policy prover”The policy prover is OpenShell’s standalone openshell-prover 0.1.2
release binary. It is Apache-2.0, with Z3 linked in statically under
MIT. wb-prover runs it through wb-launcher (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.,
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.).
At vendoring or release time, the build:
- pins the archive’s SHA-256;
- checks the release’s build attestation;
- extracts only the one regular file
openshell-prover, with no links and no other paths; - re-signs it with Wraith Box’s signing identity;
- installs it in the bundle;
- pins the SHA-256 of that binary, which
wb-proverchecks before each run.
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… recorded the archive hash for macOS arm64 only.
v0.1.2 has builds for macOS arm64 and Linux (x86-64 and arm64), and
none for Windows. So the boundary check fails closed on a Windows host
until one exists. That refuses every session start there, not only
wb trust (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., I91I91 (open): Windows build of openshell-prover for the wb trust boundary checkFrom the PR #89 security review (X24-openshell-artifacts), finding 12.).
Approval risk check
Section titled “Approval risk check”The approval risk check is Go code in wb-hostd
(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.).
It follows the four categories and names of OpenShell’s proposal risk check at v0.1.2, and adds Wraith Box’s own checks. OpenShell’s cases are its tests.
Dependency-gate API
Section titled “Dependency-gate API”The dependency-gate API is OpenShell’s supervisor_middleware.proto
and extension.proto: package openshell.middleware.v1, OpenShell
v0.1.2, Apache-2.0.
They are copied with their license headers. Go code is generated with
buf. The import paths are set in the generation config, because the
files set no go_package. The files follow OpenShell’s buf lint
exceptions, not this repo’s rules.
Decisions
Section titled “Decisions”Approval risk check after OpenShell’s
Section titled “Approval risk check after OpenShell’s”- Decided: the maintainer decided this on I35I35 (closed): X24-openshell-artifacts: OpenShell artifactsX24-openshell-artifacts (added to S11-verification-and-spikes in #14) (B35-openshell-artifactsB35-openshell-artifacts: Do the OpenShell parts the specs reuse exist as assumed?Yes, with conditions.).
Status: Draft