-
Notifications
You must be signed in to change notification settings - Fork 0
fix: repair guest boot chain and harden host-side sandbox #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,9 @@ | |||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| Ignite runs JavaScript/TypeScript code inside isolated, hardware-virtualized microVMs rather than containers. It supports native **Firecracker** on Linux and Apple's **Virtualization.framework** on macOS out of the box, with zero external VM dependencies. | ||||||
| Ignite runs JavaScript/TypeScript code inside isolated, hardware-virtualized microVMs rather than containers. Execution currently requires a **Linux host with KVM**, using **Firecracker** as the hypervisor. | ||||||
|
|
||||||
| > **Status:** pre-1.0. A macOS backend built on Apple's `Virtualization.framework` is planned but **not implemented** — the platform selector is stubbed and returns a clear error. Bun is the only runtime `ignite setup` provisions today. | ||||||
|
|
||||||
| It is designed for systems that execute code you do not fully trust: | ||||||
|
|
||||||
|
|
@@ -28,18 +30,26 @@ It is designed for systems that execute code you do not fully trust: | |||||
|
|
||||||
| ## Key Features | ||||||
|
|
||||||
| - **Dual-Hypervisor Core**: Uses KVM-backed Firecracker on Linux, and native `Virtualization.framework` on macOS. | ||||||
| - **KVM-backed Firecracker**: Each service runs in its own microVM with a separate guest kernel. (A macOS `Virtualization.framework` backend is planned; see Status above.) | ||||||
| - **Host-Reliant Disk Mounts**: The guest microVM has no shell, utilities, or libraries. Service code and language runtimes (Bun, Node, Deno, QuickJS) are compiled on the host and attached as read-only virtual block devices (`/dev/vdb` and `/dev/vdc`). | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Describe runtime provisioning accurately. The supplied setup flow builds the guest agent, while runtime binaries come from the runtime directory. The phrase “language runtimes ... are compiled on the host” implies a build step that this workflow does not perform. Use “installed or downloaded on the host, then packaged into read-only block devices.” Proposed wording- Service code and language runtimes (Bun, Node, Deno, QuickJS) are compiled on the host and attached as read-only virtual block devices (`/dev/vdb` and `/dev/vdc`).
+ Service code and installed runtime binaries (Bun, Node, Deno, QuickJS) are packaged on the host and attached as read-only virtual block devices (`/dev/vdb` and `/dev/vdc`).Based on the supplied 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - **VSOCK Multiplexing**: Low-latency communication handshakes stream stdout/stderr and exit codes directly back to the host via virtual sockets, bypassing network interfaces. | ||||||
| - **Resource Enforcement**: `memoryMb` and `cpuLimit` are applied to Firecracker machine config, while `timeoutMs` is enforced by a host-side watchdog that force-terminates timed-out VMs. | ||||||
| - **Resource Enforcement**: `memoryMb` and `cpuLimit` are applied to Firecracker machine config, while `timeoutMs` is enforced by a host-side watchdog that force-terminates timed-out VMs. `cpuLimit` is rounded up to whole vCPUs, which is the only granularity Firecracker accepts. | ||||||
| - **Preflight & Metric Timelines**: Sub-millisecond logging of all VM lifecycle transitions (disk format, boot connect, execution, cleanup). | ||||||
|
|
||||||
| ## Quick Start | ||||||
|
|
||||||
| ### 1) Prerequisites | ||||||
|
|
||||||
| - **Linux**: KVM enabled (`/dev/kvm` accessible) and `e2fsprogs` installed. | ||||||
| - **macOS**: macOS 13 or later. | ||||||
| - Linux with KVM enabled (`/dev/kvm` accessible). | ||||||
| - `firecracker` on your `PATH`. | ||||||
| - `e2fsprogs` (provides `mke2fs`). | ||||||
| - The musl target for the static guest agent: `rustup target add x86_64-unknown-linux-musl`. | ||||||
| - An **uncompressed ELF `vmlinux`**. Distro `/boot/vmlinuz-*` files are | ||||||
| compressed bzImages that Firecracker cannot boot; extract one with the kernel | ||||||
| tree's `scripts/extract-vmlinux`, or use a prebuilt Firecracker kernel, then | ||||||
| point `IGNITE_KERNEL_PATH` (or `--kernel`) at it. | ||||||
|
|
||||||
| Run `ignite status` to check KVM access and Firecracker availability. | ||||||
|
|
||||||
| ### 2) Build from Source | ||||||
|
|
||||||
|
|
@@ -83,12 +93,20 @@ ignite run . --verbose | |||||
|
|
||||||
| ## Runtime Support | ||||||
|
|
||||||
| | Runtime | Supported versions | Default | | ||||||
| |---|---|---| | ||||||
| | Bun | `1.0`, `1.1`, `1.2`, `1.3` | `1.3` | | ||||||
| | Node | `18`, `20`, `22` | `20` | | ||||||
| | Deno | `1.40`, `1.41`, `1.42`, `2.0` | `2.0` | | ||||||
| | QuickJS | `2024-01-13`, `2023-12-09`, `latest` | `latest` | | ||||||
| | Runtime | Accepted versions | Default | Provisioned by `ignite setup` | | ||||||
| |---|---|---|---| | ||||||
| | Bun | `1.0`, `1.1`, `1.2`, `1.3` | `1.3` | Yes | | ||||||
| | Node | `18`, `20`, `22` | `20` | No — install manually | | ||||||
| | Deno | `1.40`, `1.41`, `1.42`, `2.0` | `2.0` | No — install manually | | ||||||
| | QuickJS | `2024-01-13`, `2023-12-09`, `latest` | `latest` | No — install manually | | ||||||
|
|
||||||
| Runtimes are read from `~/.ignite/runtimes/` (override with `IGNITE_RUNTIMES_ROOT`). | ||||||
| A pinned spec such as `bun@1.3` resolves to `runtimes/bun@1.3/` and falls back to | ||||||
| `runtimes/bun/` with a warning. Runtime binaries must be statically linked or | ||||||
| otherwise self-contained: the guest rootfs has no dynamic loader. | ||||||
|
|
||||||
| Only runtimes you install are available; `ignite setup` currently downloads Bun | ||||||
| only. | ||||||
|
|
||||||
| ## Documentation | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Make the static-link check fail when
readelffails.The step pipes
readelf -lintogrep. The exit status of a pipeline is the status of the last command, so areadelffailure (missing tool, unreadable file) is masked and the check reports success. Enablepipefailand inspect captured output instead.Also consider matching the segment tag
INTERPrather than the descriptive text, because the wording ofreadelfoutput can change between binutils versions.🛡️ Proposed hardening
- name: Verify guest agent links statically run: | + set -euo pipefail cargo build --release --bin ignite-guest-agent \ --target x86_64-unknown-linux-musl AGENT=target/x86_64-unknown-linux-musl/release/ignite-guest-agent file "$AGENT" - if readelf -l "$AGENT" | grep -qi 'interpreter'; then + HEADERS=$(readelf -l "$AGENT") + if grep -qE 'INTERP|interpreter' <<<"$HEADERS"; then echo "::error::Guest agent is dynamically linked. The guest rootfs has no dynamic loader, so it would fail to exec as init." exit 1 fi echo "Guest agent is statically linked."📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 15-59: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents