Repository navigation
feat: add NVX Phase 3a confinement foundations - #8785
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 6b7bb21d-a74b-4061-b1d0-ae2a18df7a8c
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit e0d7799 |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.74% | 93.28% | 📉 -0.46% |
| Statements | 92.42% | 91.95% | 📉 -0.47% |
| Functions | 92.99% | 92.15% | 📉 -0.84% |
| Branches | 86.21% | 85.74% | 📉 -0.47% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (4 files)
src/nvx/artifact-manifest.ts: 86.0% linessrc/nvx/cleanup-record.ts: 81.5% linessrc/nvx/confinement.ts: 87.8% linessrc/nvx/preflight.ts: 56.2% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Snapshot permissions currently prevent launch, while trusted-tool and cleanup path validation leave security boundaries insufficiently enforced.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (5)
What changed in this PR
Adds Phase 3a foundations for an attested and host-confined NVX backend while keeping it unavailable from runtime selection.
Changes:
- Adds artifact attestation, snapshotting, and preflight validation.
- Adds constrained launch construction and live confinement verification.
- Defines durable cleanup records with supporting tests and documentation.
| File | Description |
|---|---|
src/nvx/preflight.ts |
Implements host and artifact preflight. |
src/nvx/preflight.test.ts |
Tests preflight failure paths. |
src/nvx/index.ts |
Exports Phase 3a APIs. |
src/nvx/confinement.ts |
Builds and verifies confinement. |
src/nvx/confinement.test.ts |
Tests launch and verification behavior. |
src/nvx/cleanup-record.ts |
Defines cleanup ownership records. |
src/nvx/cleanup-record.test.ts |
Tests cleanup-record validation. |
src/nvx/artifact-manifest.ts |
Defines the attested artifact manifest. |
src/nvx/artifact-manifest.test.ts |
Tests manifest validation. |
docs/nvx-security-design.md |
Documents the Phase 3a boundary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ...(resources.artifactSnapshot === undefined ? {} : { | ||
| artifactSnapshot: fileIdentity(resources.artifactSnapshot, 'artifactSnapshot'), | ||
| }), | ||
| ...(resources.runDirectory === undefined ? {} : { | ||
| runDirectory: fileIdentity(resources.runDirectory, 'runDirectory'), |
| assertAbsolutePath(options.nvxRoot, 'NVX trusted artifact root'); | ||
| assertAbsolutePath(options.runDirectory, 'NVX run directory'); |
| await fs.chmod(destination, name === 'launcher' || name === 'openvmm' ? 0o500 : 0o400); | ||
| copied[name] = destination; | ||
| } | ||
| const manifestPath = path.join(directory, 'manifest.json'); | ||
| const bundlePath = path.join(directory, 'manifest.sigstore.json'); | ||
| await fs.copyFile(options.manifestPath, manifestPath, constants.COPYFILE_EXCL); | ||
| await fs.copyFile( | ||
| options.artifactManifestBundlePath, | ||
| bundlePath, | ||
| constants.COPYFILE_EXCL, | ||
| ); | ||
| await fs.chmod(manifestPath, 0o400); | ||
| await fs.chmod(bundlePath, 0o400); | ||
| return { |
| readonly artifacts: Record<NvxTrustedArtifactName, { | ||
| readonly file: string; | ||
| readonly sha256: string; | ||
| }>; |
| - `src/nvx/preflight.ts` requires Linux x86_64, root, usable KVM and TUN | ||
| devices, cgroup v2 CPU/memory/PID controllers, seccomp support, trusted host | ||
| tools, a GitHub-verified AWF release attestation, and matching artifact | ||
| digests before copying the artifacts into a private per-run immutable | ||
| snapshot and re-verifying the copied bytes; |
|
@copilot address review feedback |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...
|
|
🛡️ 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.
|
|
✅ Build Test Suite completed successfully!
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
✅ 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.
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
|
🚀 Security Guard has started processing this pull request |
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
🛡️ 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.
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
✅ 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.
|
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.75% | 93.29% | 📉 -0.46% |
| Statements | 92.43% | 91.97% | 📉 -0.46% |
| Functions | 92.99% | 92.16% | 📉 -0.83% |
| Branches | 86.23% | 85.79% | 📉 -0.44% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/one-shot-adapter.ts |
80.4% → 79.8% (-0.58%) | 77.8% → 77.3% (-0.54%) |
src/log-directory-setup.ts |
96.2% → 100.0% (+3.78%) | 96.3% → 100.0% (+3.71%) |
✨ New Files (5 files)
src/nvx/artifact-manifest.ts: 86.9% linessrc/nvx/cleanup-record.ts: 82.9% linessrc/nvx/confinement.ts: 87.8% linessrc/nvx/paths.ts: 100.0% linessrc/nvx/preflight.ts: 61.0% lines
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
Smoke Test: Copilot Engine — @lpcox
Overall: PASS
|
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: Services Connectivity
Overall: PASS
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS cc @lpcox 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.
|
Copilot BYOK Smoke Test ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Status: PASS
|
📡 Smoke Test: API Proxy OTel Tracing — Results
Overall: all scenarios pass or are expected-pending during development. No regressions detected.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes:
|
|
Merged PR titles:
Warning Firewall blocked 7 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment.
|



Summary
setprivlaunch command plus live OpenVMM process/thread, namespace, capability, seccomp, and cgroup verificationScope
This is the bounded Phase 3a foundation only. It does not make
nvxselectable. Phase 3b must implement and live-test dedicated account lifecycle, serialized ACL-only device grants, cgroup application, host network policy, cleanup execution/stale recovery, and one-shot adapter integration on a GitHub-hosted x86_64 KVM runner.Managed/reusable NVX sessions remain explicitly out of scope.
Validation
npm run type-checknpm run buildnpm run lint -- --quietnpx markdownlint-cli2 docs/nvx-security-design.mdnpm test -- --runInBand src/nvx/artifact-manifest.test.ts src/nvx/confinement.test.ts src/nvx/cleanup-record.test.ts src/nvx/preflight.test.ts(27 tests)The full suite passes 6,029 tests on macOS but has four existing Phase 2 NVX failures because those tests require Linux
/procand descriptor traversal support. CI's Linux environment is the authoritative full-suite validation.