Reject WebSocket egress upgrades and add E2E HTTPS egress - #1634
Adhita Selvaraj (swiftdiaries) wants to merge 1 commit into
Conversation
|
/assign haiyanmeng |
|
The test setup part ended up being bigger than I would have liked. Please let me know if there's something that I can trim down or reuse. I'm re-checking for this myself as well. |
haiyanmeng
left a comment
There was a problem hiding this comment.
Adhita Selvaraj (@swiftdiaries) , thanks for the change!
|
ran the MITM fixture related tests; checked it with gvisor + mitm. I couldn't run the $ E2E_EGRESS_MITM=1 hack/run-e2e-kind.sh \
./internal/e2e/suites/egressmitm -v -args --no-color
...
--- PASS: TestActorEgressMITMTrust (62.04s)
...
$ E2E_EGRESS_MITM=1 hack/run-e2e-kind.sh \
./internal/e2e/suites/networking -run '^TestActorEgress' -v -args --no-color
...
--- PASS: TestActorEgressHTTPSNonStandardPort (19.29s)
--- PASS: TestActorEgressWebSocket (10.55s)
--- PASS: TestActorEgressSecureWebSocket (19.98s)
... |
Adhita Selvaraj (@swiftdiaries) , PTAL. |
Took a look at the failure, it looks like the guest clock doesn't restore the snapshot downtime? I'm not too familiar with the micro-vm test setup and I can't reproduce it :( It looks like a pre-existing failure mode for fresh certs? I'll take some time to look into this and meanwhile, create a separate issue to track, post it on slack to ask for broader help. |
|
Benjamin Elder (@BenTheElder) could I please borrow your expertise a little here? Trying to debug the guestclock not correcting time when a snapshot is restored. I'm not too sure about the setup with Cloud Hypervisor for the micro-vm test path |
|
re: last commit - trying to see if i can set |
|
Tested this on a Linux VM: Setup: E2E_EGRESS_MITM=1 E2E_SANDBOX_CLASS=microvm \
hack/run-e2e-kind.sh ./internal/e2e/suites/networking \
-run '^(TestActorEgressHTTPSNonStandardPort|TestActorEgressWebSocket|TestActorEgressSecureWebSocket)$' \
-v -args --no-color--- PASS: TestActorEgressHTTPSNonStandardPort (19.96s)
--- PASS: TestActorEgressWebSocket (12.38s)
--- PASS: TestActorEgressSecureWebSocket (20.58s)
PASS
ok github.com/agent-substrate/substrate/internal/e2e/suites/networking 53.103ssnapshot, clock, clocksource golden takeGoldenSnapshotAt: 2026-09-16T05:33:59.957947998Z
host before: 2026-09-16T05:39:00.283067832Z
guest UTC: 2026-09-16T05:39:00.320563549Z
host after: 2026-09-16T05:39:00.388914694Z
current_clocksource: kvm-clock
available_clocksource: kvm-clock tsc acpi_pmWithout knowing the clock source in CI, I can't confirm if the last commit is the necessary fix. If it's something else then forcing WDYT? haiyanmeng Bowei Du (@bowei) |
5584de0 to
9f0ed5b
Compare
|
rebased and fixed some additional gateway checks in CI |
9f0ed5b to
888f8e5
Compare
7c92c36 to
3ed6cfe
Compare
|
Adhita Selvaraj (@swiftdiaries) , https://github.com/agent-substrate/substrate/blob/main/docs/egress-traffic.md specifies the supported egress traffic for GA. Currently, the Envoy dataplane supports WebSocket HTTP/1.1 Upgrade. To align with the specification, we can update the PR in the following way: keep the test fixture, modify the Envoy configuration to stop supporting WebSocket HTTP/1.1 Upgrade, and have a negative test verifying that the egress gateway denies the WebSocket HTTP/1.1 Upgrade traffic with WDYT? |
|
Sounds good! Let me update the PR and the re-run tests in CI locally |
2aa4cad to
b65539d
Compare
|
Adhita Selvaraj (@swiftdiaries) , this PR has 19 commits so far. Please squash them into 1-2 commits. |
98860a3 to
05447c2
Compare
|
Eitan Yarmush (@EItanya) , can you take a look at this PR since it modifies the AgentGateway config? |
|
Adhita Selvaraj (@swiftdiaries) , please update the PR title and description since this PR not only includes e2e tests, it also changes the egress gateway's behavior. |
3cef04d to
3032c66
Compare
3032c66 to
7e73f13
Compare
|
tested with CI on my fork's main branch with passing checks. |
Addresses #1017
Summary
403for HTTP/1.1 WebSocket upgrades in the Envoy and Agent Gateway egress HTTP paths. The WebSocket fixtures remain as negative tests forws://and forwss://when TLS is terminated by the MITM gateway.kvm-clockfor amd64 micro-VM guests so restored guests use Cloud Hypervisor's clock correction and accept newly issued TLS certificates.The baseline egress path passes end-to-end TLS through without reading its HTTP headers. It can distinguish the destination of a
wss://connection but cannot distinguish its encrypted WebSocket handshake from ordinary HTTPS. The secure WebSocket denial test therefore runs only in the MITM lanes. The broader GA requirement to block WSS on passthrough paths remains unresolved.Validation
make verifystopped at Python license verification because the host's default Python is too old for the pinnedgrpciodependency.run-tests, Envoy E2E, AgentGateway E2E, and the aggregate check on this exact rebased commit. It covers baseline and MITM gVisor and micro-VM lanes, including cleartext WebSocket denial, MITM secure WebSocket denial, delayed-restore TLS, and HTTPS on port 8443.Fork CI validation: swiftdiaries#4