Sever an allowlist run this worker cannot filter - #2048
Merged
Merged
Conversation
ppXD
force-pushed
the
fix/guard-an-allowlist-runs-veth-both-ways
branch
from
September 29, 2026 07:21
1c54271 to
bb72607
Compare
ppXD
force-pushed
the
fix/sever-an-allowlist-this-worker-cannot-build
branch
from
September 29, 2026 07:21
b7619db to
2372eb7
Compare
ppXD
changed the base branch from
fix/guard-an-allowlist-runs-veth-both-ways
to
main
September 29, 2026 08:16
ppXD
force-pushed
the
fix/sever-an-allowlist-this-worker-cannot-build
branch
from
September 29, 2026 08:16
2372eb7 to
847bb38
Compare
An allowlist run was planned Filtered wherever ip and nft were
installed, which is all FilteredEgressNetns.IsSupported checks. The
shipped worker is uid 1654 with no capabilities and ships both, so
every allowlist run there was admitted, spent, and then aborted at
`ip netns add` ("Filtered-egress netns setup failed"). A root worker
whose /proc/sys is read-only fared worse: procps' `sysctl -w
net.ipv4.ip_forward=1` warns and exits 0 there, so with forwarding at
0 the setup succeeded and the run launched as filtered with its
allowed hosts unreachable.
Where bubblewrap confines, the runner's egress derivation, and the
admission that predicts it, now key on FilteredEgressNetns.CanFilter,
renamed from CanSeal: the tools, the throwaway-namespace probe, and
net.ipv4.ip_forward reading 1 or passing access(W_OK), which changes
nothing. Where it does not hold, an allowlist fails closed to no
egress, the contract SandboxEgressPolicy has always stated: bubblewrap
severs the run, its record says NetworkSevered, and a brokered run
still reaches its broker through the relay. The boot posture line
reports CanFilter and FilterUnavailableReason, and the Dockerfile says
what an allowlist needs and what a worker without it does.
Where bubblewrap does not confine, as docker-compose.yml ships the
worker, nothing would enforce that severance: the run would share the
worker's network. There the binaries alone still plan it Filtered, so
its setup filters it or aborts the launch, exactly as before. The
launch and the admission read that one host fact
(LocalProcessRunner.FiltersAllowlist). A worker that can filter still
filters. Tearing a namespace down by name and the legacy re-bind still
key on the tools alone, so runs in flight keep what they have.
The non-root sandbox lane gains an allowlist arm that is admitted,
launched with no namespace, recorded severed, and reaches its broker
while the allowlisted IP stays unreachable; keyed back on the tools it
aborts at setup again. A new unconfined lane (uid 1654, with
CODESPACE_BWRAP_PATH naming no binary) pins that the same run there is
aborted at setup, durable or not, and that the admission predicts its
namespace; keyed on CanFilter everywhere, it launches on the worker's
network. The root lane asserts its allowlist run is still filtered, and
binds a file reading 0 read-only to show that the whole filter probe,
not only its forwarding step, names forwarding root may not turn on.
The non-root fixture also asserts its wall is the namespace, not
forwarding, so a lane that can build one cannot pass as the shipped
posture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ipandnftinstalled planned every allowlist run Filtered (FilteredEgressNetns.IsSupported). The shipped worker (uid 1654, no capabilities) then admitted the run, spent on it, and aborted it atip netns add("Filtered-egress netns setup failed")./proc/sysis read-only did worse. procps'sysctl -w net.ipv4.ip_forward=1warns and exits 0 there, so the run launched as filtered while none of its allowed hosts was reachable.FilteredEgressNetns.CanFilter(renamed fromCanSeal). That is the tools, one throwaway namespace, andip_forwardreading 1 or passingaccess(W_OK), a check that changes nothing.SandboxEgressPolicydocuments. bubblewrap severs the run, its record saysNetworkSevered, and a brokered run still reaches its broker through the relay.docker-compose.ymlships it), nothing would enforce a severance, so a severed allowlist would share the worker's network. There the binaries alone still plan the run Filtered: its setup filters it or aborts the launch, and it never reaches the worker's network.LocalProcessRunner.FiltersAllowlist/HostFiltersAllowlistinLocalProcessRunner.Durable.cs.Dockerfile.workerdescribes both postures.CanFilterandFilterUnavailableReason.FilteredEgressNetns.FilterProbe(path)is the probeCanFilterruns, with the forwarding file passed in, so the root lane can pin the whole probe and not only its parts.Test plan
LocalProcessDurableRunnerTests.Supervisor_seals_logs_only_after_a_background_descendant_closes_its_output_writer, fails identically on the base.AllowlistFilterProbeTestscovers:SealedEgressAdmissionTestspins the public admission against this host's probes.AgentRunExecutorTests, macOS): 144/144.FilterProbe, and a writable one is not.NetworkSevered, and reaches its broker through the relay. The allowlisted IP stays unreachable.Category=SandboxUnconfined: uid 1654,CODESPACE_BWRAP_PATHpointing at no binary,RequireConfinementunset): 3/3.FilterProbe;CanFiltereverywhere (the unconfined lane launches unfiltered);IsSupportedeverywhere (the non-root run aborts again);CanFilter;