Skip to content

feat(start-os): improve StartOS service container isolation, and limit installed services - #4794

Open
helix-red wants to merge 49 commits into
masterfrom
feat/service-container-isolation
Open

helix-red wants to merge 49 commits into
masterfrom
feat/service-container-isolation

Conversation

@helix-red

@helix-red helix-red commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

getContainerIp is kept for the calling service's own address. The packageId argument is removed (dr-bonez). A request carrying packageId is rejected. lnd-startos, coturn-startos, jitsi-startos and nextcloud-talk-hpb-startos call it without one, for their own certificate SANs and TURN relay address, so they keep working without a republish. Each container's address is fixed for the life of its installation.

Summary

Each service container gets its own addresses and its own host id range. Containers can no longer reach each other directly, and a server can hold at most 1024 installed services.

  • Container slots. Each installed package holds a slot from 0 to 1023, stored on its package entry. A slot is assigned at first install and freed only by uninstall. The slot determines the container's addresses (172.16.0.3 + slot, fd00:3::(3 + slot)), its veth (lxc-svc-<slot>), and its host id range ((slot + 1) << 16, 65536 ids). startd creates the container's user namespace owned by the container's own host root uid, not host root. The server keeps 172.16.0.1/fd00:3::1 for forwards, the TLS proxy, DNS and Tor, and 172.16.0.2/fd00:3::2 for its own listeners.
  • Install limit. A 1025th install or restore fails with "This server already has the maximum of 1024 services installed" before the package is downloaded or a slot is allocated. Updates to an installed package are unaffected.
  • Container networking. LXC creates a routed veth with a static /32 and /128 per container. These attach to a port-less lxcbr0 that startd creates and addresses. lxc-net, its dnsmasq DHCP and IPv6 router advertisements are retired, and postinst masks lxc-net.service. Containers resolve DNS through 172.16.0.1, which startd writes to each container's resolv.conf. Container-to-container traffic is dropped in both families: the forward chain's egress accept excludes veth-to-veth, and every forward-port/forward-port6 accept now requires ct status dnat. A container reaches another service only through a StartOS forward on 172.16.0.1:<port>, the same path dependencies already used.
  • StartOS UI listener. Once the network controller is running, startd's web server binds only 172.16.0.2:80 and [fd00:3::2]:80. LAN, WAN, localhost (127.0.0.1/::1) and containers reach it through the DNAT forwards and TLS proxy that services use. Setup, diagnostics and early init still bind the wildcard. net/ingress.rs recovers the destination the client originally dialed (SO_ORIGINAL_DST), so gateway lookup and RequestOrigin behave as before. Two policy-routing changes support this: tcp_fwmark_accept=1, and an unmarked-reply rule from the OS listen addresses that looks up main. Source rules now also require iif lo, so a forwarded packet that spoofs a server address cannot match them.
  • StartOS UI plain HTTP. The UI's private plain-HTTP addresses (LAN IPs, .local, private domains) no longer need the feat(start-os): make private HTTP addresses explicit per-address opt-ins #4680 opt-in on insecure gateways. They are on by default and can each be switched off, so downloading the Root CA over LAN HTTP keeps working. Plain HTTP for the UI is never public, and the server's public IP is served only on 443.
  • IPv6 link-local. These addresses are no longer listed or served for the UI or for services.
  • Plain service ports over IPv6. A service's non-TLS port is now DNAT'd on any enabled IPv6 address row, including the server's ULA, not only its GUA. Plain ports are also forwarded on loopback.
  • Removed. getContainerIp's packageId argument (rejected by the host when an older SDK still sends it), the OS SOCKS proxy on 1080 with its socks-listen config key, and the launching service intranet init phase. StartOS's own HTTP and WebSocket clients now connect directly and use Tor only for .onion hosts, through the bridge address of the tor package's socks binding (internal port 9050, a tor-startos contract). StartOS follows that binding in the database. While Tor has not bound it, onion names are refused rather than sent to DNS. is_onion recognizes an onion regardless of ASCII case or a final root dot, and start-registry's proxy selection reuses it. .local names resolve through Avahi and other names through libc. The connection logic moved from net/socks.rs to net/dial.rs.
  • Packaging guide. The SDK guide no longer says that an unbound listener, or a port gated by proxy.auth, is reachable by other services dialing a container directly. A port a service does not bind is unreachable from other services. proxy.auth covers every path into its port. Loopback listening remains the advice for a daemon only its own container uses. Guidance that is about the forwards stays: bridge-only ports, readable exported interfaces, dependency mounts and first login.
  • Shared volumes. Local shared volumes store ids as the container sees them (0-based). Each consumer attaches through its own id map (open_tree_attr with MOUNT_ATTR_IDMAP), and external-partition sources are no longer idmapped at the source. CIFS shared volumes are the exception described under Decisions.

Implementation diff: +1293 / −814 lines in 72 files (excludes lockfiles, tests, docs, release notes, and changelog). The UI mock patch and fixtures count as test data. Generated TS bindings, i18n.yaml, and the build.mk line that adds the new script test count as implementation.

Data model

Approach

  • UI behind forwards. The UI goes through the same DNAT forwards and TLS proxy that services use, rather than keeping a wildcard listener alongside them. That makes the forward rules the one place that decides which addresses reach the UI. When the network controller is dropped, startd returns to the wildcard listener.
  • Routing and namespaces from LXC. Each container's addressing and routes come from LXC's veth.mode = router with static addresses, and startd no longer waits on a DHCP or SLAAC lease. LxcContainer::ip()/ipv6() are now plain functions of the slot. The user namespace comes from the existing unshare-userns helper, extended with an owner uid that it switches to before unsharing. LXC joins that namespace through lxc.namespace.share.user, so the namespace is owned by the container's root uid.
  • Backup containers. An isolated backup container shares the live container's user and network namespaces. It keeps its own filesystem and blocked shared-volume mounts. The cross-reviewer proposed this so the backup container does not try to create a second lxc-svc-<slot> veth.
  • One owner for slots. lxc::slot owns every per-container value: addresses, veth name, id map, host root, and the legacy-id conversion. All previous users of BASE_IDMAP and 10.0.3.1 now read it.

Decisions

These were settled in the conversation and are listed here for their consequences:

  • Address plan. The slot pool, the 172.16.0.0/16 and fd00:3::/64 plan, and the reserved .1 and .2 addresses were approved. On a LAN that uses 172.16.0.0/24, the server now holds .1 and .2 locally, and containers hold .3 through 172.16.4.2. LAN hosts at those addresses, typically including the router at .1, become unreachable from the server. The previous 10.0.3.0/24 had the same hazard for a much rarer range.
  • OS SOCKS proxy. Removing the proxy on 1080 means a package configured to use 10.0.3.1:1080 loses it. The changelog directs services to the Tor service's proxy.
  • .startos DNS is removed. StartOS no longer answers <package>.startos, <package>.embassy or startos; those queries are forwarded upstream like any other name. The resolver still identifies the requesting container by source address. Legacy 0.3.x packages that reach a dependency at <dependency>.embassy lose that path, and container isolation already blocked the direct connection the name led to. The maintainer accepted this: legacy packages are expected to break, provided they can still be updated to their 0.4 versions. Nothing in the install and update path uses these names. The only remaining .embassy use is a SAN in legacy certificates.
  • start-registry's default Tor proxy is now socks5h://127.0.0.1:9050, Tor's standard local port, in place of the removed tor.startos:9050.

Implementation choices the maintainer may want to weigh:

  • CIFS shared volumes appear as nobody inside every container. CIFS cannot take an idmapped mount, so these are now mounted with uid=0,gid=0 and file_mode=0666,dir_mode=0777. Container root no longer owns them. Reads and writes still work through the modes, but chown fails and any ownership check a service makes inside the volume will fail. The alternative is a separate CIFS mount per consumer, with uid/gid set to that consumer's host root. It would keep root ownership at the cost of one SMB session per consumer.
  • NVIDIA container overlay. It is rebuilt root-owned as container-overlay-root.squashfs, the old file is deleted, and its files appear as nobody in containers. The libraries are only read, so the expected cost is nothing beyond the one-time rebuild.
  • Subordinate ids for other host users. postinst writes root:65536:67108864 to /etc/subuid and /etc/subgid. Any other user's range that overlaps it, kiosk and start9 on a stock install, moves above it, and SUB_UID_MIN/SUB_GID_MIN are raised to 67174400. Rootless containers those users created under their old ranges would lose ownership. StartOS does not create any.
  • Neighbour table thresholds. gc_thresh1/2/3 are raised to 2048/4096/8192 for both families, because each container adds entries to the shared table. These values were chosen, not measured.

Existing state and rollout

  • The changes ship after 0.4.3, through the 0.4.3 migration at revision 5.
  • The OS image must carry the rebuilt container rootfs. It drops the systemd-networkd .network file and the static nameserver 10.0.3.1, because LXC now configures eth0.
  • On first boot after the update:
    • Shared volumes are mounted on the host without an idmap, and each consumer's slot map is applied when a volume is attached (fix(storage): back up shared volumes with their stored container ids #4806, this PR's base). Backups hold container ids and restore copies them straight back. Master's migrate_local_ownership converts legacy owners.
    • Each service's journal directory is rebased the first time its container starts, if the directory is still owned by 100000.
    • Package data volumes need no conversion, because they were already stored 0-based behind an idmapped mount.
  • Downgrade is not fully reversible. down removes containerSlot, but converted shared volumes and journal directories stay converted. Under 0.4.2.x, consumers would see those shared-volume files as unowned.
  • Neighbors. ci: build the container-runtime rootfs natively, upload compressed artifacts unzipped, ship the Pi image gzipped #4795 (native container-runtime rootfs build) merged first. This branch merges cleanly over it.

Testing

  • Unit and script tests.
    • make start-core-test on 341686f: 2007 passed, and make generated-artifacts-check is clean, including new tests that .startos names are forwarded and that StartOS's Tor endpoint follows the tor binding as it appears and disappears. make format-check is clean. Namespace-dependent tests skip in the build container.
    • TS suites, on an earlier head before the OS-listener commits: start-core jest 509, SDK 393, container-runtime 39, and npm run check:ui 282 passed. These results are historical. This PR's own TS changes are unchanged since then, but later master merges brought in other TS changes. On the current head, the TS suites run only in CI.
    • The subuid-config, dns-config and forward-transport script tests passed.
    • The full start-os-scripts-test suite cannot run in the build environment, which lacks grub-common.
  • Network-namespace tests, run natively:
    • Original-destination recovery works, including for 127.0.0.1 and ::1 forwards.
    • The policy-routing model passes with the new OS-listen rules. On f701da5 it also passes with fix(start-os): keep pushed routes and IPv6-only VPNs from leaking past the outbound gateway #4844's per-destination rule 50; the OS-listen rules still sit at priority 60 with iif lo. Dropping the IPv4 OS-listen rule makes it fail os-listen-reply-unmarked, as intended.
    • A two-container check with the real forward scripts: the old script accepted a direct connection to the other container's port 8332, and the new one times out. A forwarded connection through 172.16.0.1 still connects.
  • VM test on head ba09511, before the review round. A production 0.4.2.1 VM was upgraded in a chroot with this branch's startbox, forward scripts and postinst, plus a container rootfs rebuilt on the guest. The container image could not be built through Helix's build cache, which has no loop devices (helix-startos-internal#160). Results:
  • Not run on a VM: the review-round changes in 3a1e6d7.
    • The backup container that shares the live container's namespaces is covered only by a config-rendering test.
    • Moving the shared-volume conversion into storage preparation has no live test.
    • ACL translation on a real filesystem: the byte-level rewrite test always runs, but the filesystem round trip skips wherever ids of 100000 and above are unmapped, as in the build container.
  • Not exercised at all: StartOS reaching an onion through the tor package's binding on a real server, a CIFS shared volume, the NVIDIA overlay, and any of the four packages that call getContainerIp.
  • CI: on 341686f, every check that ran passed: start-core tests and man pages, bindings and MCP catalog, SDK, runtime and script tests, formatting, Prettier, the x86_64, aarch64 and riscv64 builds, the macOS start-cli builds (which confirm the duplicate-stub fix), the container runtimes, and every StartOS image build with the x86_64 and aarch64 migration images. Deploy and publish jobs were skipped.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

…d routed address

Each installed package holds a container slot (0-1023) that derives its
addresses on 172.16.0.0/16 and fd00:3::/64, its host id range starting at
(slot + 1) << 16, and the owner of its user namespace. Installing a 1025th
service fails before anything is allocated.

Containers attach over routed veths to a port-less lxcbr0 that holds the
server's container-network addresses, replacing lxc-net and DHCP. Container
egress is accepted only toward non-container destinations, so containers can
no longer reach each other directly. getContainerIp is removed.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
postinst masks lxc-net, drops its DHCP configuration, widens root's subordinate
ids to every slot's range and raises the shared neighbour-table limits. The
container image no longer bakes a nameserver or networkd DHCP; startd writes
each container's resolv.conf. getContainerIp leaves the SDK, the shared effects
interface and the container runtime.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…format

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…inerIp

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	projects/start-os/build/tests/dns-config-test.sh
#	shared-libs/crates/start-core/src/net/vhost.rs
startd's own HTTP and websocket clients now send onions to the Tor service's
SOCKS proxy and connect to everything else directly, keeping mDNS resolution
for .local names. The 0.4.3 slot assignment keeps existing slots, and its
migration revision is bumped so servers already on 0.4.3 run it.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
… id span

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
The OS's own binding now targets OS_LISTEN_IP/OS_LISTEN_IPV6 (172.16.0.2,
fd00:3::2) instead of loopback, so its plain port reaches the UI through
the same DNAT forwards a service uses and the TLS proxy dials 172.16.0.2:80.

- lxc::slot::is_os_listen owns the predicate. Interface observation omits
  those addresses, so they never become address rows, vhost listeners or
  DNS bindings, and the lxcbr0 bridge row stays HOST_IP. RequestOrigin
  treats a direct dial of them as internal, like HOST_IP.
- An OS listen backend never preserves the client source: its SYN-ACK is
  generated locally and never reaches the divert rule.
- An OS listen forward leaves loopback untranslated, so local clients keep
  their loopback peer (the localhost signing identity).
- NetController::init brings up the container network first, so the
  address exists before forwards target it on every path (init, restart,
  setup, restore); the separate init phase is gone.
- Policy routing: a priority-60 `from <OS listen> iif lo fwmark 0 lookup
  main` rule per family gives the unmarked reply a route under a kill
  switch; every source rule now matches `iif lo` so a forwarded packet
  claiming that source keeps its service's selection. policy-routing.md
  states the os-listen-reply-unmarked invariant and the model checks it,
  including the spoofed-source cases. The gateway coordinator enables
  tcp_fwmark_accept so accepted sockets keep their arrival mark after DNAT.
- net/ingress.rs recovers the pre-DNAT destination with SO_ORIGINAL_DST for
  connections whose socket address is an OS listen address, so auth
  identities and RequestOrigin see the dialed address and gateway. A
  connection dialed to the OS listen address directly (the TLS proxy's
  relay, identified through PROXY_ORIGINS, or a container) is accepted
  with its real local address. Unlike #4553, only a connection whose
  original destination cannot be read is rejected: treating it as the
  listen address would classify untranslated gateway traffic as internal.
  The accept loop drops such a connection and keeps accepting.
  Gateway lookup matches a link-local address only within its zone.
- Cleanup: one set_default_keepalive helper replaces four copies.

The web listener still binds the port-80 wildcard; narrowing it to
loopback and the OS listen addresses is held for a decision on plain-HTTP
UI access (see PR discussion).

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Once the network controller exists, startd's web listener binds only
OS_LISTEN_IP:80 and [OS_LISTEN_IPV6]:80. Loopback, LAN and public addresses
reach the UI through the same DNAT forwards as a service; setup, diagnostics
and early initialization keep the dual-stack wildcard.

- WildcardListener switches between the wildcard and the OS listen
  addresses, binding the replacement (SO_REUSEPORT) before releasing the
  current sockets. The NetController narrows it and a guard it owns returns
  it to the wildcard when it drops; both diagnostic fallbacks also revert.
- HostOwner names whose host an address derivation runs for. The server's
  own host (the StartOS UI) skips the #4680 insecure-HTTP consent for its
  private plain-HTTP rows, so the Root CA download over HTTP on the LAN
  works by default. Public exposure is unchanged: server_ui keeps
  `secure: None`, so no public plain-HTTP row, forward source or pinhole
  exists. An explicit operator disable still wins. The owner is threaded
  from the caller (package id, HostApiKind, all_hosts) rather than
  persisted, so no migration and nothing a service can set.
- Loopback forwards to the OS listen address: 127.0.0.1:80 and [::1]:80 are
  DNAT'd in the output chain. forward-port/forward-port6 no longer
  masquerade a forward whose target the host holds, so the UI sees the
  client's own loopback source; ingress recovery restores the loopback
  destination, keeping the `localhost` signing identity.
- v6 plain-port forwards cover every IPv6 address but link-local (whose
  zone a DNAT drops): GUA as before, plus ULA, loopback and the bridge
  address, for services as well as the UI.

Tests: the server host's private plain rows enabled without consent, an
explicit disable kept, nothing public, a package host unchanged; the
listener narrows and returns; a netns test runs the real forward scripts
for 127.0.0.1 and ::1 and checks the recovered destination, unmasqueraded
peer, internal origin and localhost identity.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	projects/start-os/build.mk
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor Author

Merged origin/master (b67bf47) in 2bcfc08. The only conflict was the start-os-scripts-test prerequisite list in projects/start-os/build.mk: master added start-os-kbuild-test and this branch added subuid-config-test.sh, so the merge keeps both. make start-core-test (1872 passed) and the subuid script test pass on the merged tree. A separate commit, cab3217, replaces a stale 10.0.3.1:9050 comment in net/forward.rs.

Address-row derivation skips IPv6 link-local addresses for every host, so
the StartOS UI and service interfaces list the same addresses and nothing
downstream serves one: the TLS proxy no longer binds them for a public
gateway, and plain-port v6 forwards no longer need to exclude them.
Gateway zone handling for accepted connections and DNS upstreams is
unrelated to address rows and stays.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red
helix-red marked this pull request as ready for review November 19, 2026 05:49

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested on ba095117b9518874d0aa65419449340cbdaedcfa. The head's committer is @helix-red, and git merge-tree --write-tree origin/master HEAD was clean.

  1. [P1] Plain-port forwards bypass direct-container isolation. net_controller.rs:48–50 merely excludes cross-veth traffic from the egress accept; it does not drop it. The later accepts in build/lib/scripts/forward-port:117 and forward-port6:67 match the target IP and internal port without requiring DNAT. If B binds TCP 8332, A can still connect directly to B's slot address on 8332, in either family. The proposal requires ct status dnat in both scripts and extends their regression coverage. Connections through StartOS continue to qualify; direct container-address connections do not.

  2. [P1] Isolated backups collide with the live container's veth. service/persistent_container.rs:140–155 gives the backup container the same slot as its normal container. service/transition/backup.rs:96–97 invokes this path for packages declaring shared volumes while the normal LXC remains alive: stopping its main procedure does not destroy that LXC. Both therefore attempt to create lxc-svc-<slot>, and the backup cannot start. The proposal shares the original service's user and network namespaces, retaining the backup's separate filesystem and blocked shared-volume attachments. It creates neither another veth nor competing routes.

  3. [P1] Shared-volume ownership conversion happens after service initialization. The conversion in version/v0_4_3.rs:38–48 runs through version::post_init, but RpcContext::cleanup_and_initialize has already initialized services, and the shared-volume observer starts before post-init too. Existing legacy owners are unmapped through the new attachment mapping until conversion. Initialization hooks accessing private shared-volume contents can fail and remain failed after the later chown; successful consumers can also be writing during conversion. The proposal moves this pending migration into quiescent storage preparation, after LXC GC/subvolume preparation and before services or observers start, retaining the existing migration todo for retry ownership.

  4. [P2] Ownership conversion strands named ACL grants. lxc/slot.rs:169–175 translates inode UID/GID but leaves access/default ACL identities unchanged. A grant for container UID 1000 remains raw UID 101000 instead of becoming 1000, and the consumer's new mapping no longer recognizes it. Legacy shared-volume restore uses the same helper and has the same regression. The proposal translates both ACL attributes through the existing ID conversion owner and adds an access/default ACL regression.

  5. [P2] Onion connections assume Tor owns bridge port 9050. net/dial.rs:17 changes the previous internal tor.startos:9050 endpoint to HOST_IP:9050. Bridge ports can be occupied by another binding or explicitly reassigned; Tor's preferred external port is not guaranteed. A valid Tor installation on another assigned port consequently stops working for StartOS HTTP/WebSocket onion connections. The proposal preserves the host's existing direct internal Tor endpoint, independent of bridge assignment, and makes the proxy-route test assert that endpoint. It also removes the stale claim about port 9050 from net/forward.rs.

Proposed changes: ba09511...proposal/4794

Static review only: no builds, tests, typechecks, lint, formatting commands or VM runs. The proposal and its regression additions are unexecuted; verification belongs to the implementer. Existing CI still has pending jobs, and this verdict does not wait for them.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

- Plain-port forward accept rules require `ct status dnat`, so a container
  reaches another container's port only through StartOS, never by dialing
  its slot address (both families; script test asserts it).
- An isolated backup container shares the live service container's user
  and network namespaces instead of creating a second veth for the same
  slot; its filesystem and blocked shared-volume attachments stay separate.
- Legacy shared-volume id conversion runs in quiescent storage preparation,
  before shared-volume observers and services start. The 0.4.3 migration
  todo still gates it, so a failed conversion retries on the next boot.
- Id conversion also rebases named access/default POSIX ACL entries.
- Onion dialing uses Tor's internal endpoint `tor.startos:9050` rather than
  a bridge port another binding may hold or the operator may reassign.

Adapted from the cross-review proposal; the ACL coverage is split into a
pure byte-level test and a filesystem round trip that skips where the
legacy ids are unmapped.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor Author

Adopted all five points in 3a1e6d7. I applied the proposal diff and committed it myself, with one change to the ACL tests.

  1. Forwards bypassing isolation: forward-port and forward-port6 accept rules now require ct status dnat. In a network namespace with two "containers" and the real script, the old script accepted a direct connection to the other container's port 8332; the new one times out. A forwarded connection through 172.16.0.1 still connects. forward-transport-test.sh asserts the rule.
  2. Backup container veth collision: the isolated backup container shares the live container's user and network namespaces. It creates no second veth or routes, and keeps its own filesystem and blocked shared-volume mounts. This is covered by the config-rendering test only; a shared-netns start has not been run on a real LXC host yet.
  3. Conversion timing: the shared-volume id conversion now runs during storage preparation, after LXC cleanup and before services or the shared-volume watcher start. It is still gated by the existing 0.4.3 migration todo, so a failure retries on the next boot. It only rewrites ids in the legacy range, so a rerun is a no-op.
  4. ACLs: named user and group entries in access and default ACLs are translated. The proposal's filesystem test fails with EINVAL wherever the legacy ids aren't mapped, which includes the build container. Coverage is therefore a byte-level ACL rewrite test that runs everywhere, plus a filesystem round trip that skips when ids 100000+ aren't mapped.
  5. Tor endpoint: onions dial tor.startos:9050, the endpoint master used, independent of Tor's bridge-port assignment. The proxy-route test asserts it, and the stale port-9050 comment in net/forward.rs is gone.

Tests: make start-core-test passed (1876), make start-core-format is clean, forward-transport-test.sh passed, and I ran the namespace check described in point 1. The head merges cleanly with master.

helix-white
helix-white previously approved these changes Nov 19, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 3a1e6d7815ed9e96498aae6836f3a604624135a3.

Rechecked the changes since my previous review and compared the adopted implementation against proposal/4794. All five findings are addressed: both forwarding scripts require DNAT; isolated backups reuse the live service's user/network namespaces without recreating its veth; shared-volume ownership conversion precedes services and observers; access/default ACL identities use the same conversion owner; and onion connections retain Tor's internal endpoint rather than assuming an assigned bridge port.

The ACL-test adjustment is reasonable: the byte-level production-helper test remains unconditional on Linux, with the filesystem round trip conditional on the fixture being supported. The head's committer is @helix-red, and the merge-tree check against current origin/master is clean. No further blocking correctness findings.

Static re-review only; no builds or tests run. The author reports 1876 passing core tests, passing forwarding-script coverage, and a real-script network-namespace isolation check. A real LXC shared-namespace backup start remains unverified, as the author disclosed; CI is still pending.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 19, 2026 06:34
@helix-red
helix-red dismissed helix-white’s stale review November 19, 2026 06:34

Dismissed by Helix: the changes require a substantive PR brief update. The new head requires DNAT for container-port admission, makes isolated backups share the live service's user/network namespaces, moves ownership conversion before consumers start, converts named ACL identities, and routes Tor through its internal endpoint instead of a fixed bridge port. These change exposure, backup lifecycle, migration rollout and routing; the substantive brief must reflect those facts.

…ner-isolation

Integrates #4793 (unified volume mapping, shared-volume revocation) with
per-slot container ids:

- lxc::service_filesystem takes the container's base idmap (its slot's)
  before package remaps; BASE_IDMAP is gone. unshifted_filesystem removes
  the legacy shared offset (LEGACY_HOST_ROOT).
- Shared-volume sources stay unshifted; each consumer attaches through its
  own slot idmap, applied when the source is staged (mount_source).
- Legacy shared-volume ownership converts with master's crash-safe
  migrate_local_ownership in storage preparation, detecting the legacy
  range.
- Volume restores keep rebase_legacy_ids, which accepts both legacy
  offset backups and container-id backups.
- SharedCifs stays root-owned; the doc combines both rationales.
- open_tree_clone_fd gains master's recursive flag beside the idmapped
  clone.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red
helix-red dismissed helix-white’s stale review November 25, 2026 01:15

Dismissed by Helix: the changes require a substantive PR brief update. Merge 36bcc29 replaces branch-specific schemas with master's: generated GetContainerIpParams re-advertises packageId, its return becomes nullable, and ContainerSlot plus PackageDataEntry.containerSlot disappear. Rust still rejects selectors and requires slots, while existing TypeScript callers require the removed export and non-null return. A correct brief must acknowledge this broken generated API/data-model contract rather than claim consistent self-only bindings and a required projected slot field.

…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	shared-libs/crates/start-core/src/net/gateway.rs
#	shared-libs/crates/start-core/src/net/net_controller.rs
#	shared-libs/crates/start-core/src/net/vhost.rs
@helix-red

Copy link
Copy Markdown
Contributor Author

Two fixes since 402633a:

On 3fa205d, make start-core-test passes (1988 tests), cargo fmt --check is clean and make generated-artifacts-check is clean.

@helix-red

Copy link
Copy Markdown
Contributor Author

This review is of 402633a. The current head, 3fa205d, already addresses both points:

  • [P1] Bindings: da5d88f regenerates types.schemas.ts and rpc/effects.schemas.ts with make start-core-ts-bindings from this branch's combined Rust and generator tree, as the review asked. I didn't take the hand-edited proposal f3d28f6cf. The regenerated files restore ContainerSlot, the required PackageDataEntry.containerSlot, the self-only GetContainerIpParams without packageId, and the non-null _RETURN. Compared with the proposal, they differ only in literal numbering and in how GetContainerIpParams is emitted. The generator emits a wire(...) codec rather than master's .default(() => null) form, because this branch's package_id field is #[serde(default, skip_serializing)] and the input and output shapes therefore differ. That is the generator's real output for this struct. The start-core TS module builds, and make generated-artifacts-check is clean.
  • Merge blocker: 3fa205d merges origin/master through fix(start-os): send ACME orders and WAN-probe lookups through their own gateway #4845 and fix(container-runtime): take schemas from the sdk's start-core copy #4893, resolving the gateway.rs, net_controller.rs and vhost.rs conflicts. Both sides' imports are kept, and the port-map fixture uses AcmeIssuance { provider, gateway } with 172.16.0.3:443. GitHub reports the PR as MERGEABLE.

On 3fa205d, make start-core-test passes (1988 tests), cargo fmt --check is clean and the generated-artifacts check is clean. This was past the last cross-review round, so I'm handing off to @dr-bonez now. CI is running on 3fa205d.

@helix-red
helix-red requested review from dr-bonez and removed request for dr-bonez November 25, 2026 01:43

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 3fa205d5e6c9da8de911022b70898b8d5d041ac0.

Both findings from my previous review are addressed:

  • da5d88fd8 regenerates the branch-specific schemas: ContainerSlot and the required PackageDataEntry.containerSlot are restored, both GetContainerIpParams projections omit packageId, and the effect returns a non-null string. These agree with the unchanged Rust owners, types.ts exports and GetContainerIp helper. The generated callback codec is an acceptable variation from the handwritten proposal; restoring the contracts, not its exact layout, was the requirement.
  • 3fa205d5e resolves the three networking conflicts without dropping either side's production imports. The port-map fixture retains the slot address and master's provider-plus-gateway AcmeIssuance. I traced the combined binding-to-issuance, gateway DNS and WAN-probe callers; the inherited gateway-scoped transport remains intact alongside this PR's routing and isolation changes.

I compared the complete PR-owned patches and inspected the merge resolution. No further correctness regression found. The revision-5 migration, slot/isolation, shared-storage and mapped-Tor owners remain unchanged; the earlier guide corrections are retained. This head merges cleanly with current master d3f3e0b42.

Static review only: no builds, tests, typechecks, linters, formatters or VMs were run. The author reports 1988 core tests and clean generated-artifact checks on this head. Current-head core/manpage, generated-binding/catalog, SDK/runtime/script and architecture checks are still pending or running; this is not an all-green CI assertion. The native verification gaps disclosed in the description remain.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 25, 2026 01:47
@helix-red
helix-red dismissed helix-white’s stale review November 25, 2026 01:49

Dismissed by Helix: the changes require a substantive PR brief update. da5d88f restores ContainerSlot and required PackageDataEntry.containerSlot, removes packageId from the generated GetContainerIpParams projections, and changes the effect return from nullable to non-null. Unlike reviewed head 402633a, these schemas agree with the Rust owners and existing TypeScript callers. A correct substantive explanation must now describe the restored supported API/data-model contract rather than the missing and mismatched bindings. The networking merge preserves isolation semantics.

…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	projects/start-sdk/docs/src/interfaces.md
#	projects/start-sdk/docs/src/outbound-networking.md
#	projects/start-sdk/docs/src/service-to-service.md
#	projects/start-sdk/lib/StartSdk.ts
@helix-red

Copy link
Copy Markdown
Contributor Author

Merged origin/master (9fd57a3, #4900 startos.internal, and #4868) in 84a28a7. The conflicts were only in the SDK guide and one SDK doc comment:

  • StartSdk.ts and the interfaces.md retire-binding paragraph: master's startos.internal:<port> replaces this branch's 172.16.0.1:<port>.
  • interfaces.md addresses list: startos.internal and sdk.getOsIp are the bridge. The sdk.getContainerIp bullet stays, and master's hardcoded 10.0.3.1 is dropped. The SAN example gets 'startos.internal' and keeps this branch's getContainerIp(...).once().
  • service-to-service.md intro: it keeps this PR's facts: separate containers on routed veths, no direct container-to-container traffic. It adds master's startos.internal naming and the guidance on IP-only settings. The other two hunks take master's startos.internal:<port> wording.
  • outbound-networking.md: the resolver answers startos.internal and private names locally. .startos stays dropped, as this PR removed it.

Interaction checked by reading the code:

  • Resolved address: the bridge resolver answers private domains with its PrivateScope::Local addresses, which here are HOST_IP (172.16.0.1) only. So startos.internal resolves to the forward address, never to the OS listener at .2.
  • Tor lookup: the Rust bridge_address used by TorSocks still picks the IPv4 lxcbr0 row, so StartOS's Tor endpoint stays DNS-free.

Verification on 84a28a7: make start-core-test passes (1999 tests), cargo fmt --check is clean, make generated-artifacts-check is clean, the start-core TS module builds, and Prettier passes on the edited files.

@helix-red
helix-red requested review from helix-white and removed request for dr-bonez November 25, 2026 03:32

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 84a28a74b92263ac8bab848e16f06a610f1df352.

Compared the complete PR-owned patches against my previous reviewed head and inspected the four merge resolutions. They retain container isolation, the self-address/SAN guidance and removal of the legacy DNS aliases while incorporating master's startos.internal contract.

The inherited bridge-name row flows through the existing private-DNS and named-vhost owners. Container DNS resolves it to HOST_IP (172.16.0.1), the forward address, not the OS listener .2. The SDK helper's hostname preference does not alter TorSocks: its Rust selector still takes the mapped IPv4 lxcbr0 socket, preserving DNS-free Tor discovery and the onion fail-closed guards. The #4868 integration introduces no regression in this PR's forwarding changes.

The restored schemas, revision-5 migration, slots and shared-storage owners remain unchanged. No further correctness finding. The head merges cleanly with current master 9fd57a361.

Static review only; no builds, tests, typechecks, linters, formatters or VMs were run. The author reports 1999 core tests and clean generated-artifact checks on this head. Current-head SDK/runtime/script, formatting/lockfile and Prettier CI have passed; core/manpage, generated-binding/catalog and architecture jobs remain pending or running. This is not an all-green CI assertion, and the disclosed native verification gaps remain.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 25, 2026 03:39
…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	shared-libs/crates/start-core/src/net/forward.rs
#	shared-libs/crates/start-core/src/net/gateway.rs
#	shared-libs/crates/start-core/src/net/vhost.rs
@helix-red

Copy link
Copy Markdown
Contributor Author

Merged origin/master (b7ed50e, #4896) in 8f953af. The only conflicts were imports in net/forward.rs, net/gateway.rs and net/vhost.rs: #4896 adds crate::mcp::{EFFECT, Effect} where this branch adds crate::lxc::slot constants, and I kept both. This PR adds no RPC handlers, so #4896's effect classification needs nothing from it. On 8f953af, make start-core-test passes (2001 tests), cargo fmt --check is clean and make generated-artifacts-check is clean.

@helix-red
helix-red requested review from helix-white and removed request for dr-bonez November 25, 2026 04:43

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 8f953af297f5692273a69b6ec6aaab1b29329fea.

Re-reviewed the changes since 84a28a74b, including the complete PR-patch comparison, #4896 provenance, and all three import-conflict resolutions. Each resolution keeps the slot constants alongside MCP's EFFECT/Effect imports. The MCP policy, catalog, generator, and container-effect registrations match master; the self-only getContainerIp effect remains on the separate container RPC tree. The inherited classifications introduce no additional registration requirement for this PR. The reviewed isolation, forwarding, storage, schema, and revision-5 migration contracts remain intact. No new correctness finding.

The head merges cleanly with master b7ed50e5f. This was a static review: I ran no builds or tests. The author reports 2001 passing core tests and clean formatting/generated-artifact checks. Current-head SDK/runtime/script, formatting/lockfile, Prettier, and changelog checks have passed; core/manpage, generated-binding/catalog, and architecture checks are still running. Earlier native-verification gaps remain unchanged.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 25, 2026 04:56
@MattDHill MattDHill added repo Repository maintenance start-registry labels Nov 25, 2026
…ner-isolation

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

# Conflicts:
#	projects/start-sdk/docs/src/agent-context.md
@helix-red

Copy link
Copy Markdown
Contributor Author

Merged origin/master (aa2b926) in 341686f. The only conflict was the Interfaces bullet in projects/start-sdk/docs/src/agent-context.md. A live-docs backport there still carried the pre-isolation sentence ("Every service shares one bridge, so any listener off 127.0.0.1 is reachable by every other service on the server — bound or not, gated by proxy.auth or not"), which this PR replaced at @MattDHill's request. The backport also adds the shared-hostname cookie and CSRF guidance.

The resolution keeps this PR's isolation wording ("Never bind a port that only your own daemons use, and never export a port that only dependents use") and adds master's cookie and CSRF sentence unchanged, since it still holds under isolation. No other page in the merge reintroduces the direct-reachability claims.

On 341686f, make start-core-test passes (2007 tests), make generated-artifacts-check is clean, and Prettier passes on the resolved file.

@helix-red
helix-red requested review from helix-white and removed request for dr-bonez November 26, 2026 01:11

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 341686fa25998c73d64acbb52cacd09388f1c8ed.

Compared the complete PR-owned patches since 8f953af29, the range-diff and the merge resolution. The Interfaces bullet keeps this PR's isolation guidance while retaining master's shared-hostname cookie/CSRF warning. The related guide pages do not regain the direct-container reachability or authentication-bypass claims.

I checked the relevant inherited integrations: browser-origin policy runs before forwarding on both HTTP relay paths, and the Preserve compatibility check reuses the registered version owner without changing revision-5 reruns. The slot/isolation, forwarding, restored-schema, shared-storage and mapped-Tor owners remain unchanged. No new correctness finding. This head merges cleanly with master aa2b92659.

Static review only; I ran no builds or tests. The author reports 2007 passing core tests, clean generated artifacts and Prettier. Current-head Prettier and dependency-license CI have passed; core/manpage, SDK/runtime/script, formatting, generated-binding/catalog and architecture checks are still running. The previously disclosed native-verification gaps remain.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 26, 2026 01:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants