feat: verify Cloud Hypervisor runtime confinement - #7889
Conversation
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>
|
| 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
There was a problem hiding this comment.
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
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
| 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
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 Smoke test completed with FAIL, comment posted on PR.
|
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓
|
|
🚀 Security Guard has started processing this pull request |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
✅ Build Test Suite completed successfully!
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
✅ 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.
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY).
|
|
@lpcox Egress isolation smoke test results: EGRESS_RESULT allow=pass deny=pass
Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
|
Smoke Test: Copilot Engine (PR: feat: verify Cloud Hypervisor runtime confinement)
Overall: PASS cc @lpcox
|
Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "msfeed25.pkgs.visualstudio.com"
- "registry.npmjs.org"See Network Configuration for more information.
|
|
Smoke Test: Docker Sbx Validation
Overall: PASS cc @lpcox
|
|
@lpcox
|
|
OTel Tracing Smoke Test Results (PR #7889)
All core scenarios pass; no regressions detected.
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environments.
|
|
GitHub MCP Testing: ❌
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Maven required
|
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>
Summary
virtiofsdorvm.createNoNewPrivs, v53vmmandhttp-serverseccomp filters, network namespace inode, and exact cgroup membership and limitsconfinement.jsonevidence in run diagnostics and document the runtime boundaryCapability 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 falsenpm run type-check -- --pretty falsenpm run lint -- --quietnpm run lint:md -- docs/cloud-hypervisor-foundation.md