docs(architecture): document egress control vs sandbox MMDS boundary (#3625) - #3627
Open
AdaAibaby wants to merge 1 commit into
Open
docs(architecture): document egress control vs sandbox MMDS boundary (#3625)#3627AdaAibaby wants to merge 1 commit into
AdaAibaby wants to merge 1 commit into
Conversation
Clarifies the two independent reachability mechanisms and why they are often conflated (issue e2b-dev#3625): egress filtering (denyOut / allowPublicTraffic) acts only on tap->host traffic, while MMDS (169.254.169.254) is a Firecracker per-microVM service that never egresses the tap and is therefore not affected by any egress control. Documents the supported contract: MMDS is sandbox-scoped (instanceID, envID, address, accessTokenHash) and does not proxy host/cloud IMDS or IAM credentials; accessTokenHash is a hash, not the token; the 'no real IMDS' property is partly a deployment contract; and DeniedSandboxCIDRs (incl. 169.254.0.0/16) plus the pre-connect resolved-IP check are the testable egress boundary. Also notes there is currently no supported way to deny user-workload access to MMDS without breaking envd /init. Signed-off-by: AdaAibaby <shaolila@buaa.edu.cn>
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
September 8, 2026 03:32
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
Documents the supported contract requested in #3625: how sandbox egress control (
denyOut/allowPublicTraffic) relates to sandbox-local MMDS (169.254.169.254), and why controlling one does not control the other.Adds a
### Network egress control and sandbox metadata (MMDS)subsection todocs/ARCHITECTURE.md(under Core flows, after Sandbox traffic). No code change.What it clarifies
denyOutplus the built-inDeniedSandboxCIDRsbaseline (already includes169.254.0.0/16) and re-checks the resolved IP beforeconnect()(DNS-rebinding guard); non-TCP is matched by the nftables chain.allowPublicTraffic:false≡denyOut 0.0.0.0/0. BYOP only changes nftables Rule 3 (drop non-TCP to denied ranges); BYOP endpoints are themselves validated againstDeniedSandboxCIDRs.169.254.169.254is Firecracker's per-microVM MMDS (v2), configured per-sandbox by the orchestrator; those packets are handled by the VMM's virtio-net device and never egress the tap, sodenyOut/allowPublicTraffic/ full deny-egress have no effect on it. envd pins a self-healingRETURNrule for169.254.169.254:80to keep/initworking.instanceID,envID,address,accessTokenHash) and do not proxy host/cloud IMDS or IAM credentials;accessTokenHashis a hash, not the token. The "never routes to a real IMDS" property is partly a deployment contract (guest tap must not be bridged onto a network where a real IMDS is routable).denyOut/ theDeniedSandboxCIDRsbaseline; there is currently no supported knob to deny user-workload access to the in-guest MMDS endpoint without breaking envd init.Why this is not a duplicate
gh pr list --state open --search "mmds"/"denyOut metadata"— no doc PR on this; the only MMDS PRs open are unrelated (goroutine-accumulation fix fix(envd): guard MMDS-poll goroutine with CAS to prevent unbounded accumulation on /init retries #3560, etc.).Verification
main(firewall.go,tcpfirewall/,sandbox-network/firewall.go,fc/client.go,fc/mmds.go,mmds_route_linux.go,init.go,ValidateEgressProxy).Closes #3625
AI assistance
AI assistance was used to trace the firewall/MMDS call chains and draft the documentation. A human submitter has reviewed every line.