Skip to content

[WIP] Fix squid aborts on client disconnection during CONNECT - #9419

Merged
lpcox merged 6 commits into
mainfrom
copilot/awf-squid-aborts-issue-9088
Oct 4, 2026
Merged

lpcox merged 6 commits into
mainfrom
copilot/awf-squid-aborts-issue-9088

Conversation

Copilot AI commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor
  • Inspect Squid configuration, image build, issue update, and test infrastructure
  • Disable unsafe half-closed client handling and ship the Squid empty-buffer guard
  • Add focused CONNECT EOF regression coverage and verify streaming compatibility
  • Run targeted tests, build/lint checks, secret scan, and code/security review

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
@lpcox

lpcox commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot finish implementing this pr

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot finish implementing this pr

Completed and pushed the remaining regression coverage; the patched Squid image built successfully, and the CONNECT EOF integration test passed while preserving streaming timeout settings. Commit: a64a9d7.

@lpcox
lpcox marked this pull request as ready for review October 4, 2026 15:44
Copilot AI balanced review requested due to automatic review settings October 4, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The downstream Squid guard lacks regression coverage that exercises it independently of the configuration workaround.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds layered protection against Squid crashes when CONNECT clients disconnect before sending TLS ClientHello data.

Changes:

  • Disables unsafe half-closed client handling.
  • Patches Squid’s empty-buffer assertion path.
  • Adds configuration and integration regression coverage.
File Description
tests/​integration/​network-security.test.ts Tests CONNECT EOF handling and Squid stability.
src/​squid/​config-generator.ts Disables half-closed clients.
src/​squid-config-streaming.test.ts Verifies generated configuration.
containers/​squid/​Dockerfile Builds and installs patched Squid.
containers/​squid/​clienthello-eof.patch Guards empty ClientHello buffers.
.github/​workflows/​test-squid-image.yml Extends image-build timeout.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +5 to +8
+ if (inBuf.isEmpty()) {
+ debugs(83, 3, "client EOF before TLS ClientHello: " << clientConnection);
+ clientConnection->close();
+ return;
@lpcox

lpcox commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Added independent image-matrix coverage with SSL bump active and half_closed_clients on; the pre-ClientHello close/half-close cases passed against the patched image. Commit: 20117f0.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 92.65% 92.91% 📈 +0.26%
Statements 91.13% 91.39% 📈 +0.26%
Functions 89.28% 89.56% 📈 +0.28%
Branches 84.87% 85.03% 📈 +0.16%
📁 Per-file Coverage Changes (8 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-adapter.ts 83.5% → 82.9% (-0.60%) 80.3% → 79.8% (-0.56%)
src/cloud-hypervisor/host-enclave-executor.ts 95.1% → 94.5% (-0.57%) 91.5% → 89.8% (-1.64%)
src/enclave/host-executor-server.ts 90.3% → 90.3% (+0.00%) 88.8% → 89.1% (+0.31%)
src/enclave/cloud-hypervisor-lifecycle.ts 92.9% → 94.7% (+1.77%) 90.8% → 92.3% (+1.54%)
src/enclave/paths.ts 97.2% → 100.0% (+2.78%) 97.2% → 100.0% (+2.78%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)
src/bounded-execution/repository-staging.ts 80.0% → 100.0% (+20.00%) 80.0% → 100.0% (+20.00%)
src/enclave/manager.ts 59.3% → 86.4% (+27.12%) 57.9% → 85.2% (+27.32%)
✨ New Files (2 files)
  • src/cloud-hypervisor/enclave-artifact-preflight.ts: 97.6% lines
  • src/cloud-hypervisor/enclave-invocation-staging.ts: 95.7% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox

lpcox commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot fix the pr title and summary and fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/37215276207/job/111474869658?pr=9419

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the pr title and summary and fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/37215276207/job/111474869658?pr=9419

The CI test fix is committed as 9199122; the patched-image CONNECT EOF regression now passes locally. The available tools do not support editing the PR title or body, so those remain unchanged.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

smoke test checks could not run: curl, python3, node, and the github/safeoutputs CLI bridges are all blocked by Permission denied in this sandbox

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #9419

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #9419

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PASS

  • ✅ GitHub MCP: "Upgrade gh-aw prerelease workflows"
  • ✅ github.com HTTP 200
  • ✅ File write/read
    Author @Copilot; assignees @lpcox @Copilot

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude Results

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #9419 · claude · haiku45 · 49.9 AIC · ⊞ 6.2K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Services smoke test:

  • Redis PING: ✅ PONG
  • pg_isready: ✅ accepting connections
  • psql SELECT 1: ✅ 1

Overall: PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Results:

Status: PASS — All smoke tests passed. Direct BYOK mode operational.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com blocked)
    Overall: PASS — @Copilot

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added smoke-copilot-byok smoke-copilot-network-isolation Copilot network-isolation egress smoke test labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Cloud Hypervisor + Copilot

  1. List merged PRs (github MCP) - FAIL (tool invocation intermittently denied by sandbox exec policy)
  2. curl https://github.com - FAIL (curl execution denied before reaching network/firewall)
  3. Write/read /tmp/gh-aw/agent/smoke file - PASS
  4. curl (example.com/redacted) (expect blocked) - FAIL (could not execute curl)

Most checks could not run because curl, python3, node, jq, and the github CLI bridge were intermittently blocked by the sandbox exec policy itself ("Permission denied") before any firewall logic was reached. Only the local file write/read check passed. Label not added since not all checks passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ 1 Module loading: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled (+ internals)
  • ✅ 2 Tests: otel.test.js 39/39 passed
  • ✅ 3 Env forwarding: trace/parent span IDs in env-passthrough.ts; OTEL vars in api-proxy-env-config.ts
  • ✅ 4 Token tracker: onUsage hook present in token-tracker-http.js
  • ✅ 5 Diagnostics: /tmp/gh-aw/otel.jsonl has 1 record (no api-proxy spans expected in this run)

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: Not all tests passed (Node.js version mismatch), so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ❌ not run ❌ FAIL
Bun hono ❌ not run ❌ FAIL
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak ❌ not run ❌ FAIL
Deno std ❌ not run ❌ FAIL
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ pass ✅ PASS
Go env ✅ pass ✅ PASS
Go uuid ✅ pass ✅ PASS
Java gson ✅ 1/1 passed ✅ PASS*
Java caffeine ✅ 1/1 passed ✅ PASS*
Node.js clsx ✅ pass ✅ PASS
Node.js execa ✅ pass ✅ PASS
Node.js p-limit ✅ pass ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 6/8 ecosystems passed — FAIL

Failures

  • Bun / Deno: the install scripts (curl ... | bash / | sh) were rejected with "Permission denied and could not request permission from user", so neither runtime could be installed. Neither is on PATH, so their tests were not run.
  • *Java: the default ~/.m2/repository could not be created ("Could not create local repository"). Both projects passed after I reran with -Dmaven.repo.local pointing to a writable temp directory.

All 8 repositories cloned successfully. The build-test label was not added because of the failures.

Generated by Build Test Suite for #9419 · copilot · auto · 27.5 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Test

  • Last 2 merged PRs: ❌
  • 2 PR details: ❌
  • Playwright GitHub title: ❌
  • Temp file write/read: ❌
  • AWF build: ❌
  • Overall: FAIL

PR titles unavailable because the runner shell lacked required tools (gh, coreutils, safeoutputs on PATH).

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 14d0b4f into main Oct 4, 2026
132 of 137 checks passed
@lpcox
lpcox deleted the copilot/awf-squid-aborts-issue-9088 branch October 4, 2026 19:34

This branch was successfully deployed

1 active deployment
aoai-model — 91991223 Deployed Oct 4, 2026 by lpcox via conclusion #1872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants