Skip to content

feat: verify Cloud Hypervisor runtime confinement - #7889

Merged
lpcox merged 2 commits into
mainfrom
lpcox-runtime-confinement-verifier
Aug 31, 2026
Merged

feat: verify Cloud Hypervisor runtime confinement#7889
lpcox merged 2 commits into
mainfrom
lpcox-runtime-confinement-verifier

Conversation

@lpcox

@lpcox lpcox commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add fail-closed production verification of the launched Cloud Hypervisor process after API readiness and before virtiofsd or vm.create
  • verify stable PID/start time/executable identity, per-thread credentials and capability policy, NoNewPrivs, v53 vmm and http-server seccomp filters, network namespace inode, and exact cgroup membership and limits
  • preserve bounded structured confinement.json evidence in run diagnostics and document the runtime boundary

Capability expectations and cgroup limits are produced by the same launcher/cgroup policy used for enforcement, avoiding a duplicated fixed mask.

Validation

  • npm test -- --runInBand src/cloud-hypervisor (17 suites, 255 tests)
  • npm run build -- --pretty false
  • npm run type-check -- --pretty false
  • npm run lint -- --quiet
  • npm run lint:md -- docs/cloud-hypervisor-foundation.md

Fail closed before VM creation unless the launched VMM matches trusted host policy.

Verify process identity, namespaces, seccomp, capabilities, and cgroup limits.

Preserve bounded structured evidence in run diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 31, 2026 14:28
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit b695620

@lpcox lpcox changed the title Verify Cloud Hypervisor runtime confinement before VM creation feat: verify Cloud Hypervisor runtime confinement Aug 31, 2026
@github-actions

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.86% 93.75% 📉 -0.11%
Statements 92.67% 92.56% 📉 -0.11%
Functions 93.24% 93.18% 📉 -0.06%
Branches 86.14% 85.85% 📉 -0.29%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/manager-start.ts 98.2% → 96.6% (-1.60%) 98.3% → 96.8% (-1.53%)
src/cloud-hypervisor/diagnostics.ts 84.7% → 84.9% (+0.18%) 82.8% → 83.0% (+0.20%)
src/cloud-hypervisor/manager.ts 88.9% → 89.1% (+0.21%) 87.5% → 87.7% (+0.21%)
src/cloud-hypervisor/launcher.ts 93.8% → 94.7% (+0.91%) 92.5% → 93.6% (+1.05%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/cloud-hypervisor/confinement-verifier.ts: 83.2% lines

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

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

🔵 Needs a closer look

The security-boundary changes depend on live Linux kernel and Cloud Hypervisor v53 runtime semantics that warrant final human validation.

Review tier: Balanced
Findings: None

What changed in this PR

Adds fail-closed verification of Cloud Hypervisor’s host-side confinement before VM creation.

Changes:

  • Verifies process identity, credentials, capabilities, seccomp mode, namespace, and cgroup policy.
  • Derives verification expectations from launcher and cgroup policy.
  • Records structured confinement evidence in diagnostics and documentation.
File Description
src/​cloud-hypervisor/​manager.ts Stores and exposes verification evidence.
src/​cloud-hypervisor/​manager.test.ts Tests ordering, failure handling, and diagnostics.
src/​cloud-hypervisor/​manager-types.ts Adds the verifier dependency.
src/​cloud-hypervisor/​manager-start.ts Runs verification before virtiofsd and VM creation.
src/​cloud-hypervisor/​launcher.ts Exposes launcher policy and computed cgroup limits.
src/​cloud-hypervisor/​launcher.test.ts Tests the derived confinement policy.
src/​cloud-hypervisor/​diagnostics.ts Writes confinement.json.
src/​cloud-hypervisor/​confinement-verifier.ts Implements runtime confinement verification.
src/​cloud-hypervisor/​confinement-verifier.test.ts Tests successful and fail-closed verification paths.
docs/​cloud-hypervisor-foundation.md Documents verification and evidence.

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

…ment-verifier

# Conflicts:
#	src/cloud-hypervisor/launcher.test.ts
#	src/cloud-hypervisor/launcher.ts
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

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.86% 93.73% 📉 -0.13%
Statements 92.67% 92.54% 📉 -0.13%
Functions 93.24% 93.06% 📉 -0.18%
Branches 86.14% 85.86% 📉 -0.28%
📁 Per-file Coverage Changes (5 files)
File Lines (Before → After) Statements (Before → After)
src/cloud-hypervisor/launcher.ts 93.8% → 92.0% (-1.75%) 92.5% → 91.0% (-1.51%)
src/cloud-hypervisor/manager-start.ts 98.2% → 96.6% (-1.60%) 98.3% → 96.8% (-1.53%)
src/cloud-hypervisor/diagnostics.ts 84.7% → 84.9% (+0.18%) 82.8% → 83.0% (+0.20%)
src/cloud-hypervisor/manager.ts 88.9% → 89.1% (+0.21%) 87.5% → 87.7% (+0.21%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/cloud-hypervisor/confinement-verifier.ts: 83.2% lines

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

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

Smoke test completed with FAIL, comment posted on PR.

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

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Aug 31, 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 Aug 31, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.anthropic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #7889

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

Generated by Build Test Suite for #7889

@github-actions

github-actions Bot commented Aug 31, 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 Aug 31, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution check complete for PR #7889: no guideline issues found in the provided context. The change includes implementation, tests, and documentation updates, and the PR description/validation are clear.

Generated by Contribution Check for #7889

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
gh CLI ✅ PASS
File ✅ PASS

Overall result: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.anthropic.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #7889 · claude · haiku45 · 56.1 AIC · ⊞ 4.5K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

  • ✅ GitHub MCP connectivity
  • ✅ GitHub.com HTTP 200
  • ✅ File write/read test
  • ✅ BYOK inference via api-proxy → api.githubcopilot.com

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY).

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

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox Egress isolation smoke test results:

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (github.com) reachable: allowed=200
  • ✅ Non-allowed domain (example.com) blocked: CONNECT tunnel failed (403)

Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
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 Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

  • Redis PING: ❌ (Temporary failure in name resolution)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal could not be resolved from the AWF sandbox, so no service connectivity could be verified.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine (PR: feat: verify Cloud Hypervisor runtime confinement)

Overall: PASS

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor
  • feat: add durable identity-validated microVM cleanup
  • feat: isolate Cloud Hypervisor with per-run VMM identities
  • GitHub merged PR review ✅
  • safeinputs-gh query ❌ (tool unavailable; gh fallback used)
  • Playwright title check ✅
  • File write/readback ✅
  • Discussion comment ❌ (discussions:write unavailable)
  • Build (npm ci && npm run build) ✅
  • Overall: FAIL

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Docker Sbx Validation

Overall: PASS

cc @lpcox

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

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
fix: drop CAP_NET_ADMIN from Cloud Hypervisor VMM — ❌
docs: add B28 runner-doctor coverage for private-CA api-proxy TLS failures — ❌
✅ GitHub.com connectivity
✅ File I/O
✅ BYOK inference
Overall: FAIL

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

@github-actions

Copy link
Copy Markdown
Contributor

OTel Tracing Smoke Test Results (PR #7889)

  • ✅ Scenario 1 — Module Loading: otel.js loaded successfully, isEnabled() → true, exports include startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus OTLP/exporter internals.
  • ✅ Scenario 2 — Test Suite: 68/68 tests passed across 3 suites (otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js), covering span creation, gen_ai token attributes, budget attributes, OTLP/JSON serialization, and proxy-aware exporter behavior.
  • ✅ Scenario 3 — Env Var Forwarding: env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID to the agent; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and both trace-context vars to api-proxy.
  • ✅ Scenario 4 — Token Tracker Integration: token-tracker-http.js contains the onUsage callback hook point used by OTEL.
  • ⚠️ Scenario 5 — OTEL Diagnostics: no otel.jsonl/token-usage.jsonl span file was present in this local validation context (expected — no live agent/api-proxy traffic was generated during this check).

All core scenarios pass; no regressions detected.

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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

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

Overall: FAILED — Node.js version mismatch between host and chroot environments. smoke-chroot label not applied since not all tests passed.

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

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

GitHub MCP Testing: ❌
GitHub.com Connectivity: ✅
File Write/Read Test: ✅
BYOK Inference Test: ✅
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
Overall status: FAIL

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A (ran, "Hello, World!") ✅ PASS
.NET json-parse N/A (ran, JSON parsed OK) ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Note: Maven required -Dmaven.repo.local=/tmp/gh-aw/agent/m2repo since ~/.m2/repository was not writable by the runner user in this sandbox (pre-existing root-owned ~/.m2 dir); this is a local environment quirk, not a firewall issue — all Java builds/tests completed successfully once redirected.

Generated by Build Test Suite for #7889 · copilot · auto · 37.6 AIC · ⊞ 12K ·
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 144acba into main Aug 31, 2026
169 of 173 checks passed
@lpcox
lpcox deleted the lpcox-runtime-confinement-verifier branch August 31, 2026 16:05
lpcox added a commit that referenced this pull request Aug 31, 2026
Resolve the Cloud Hypervisor lifecycle documentation overlap with #7889 and add negative-path verifier coverage so the branch preserves main's aggregate coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

2 participants