Skip to content

docs(038): Phase 0 is settled — the netns-bound transparent socket sees the VIP - #940

Merged
bpalermo merged 2 commits into
mainfrom
docs/038-phase0-answered
Sep 26, 2026
Merged

bpalermo merged 2 commits into
mainfrom
docs/038-phase0-answered

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Answers proposal 038's one open premise, on a node. Phase 1 is unblocked. Refs #916.

The question

Does a UDP socket created inside a pod netns (via setns) but read from another netns still observe the pre-TPROXY destination? That is aether's real shape — the proxy is hostNetwork and binds capture listeners into each pod's netns via network_namespace_filepath.

The answer: yes

C1   in-netns create + read, mark-and-divert   ipi_addr=10.250.0.7   (the VIP)
C2   REDIRECT, in-netns read                   ipi_addr=127.0.0.1    (rewritten)
C3   no capture rule                           nothing delivered
MAIN create in-netns via setns, read outside   ipi_addr=10.250.0.7   (the VIP)

main-worker-04, kernel 6.18.34-talos.

Scope, stated plainly

The rig tests the kernel half directly, on the socket Envoy would use, rather than standing up Envoy. transparent: true applying to a datagram socket, and Envoy reading ipi_addr via addressFromMessage, were already established by the 2026-09-23 spike; the only open question was the setns interaction, and isolating it removes Envoy's config surface as a confound.

So Phase 0 is answered — but not by running Envoy, and the proposal now says so.

C2 is the control that matters, and it failed silently the first time

C2 proves ipi_addr reports the real post-NAT header rather than echoing the address that was sent. C3 is weaker: it only shows delivery needs a rule.

The 2026-09-23 attempt was unusable because its control agreed with its negative result. The first run of this script lost C2 the same way, and more quietly: redirect is terminal in nftables, so a trailing counter invalidated the rule, nothing installed, and C2 became an accidental duplicate of C3 — while still satisfying an assertion written as "C2 must not report the VIP", which a no-delivery None passes trivially. That run printed an answer it had not earned.

The script now:

  • raises on any failed setup command instead of logging and continuing;
  • verifies with nft list ruleset that the rule is really present before measuring;
  • treats no delivery in C2 as a broken rig (exit 2), not a pass.

It binds the service port, not the capture port

nftables tproxy is prerouting-only, so locally-originated pod egress uses mark-and-divert, which does not rewrite the destination port. A listener on any other port receives nothing — the constraint that forces listener-per-port in Phase 2, arrived at here independently of the earlier spike row that found it.

Kept as an artifact

e2e/spike/ holds the script, the Job and a README, because a spike nobody can re-run is a claim rather than evidence.

The Job needs NET_ADMIN + SYS_ADMIN and no host namespaces and no privileged: true — the pod's own netns is the outer one. My first attempt asked for hostNetwork/hostPID/privileged and was refused; on reflection none of it was needed, and the narrower pod is a better experiment.

It runs in aether-system because that namespace already enforces PodSecurity privileged (the rest of the cluster enforces baseline, which refuses these capabilities) — no security setting was changed to make this work. SYS_ADMIN is the single reason a rootless workstation rig cannot host the test: setns() back needs CAP_SYS_ADMIN in the original netns's user namespace.

Exit 0 = yes, 1 = no (038 stops and #916 stands as a documented limit), 2 = rig broken.

What this does not deliver

Nothing about east-west QUIC, which 038 declines on security-model grounds, and nothing about per-service selection itself — that is Phase 2. This only removes the gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…es the VIP

Answers proposal 038's one open premise, on a node, which unblocks Phase 1.
Refs #916.

THE QUESTION

Does a UDP socket created INSIDE a pod netns (via setns) but READ from another
netns still observe the pre-TPROXY destination? That is aether's real shape: the
proxy is hostNetwork and binds capture listeners into each pod's netns via
network_namespace_filepath.

THE ANSWER: yes.

  C1   in-netns create + read, mark-and-divert   ipi_addr=10.250.0.7  (the VIP)
  C2   REDIRECT, in-netns read                   ipi_addr=127.0.0.1   (rewritten)
  C3   no capture rule                           nothing delivered
  MAIN create in-netns via setns, read outside   ipi_addr=10.250.0.7  (the VIP)

main-worker-04, kernel 6.18.34-talos.

The rig tests the KERNEL half directly, on the socket Envoy would use, rather
than standing up Envoy: `transparent: true` applying to a datagram socket, and
Envoy reading ipi_addr via addressFromMessage, were already established by the
2026-09-23 spike. The only open question was the setns interaction, and isolating
it removes Envoy's config surface as a confound. Worth stating plainly because it
means Phase 0 is answered, but not by running Envoy.

C2 IS THE CONTROL THAT MATTERS, AND IT FAILED SILENTLY THE FIRST TIME

C2 proves ipi_addr reports the REAL post-NAT header rather than echoing the
address that was sent. C3 is weaker: it only shows delivery needs a rule.

The 2026-09-23 attempt was unusable because its control agreed with its negative
result. The first run of THIS script lost C2 the same way and more quietly:
`redirect` is terminal in nftables, so a trailing `counter` invalidated the rule,
nothing installed, C2 became an accidental duplicate of C3 -- and still satisfied
an assertion written as "C2 must not report the VIP", which a no-delivery None
passes trivially. The run printed an answer it had not earned.

So the script now raises on any failed setup command instead of logging and
continuing, verifies with `nft list ruleset` that the rule is really present
before measuring, and treats no-delivery in C2 as a BROKEN RIG rather than a pass.

IT BINDS THE SERVICE PORT, NOT THE CAPTURE PORT

nftables `tproxy` is prerouting-only, so locally-originated pod egress uses
mark-and-divert, which does NOT rewrite the destination port. A listener on any
other port receives nothing -- the constraint that forces listener-per-port in
Phase 2, arrived at here independently.

KEPT AS AN ARTIFACT

e2e/spike/ holds the script, the Job and a README, because a spike nobody can
re-run is a claim rather than evidence. The Job needs NET_ADMIN + SYS_ADMIN and
NO host namespaces and no `privileged: true` -- the pod's own netns is the outer
one. It runs in aether-system because that namespace already enforces PodSecurity
`privileged`; the rest of the cluster enforces `baseline`, which refuses these
capabilities. SYS_ADMIN is the single reason a rootless workstation rig cannot
host the test: setns() back needs CAP_SYS_ADMIN in the original netns's user
namespace.

Exit 0 = yes, 1 = no (038 stops, #916 stands as a limit), 2 = rig broken.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
# it does not own. A missing capability fails LOUDLY here.
s.setsockopt(socket.IPPROTO_IP, IP_TRANSPARENT, 1)
s.setsockopt(socket.IPPROTO_IP, socket.IP_PKTINFO, 1)
s.bind(("0.0.0.0", SVC_PORT))
@bpalermo
bpalermo merged commit 89de046 into main Sep 26, 2026
25 of 27 checks passed
@bpalermo
bpalermo deleted the docs/038-phase0-answered branch September 26, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants