Skip to content

Drop actor UDP egress to every port but DNS - #1623

Open
haiyanmeng wants to merge 1 commit into
agent-substrate:mainfrom
haiyanmeng:block-non-dns-udp
Open

Drop actor UDP egress to every port but DNS#1623
haiyanmeng wants to merge 1 commit into
agent-substrate:mainfrom
haiyanmeng:block-non-dns-udp

Conversation

@haiyanmeng

@haiyanmeng haiyanmeng commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Only TCP is redirected into atunnel, so UDP left the worker pod through the compatibility masquerade with no CONNECT authority, no access log, and no policy hook. QUIC on 443 is the case that matters: an actor could make its own HTTPS egress unintercepted just by speaking HTTP/3, with no timing trick needed.

Add a forward-chain rule ahead of the catch-all accept that drops UDP from the actor veth to any destination port but 53, keeping the DNS exception the masquerade exists for. The rule counts what it drops, so a workload that legitimately needs UDP surfaces in nft list table ip ateom_actor rather than as an unexplained timeout.

The rule is installed whether or not an egress gateway is configured: unlike the redirect it needs nothing to redirect to, and a deployment with no egress control is where unrestricted UDP is worst.

The existing TODO narrows rather than goes away. The DNS exception is still any port-53 destination rather than the configured cluster resolver, and protocols other than TCP and UDP still reach the masquerade.

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

Only TCP is redirected into atunnel, so UDP left the worker pod through
the compatibility masquerade with no CONNECT authority, no access log,
and no policy hook. QUIC on 443 is the case that matters: an actor could
make its own HTTPS egress unintercepted just by speaking HTTP/3, with no
timing trick needed.

Add a forward-chain rule ahead of the catch-all accept that drops UDP
from the actor veth to any destination port but 53, keeping the DNS
exception the masquerade exists for. The rule counts what it drops, so a
workload that legitimately needs UDP surfaces in
`nft list table ip ateom_actor` rather than as an unexplained timeout.

The rule is installed whether or not an egress gateway is configured:
unlike the redirect it needs nothing to redirect to, and a deployment
with no egress control is where unrestricted UDP is worst.

The existing TODO narrows rather than goes away. The DNS exception is
still any port-53 destination rather than the configured cluster
resolver, and protocols other than TCP and UDP still reach the
masquerade.
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