feat: verify virtiofsd sandbox confinement before VM boot - #7890
Conversation
Fail closed before VM creation unless every virtiofsd parent and worker matches the expected process identity, capabilities, namespaces, root, cgroup, seccomp, and scrubbed environment. Preserve confinement evidence for runtime diagnostics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.86% | 93.77% | 📉 -0.09% |
| Statements | 92.67% | 92.57% | 📉 -0.10% |
| Functions | 93.24% | 93.28% | 📈 +0.04% |
| Branches | 86.14% | 85.94% | 📉 -0.20% |
📁 Per-file Coverage Changes (4 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cloud-hypervisor/manager-start.ts |
98.2% → 96.8% (-1.39%) | 98.3% → 97.0% (-1.34%) |
src/cloud-hypervisor/diagnostics.ts |
84.7% → 84.2% (-0.49%) | 82.8% → 81.8% (-0.94%) |
src/cloud-hypervisor/virtiofsd.ts |
77.7% → 78.5% (+0.78%) | 74.8% → 75.9% (+1.04%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (1 files)
src/cloud-hypervisor/virtiofsd-sandbox.ts: 85.4% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Worker capability verification is incomplete, and several security invariants lack negative coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/cloud-hypervisor/virtiofsd-sandbox.ts — The worker check ignores CapInh and CapBnd, even though both are collected as part of the… |
|
src/cloud-hypervisor/virtiofsd.test.ts — The added failure coverage only perturbs the environment and cgroup. None of the other security… |
What changed in this PR
Adds pre-boot verification and diagnostic evidence for Cloud Hypervisor virtiofsd sandbox confinement.
Changes:
- Verifies process identity, capabilities, namespaces, cgroups, environment, and export root.
- Persists confinement evidence before VM creation and during startup failures.
- Adds orchestration tests and documents the security boundary.
| File | Description |
|---|---|
src/cloud-hypervisor/vm-config-builder.test.ts |
Updates device fixture with evidence path. |
src/cloud-hypervisor/virtiofsd.ts |
Integrates verification and evidence tracking. |
src/cloud-hypervisor/virtiofsd.test.ts |
Tests failure handling and evidence creation. |
src/cloud-hypervisor/virtiofsd-sandbox.ts |
Implements procfs confinement verification. |
src/cloud-hypervisor/manager.test.ts |
Tests startup evidence preservation. |
src/cloud-hypervisor/manager-start.ts |
Preserves evidence before cleanup. |
src/cloud-hypervisor/diagnostics.ts |
Copies evidence into diagnostics. |
docs/cloud-hypervisor-foundation.md |
Documents confinement guarantees. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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>
Require empty worker inheritable capabilities and a bounding set that contains the reviewed runtime mask. Expand negative-path coverage across every confinement invariant. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (4 files)
✨ New Files (1 files)
Coverage comparison generated by |
|
🛡️ 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.
|
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓
|
|
✨ 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.
|
|
❌ Contribution Check failed. Please review the logs for details.
|
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
✅ Build Test Suite completed successfully!
|
|
✅ 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.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🚀 Security Guard has started processing this pull request |
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: 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: 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) with api-proxy sidecar. All systems nominal.
|
Smoke Test: API Proxy OTEL Tracing — Results
Overall: All 5 scenarios pass. No issues found.
|
|
Docker Sbx Smoke Test — @lpcox
Overall: PASS
|
|
fix: filter workflow commands from microVM output GitHub MCP review: ❌ Overall: FAIL 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.
|
|
fix: filter workflow commands from microVM output (PR #7892): ✅ Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java initially failed with
|
|
Smoke Test: Copilot Engine — @lpcox
Overall: PASS
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
|
fix: filter workflow commands from microVM output — ❌
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environments.
|


Summary
/procbefore its socket entersvm.createNoNewPrivs, seccomp filter mode, isolated mount/PID/network namespaces, pivoted export root, exact cgroup v2 membership, and a scrubbed environmentThe verification model follows
github/agent-microvmv0.9.0 commit9ca223049a3af490df168cbb74233ab438aceefb.Validation
npm test -- --runInBand(329 suites, 5277 tests)npm run type-check -- --pretty falsenpm run build -- --pretty false