Skip to content

Fix published host-service access after Docker DNAT and fail connectivity smoke checks - #11083

Merged
lpcox merged 5 commits into
mainfrom
copilot/fix-allow-host-service-ports
Nov 4, 2026
Merged

lpcox merged 5 commits into
mainfrom
copilot/fix-allow-host-service-ports

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

On Ubuntu 26.04/Docker 29 runners, published service traffic reaches DOCKER-USER after DNAT, bypassing AWF’s gateway-destination allowances and falling through to rejection. Smoke workflows still report success when the agent reports failed connectivity through noop.

  • Gateway-scoped forwarding

    • Match DNAT traffic against conntrack’s original gateway IP and allowed TCP port—not the translated container address.
    • Preserve direct-container restrictions and normalize port ranges for iptables.
  • Fail-closed smoke checks

    • Add an independent, bounded AWF invocation requiring Redis PONG, PostgreSQL readiness, and SELECT 1.
    • Propagate command failures and unexpected responses regardless of agent-reported outcomes.
  • Workflow generation and regression coverage

    • Preserve YAML escaping and postprocessor idempotency for quoted image arguments; regenerate the workflow lock.
    • Cover DNAT rule scoping, remapped ports, relocated gateways, forbidden access, and smoke failure propagation.

Copilot AI changed the title [WIP] Fix connections refused on ubuntu-26.04 runners Fix published host-service access after Docker DNAT and fail connectivity smoke checks Nov 4, 2026
Copilot AI requested a review from lpcox November 4, 2026 12:31
@lpcox
lpcox marked this pull request as ready for review November 4, 2026 14:35
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 14:35

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.

🟡 Changes recommended

The post-agent sudo call can execute an agent-modified CLI as host root, bypassing isolation and connectivity checks.

2 open issues
What changed in this PR

Addresses #11082 by adapting AWF’s gateway-only host-service rules to Docker’s post-DNAT forwarding path and making smoke checks fail on connectivity errors.

Changes:

  • Match published services using conntrack’s original gateway address and port, with normalized port ranges.
  • Add bounded Redis and PostgreSQL connectivity checks independent of agent-reported outcomes.
  • Preserve quoted image arguments during workflow postprocessing and expand regression coverage.
File Description
tests/​integration/​host-tcp-services.test.ts Adds remapped published-port and forbidden-access probes.
src/​host-iptables-rules.ts Adds gateway-scoped DNAT allowances and normalizes port ranges.
src/​host-iptables-host-access.test.ts Tests rule scoping, ordering, disabled access, and relocated gateways.
scripts/​ci/​smoke-services-workflow.test.ts Checks gate compilation and connectivity failure propagation.
scripts/​ci/​smoke-image-preparation.test.ts Tests quoted YAML preservation and postprocessor idempotency.
scripts/​ci/​apply-general-workflow-patches.ts Handles escaped image arguments in quoted run steps.
.github/​workflows/​smoke-services.md Adds an independent sandbox connectivity gate.
.github/​workflows/​smoke-services.lock.yml Includes the compiled gate and updated session-state helper invocation.

Review effort: Max (auto)

- name: Require sandbox service connectivity
timeout-minutes: 3
run: |
sudo /usr/local/bin/awf \
}
}, 120000);

test('should allow a published service on another bridge without allowing direct container access', async () => {
@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedbac

@github-actions

github-actions Bot commented Nov 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.

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedbac

Moved the independent connectivity gate to run before agent execution, added host-tcp-services to the Network Tests CI selector, and corrected the outdated gateway-log assertions. Committed as 01f0144.

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the failing supply chain check https://github.com/github/gh-aw-firewall/actions/runs/41857981521/job/126685652788?pr=11083

Updated the enclave-script SQLite runtime to pinned 3.54.1 and scoped the Grype exception to the CLI-only .recover finding. Commit bdfda1e. The new Supply Chain Scan run is action_required and has no jobs, so CI has not rerun yet.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.75% 93.74% 📉 -0.01%
Statements 92.30% 92.29% ➡️ -0.01%
Functions 91.66% 91.66% ➡️ +0.00%
Branches 86.51% 86.50% 📉 -0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)

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

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

…t-service-ports

# Conflicts:
#	containers/enclave/Dockerfile

Co-authored-by: lpcox <[email protected]>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main and resolved the Dockerfile conflict, preserving both SQLite checks. Merge commit: 9875a2c.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🪪 Smoke Copilot BYOK AOAI (Entra) is testing Azure OpenAI BYOK (Entra / GitHub OIDC) mode on this pull request...

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Smoke test results

  • Last merged PRs: test: exercise NVX harnesses through existing execute interface ✅
  • PR details: test: fix NVX fixture cancellation marker detection / ci: add shared daily agent/runtime and enclave regressions ✅
  • Playwright github title check ❌
  • Temp file create/read ✅
  • AWF build ✅
  • Overall: FAIL

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

test: exercise NVX harnesses through existing execute interface
test: add live Cloud Hypervisor selected-harness acceptance coverage
MCP: ✅ GitHub.com: ✅ File I/O: ✅ BYOK: ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Status: PASS
cc @Copilot @lpcox

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.16 Python 3.12.16 ✅ YES
Node.js v24.22.2 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Not all tests passed (Node.js 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 added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

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

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PASS

  • ✅ GitHub MCP: "ci: add shared daily agent/runtime and enclave regressions"
  • ✅ GitHub.com connectivity (200)
  • ✅ File write/read

PRs: "test: exercise NVX harnesses through existing execute interface", "test: add live Cloud Hypervisor selected-harness acceptance coverage"
cc @Copilot @lpcox

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

This branch had an error being deployed

1 failed deployment
aoai-model — 9875a2ce Deployed Nov 4, 2026 by lpcox via conclusion #2257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--allow-host-service-ports connections refused on ubuntu-26.04 runners; smoke tests pass despite failing

3 participants