microsandbox-rb 0.17.4 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +378 -1
- data/Cargo.lock +747 -1134
- data/DESIGN.md +52 -36
- data/README.md +27 -20
- data/SECURITY.md +22 -6
- data/docs/configuration.md +153 -17
- data/docs/errors.md +8 -2
- data/docs/execution.md +17 -0
- data/docs/filesystem.md +2 -1
- data/docs/images.md +74 -2
- data/docs/lifecycle.md +130 -6
- data/docs/observability.md +9 -7
- data/docs/releasing.md +1 -1
- data/docs/runtime.md +126 -43
- data/docs/surface.md +55 -14
- data/ext/microsandbox/Cargo.toml +22 -20
- data/ext/microsandbox/extconf.rb +9 -8
- data/ext/microsandbox/src/backend.rs +21 -15
- data/ext/microsandbox/src/error.rs +59 -1
- data/ext/microsandbox/src/host_path.rs +37 -28
- data/ext/microsandbox/src/lib.rs +314 -42
- data/ext/microsandbox/src/runtime.rs +5 -5
- data/ext/microsandbox/src/sandbox.rs +508 -241
- data/ext/microsandbox/src/snapshot.rs +63 -20
- data/ext/microsandbox/src/storage.rs +44 -0
- data/lib/microsandbox/errors.rb +63 -0
- data/lib/microsandbox/exec_handle.rb +2 -1
- data/lib/microsandbox/runtime_info.rb +65 -0
- data/lib/microsandbox/sandbox.rb +544 -158
- data/lib/microsandbox/snapshot.rb +101 -28
- data/lib/microsandbox/storage.rb +205 -0
- data/lib/microsandbox/version.rb +5 -4
- data/lib/microsandbox.rb +259 -60
- data/rust-toolchain.toml +1 -1
- data/sig/microsandbox.rbs +113 -7
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15c0d3dfb3ff1630e8a023cbbd8175d7f29110c0c829677738e31adbeda7dfa9
|
|
4
|
+
data.tar.gz: 645bc3afc5cf2d4671c6ab7f77c47a694fa1a36fa10094beaec86b66395e1a5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9990e8846a7f281ca05d28bf3d3d38388d38256ce8a5e011499f9f1191f7a2143eb0fac34d3dd8cd19faedc9789b45b6c79798c6fefaed11abd6517d4b763830
|
|
7
|
+
data.tar.gz: 5dd9b6d7adec0080490a04032b3245596fb8fa2cdd43fd2a6cd14f493e26b27ef7efa02289845d11a039a1b95aac184ba2158cd8b5c171752d8ffb161131aae7
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,381 @@ wraps, and the README's Versioning section keeps the full gem→runtime map.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.18.0] - 2026-11-10
|
|
12
|
+
|
|
13
|
+
Adopts upstream runtime `v0.7.14` (from `v0.6.18`). **Breaking.** Runtime
|
|
14
|
+
`v0.7` replaces the secrets vocabulary and the snapshot model, refuses to
|
|
15
|
+
launch any `msb` other than the exact release this gem pins, and turns strict
|
|
16
|
+
hostname enforcement on by default. Migration notes are below.
|
|
17
|
+
|
|
18
|
+
### Breaking
|
|
19
|
+
|
|
20
|
+
- **Ruby 3.3 or newer is required** (both gems). Ruby 3.1 and 3.2 are
|
|
21
|
+
end-of-life, and on the `ubuntu-26.04` image setup-ruby ships no 3.1 build
|
|
22
|
+
while rb-sys's bindgen step fails on the 3.2 headers. CI now runs Ruby 3.3
|
|
23
|
+
and 3.4 on `ubuntu-latest` and `macos-15`.
|
|
24
|
+
- **Building the source gem needs Rust 1.94 or newer** (was 1.91): runtime
|
|
25
|
+
`v0.7` pulls sea-orm 2 / sqlx 0.9. The `extconf.rb` preflight says so up
|
|
26
|
+
front.
|
|
27
|
+
- **The runtime must be exactly `v0.7.14`.** The core reads the version
|
|
28
|
+
embedded in the `msb` executable and refuses every other runtime at launch
|
|
29
|
+
("does not advertise protected sandbox state" for a `0.6.x` or older `0.7.x`
|
|
30
|
+
one). `msb` wrapper scripts (`#!`) carry no version and are refused too.
|
|
31
|
+
The first-use bootstrap is now version-aware: a stale runtime in the runtime
|
|
32
|
+
home is replaced (`install(force: true)`, with a warning), while a stale
|
|
33
|
+
runtime from `MSB_PATH`, `runtime_path=` or the config file is never
|
|
34
|
+
touched — the SDK warns that every local sandbox start will be refused.
|
|
35
|
+
With `MICROSANDBOX_NO_AUTO_INSTALL` nothing is installed or replaced, and a
|
|
36
|
+
missing runtime surfaces as `RuntimeNotInstalledError` from the operation.
|
|
37
|
+
A runtime home holding only one of `bin/msb` and `lib/<libkrunfw>` raises
|
|
38
|
+
`RuntimeIncompleteError` naming the files to delete.
|
|
39
|
+
- **`Microsandbox.installed?` reports any complete runtime pair** (from
|
|
40
|
+
`MSB_PATH`, the binaries gem, configured paths or the runtime home), not
|
|
41
|
+
only one in `~/.microsandbox`, and says nothing about its version; see
|
|
42
|
+
`Microsandbox.runtime_info`. `msb` on `PATH` is no longer a runtime source.
|
|
43
|
+
- **Secrets use the runtime `v0.7` vocabulary.** A spec takes `env:`, `value:`
|
|
44
|
+
and a required, non-empty `allow:` list (exact hosts, `*.example.com`
|
|
45
|
+
wildcards, or `"*"` for any host), plus `allow_placeholder_for:`,
|
|
46
|
+
`placeholder:`, `require_tls_identity:`, `violation_action:` and
|
|
47
|
+
`substitution: { headers:, header_fields:, query:, body: }`. The 0.17 keys
|
|
48
|
+
(`host:`/`hosts:`/`host_patterns:`, `inject_*:`, `require_tls:`,
|
|
49
|
+
`on_violation:`) raise `ArgumentError` naming their replacement.
|
|
50
|
+
`inject_basic_auth:` is gone and has no Basic-only equivalent: the
|
|
51
|
+
narrowest replacement, `substitution: { headers: true, header_fields:
|
|
52
|
+
["Authorization"], query: false, body: false }`, also substitutes a
|
|
53
|
+
non-Basic placeholder in that header (`Bearer`, `token`, …). The first
|
|
54
|
+
`v0.7` open of a 0.17.x home widens saved Basic-only secrets to every
|
|
55
|
+
header; see the migration notes.
|
|
56
|
+
- **`Sandbox.create(on_secret_violation:)` → `secret_violation_action:`**
|
|
57
|
+
(`:block`, `:block_and_log` — the default — or `:block_and_terminate`). The
|
|
58
|
+
passthrough policy is gone; list the hosts that may receive the unchanged
|
|
59
|
+
placeholder in each secret's `allow_placeholder_for:`.
|
|
60
|
+
- **`Sandbox.create(from_snapshot:)` is removed** and raises with directions:
|
|
61
|
+
boot from a snapshot with `Sandbox.restore(snapshot, name:)`. A restored
|
|
62
|
+
sandbox is detached upstream, so without a block it outlives your process.
|
|
63
|
+
- **`Snapshot.create(resumable:)` → `full:`.** `SnapshotInfo` gains `#id` and
|
|
64
|
+
`#parent_id`; `#scope` is `:disk` or `:full`; `#path` may be `nil`, and
|
|
65
|
+
`#parent_digest` is always `nil` (v0.7 descriptors link parents by id).
|
|
66
|
+
- **Snapshots live in groups, and a bare name selects a group head.**
|
|
67
|
+
`Snapshot.create(name, from_sandbox: src)` (and `SandboxHandle#snapshot`)
|
|
68
|
+
publishes the artifact into the group named after `src`, as member `name`,
|
|
69
|
+
and makes it the head. `open`/`get`/`verify`/`save`/`remove` therefore no
|
|
70
|
+
longer accept the create `name` on its own: select `"src:name"`, the
|
|
71
|
+
returned `SnapshotInfo#id` (now set on every local path, including
|
|
72
|
+
`get`/`list`/`load`), the digest, or the path. A loaded archive lands in a
|
|
73
|
+
fresh group with no head, so address it by id or path. `create(force: true)`
|
|
74
|
+
is rejected (grouped snapshots are immutable).
|
|
75
|
+
- **Strict hostname policy is on by default** (upstream #1643): a
|
|
76
|
+
hostname-rule allow must be backed by an inspectable request authority.
|
|
77
|
+
Pass `strict: false` to opt out.
|
|
78
|
+
- **`MSB_PATH` must name a complete runtime pair.** The core resolves `msb`
|
|
79
|
+
and `libkrunfw` together: the library must sit next to the executable (or
|
|
80
|
+
in `../lib/`), or be given with `MSB_LIBKRUNFW_PATH`; `MSB_LIBKRUNFW_PATH`
|
|
81
|
+
alone is an error. `Microsandbox.runtime_path` raises when no complete pair
|
|
82
|
+
resolves, and the local backend reads `MSB_PATH` (like `MSB_HOME` and the
|
|
83
|
+
config file) once, when it is first used in a process. When they change
|
|
84
|
+
after that, the first-use bootstrap raises `InvalidConfigError` instead of
|
|
85
|
+
checking or replacing a runtime the backend will not launch;
|
|
86
|
+
`Microsandbox.set_default_backend(:local)` rebuilds the backend.
|
|
87
|
+
- **A bind mount whose host path goes through a symlink is refused** unless
|
|
88
|
+
the mount sets `follow_root_symlinks: true` (e.g. macOS's `/tmp`, `/var`);
|
|
89
|
+
pass the resolved path.
|
|
90
|
+
- `Microsandbox.default_backend_kind` / `default_backend_info` raise on a
|
|
91
|
+
misconfigured backend selection instead of reporting `:cloud`.
|
|
92
|
+
- Ruby `ExecStdin#write("")` is a no-op; it used to send EOF. Call `#close`.
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- **`Sandbox.restore(snapshot, name:, ...)`** boots a new sandbox from a
|
|
97
|
+
snapshot (a `SnapshotInfo`, id, `"group:member"`, digest or path; a relative
|
|
98
|
+
path is anchored when called). Destination options: `cpus:`, `memory:`,
|
|
99
|
+
`user:`, `log_level:`, `max_duration:`, `idle_timeout:`, `volumes:`,
|
|
100
|
+
`ports:`, `disable_network:`, `cow_memory:` (`forked:` is a deprecated
|
|
101
|
+
alias), `disk_only:`, `snapshot_base:`, `allow_missing_resources:`,
|
|
102
|
+
`external_mount_policy:`. A captured bind or named mount needs a
|
|
103
|
+
destination in `volumes:` (or `allow_missing_resources: true`), otherwise
|
|
104
|
+
`InvalidConfigError`. The block form stops the sandbox on exit. See
|
|
105
|
+
`docs/images.md#restoring-a-snapshot`.
|
|
106
|
+
- **`Sandbox#stop_with_timeout(seconds)` / `#kill_with_timeout(seconds)`** on
|
|
107
|
+
the live sandbox (they were on `SandboxHandle` only; on both, the budget now
|
|
108
|
+
covers the whole call, waiting for the transition lock included), and
|
|
109
|
+
**`Sandbox::BLOCK_STOP_TIMEOUT`** (10).
|
|
110
|
+
- **`Snapshot.create(guest_flush:)`** (`:auto`, `:required`, `:skip`) and
|
|
111
|
+
**`SnapshotInfo#reference`** / **`#reference_kind`**, the reference
|
|
112
|
+
`Sandbox.restore` takes back.
|
|
113
|
+
- **`Microsandbox.runtime_info`** → `Microsandbox::RuntimeInfo`: the resolved
|
|
114
|
+
`msb` + `libkrunfw` pair, where it came from (`origin`: `:environment`,
|
|
115
|
+
`:sdk_package`, `:configuration`, `:home` or `:installed` — classified by the
|
|
116
|
+
SDK, see `docs/runtime.md`), and the version embedded in the `msb`
|
|
117
|
+
(`version`, `legacy?`, `matches_sdk?`). Reads files only.
|
|
118
|
+
- **`Microsandbox.install(force: true)`** reinstalls the runtime into the home.
|
|
119
|
+
- **`Sandbox.recover_storage(name, selections:, accept_selected_view:,
|
|
120
|
+
legacy_writers_stopped:)`** and **`Microsandbox.diagnose_storage(names:,
|
|
121
|
+
all_sandboxes:, home:)`** (→ `StorageRecovery` / `StorageDiagnosis`):
|
|
122
|
+
inspect and import the storage of sandboxes created before 0.18.0 into the
|
|
123
|
+
runtime `v0.7` protected layout without booting them. Linux migrates on the
|
|
124
|
+
next start; macOS needs the explicit recovery. See
|
|
125
|
+
`docs/lifecycle.md#upgrading-sandboxes-created-before-0180`.
|
|
126
|
+
- **`Sandbox.create(max_tcp_connections:, max_udp_connections:)`**: caps on
|
|
127
|
+
proxied TCP connections and UDP relay sessions (`0` = unlimited, omitted =
|
|
128
|
+
the runtime default).
|
|
129
|
+
- **`Sandbox.create(http:)`**: how a denied request is answered —
|
|
130
|
+
`deny_response:` (`false` closes the connection, as before 0.18.0),
|
|
131
|
+
`format:` (`:json` or `:text`), and the JSON `network_message:` /
|
|
132
|
+
`secret_message:`. Local-only: a cloud create accepts only the defaults or
|
|
133
|
+
`deny_response: false`. See `docs/configuration.md#http-deny-response`.
|
|
134
|
+
- **Error classes for the v0.7 core variants**, mirroring the Python SDK:
|
|
135
|
+
`RuntimeNotInstalledError` (`runtime-not-installed`),
|
|
136
|
+
`RuntimeIncompleteError` (`runtime-incomplete` — e.g. an `MSB_PATH` with no
|
|
137
|
+
matching `libkrunfw`), `StopTimeoutError`
|
|
138
|
+
(`stop-timeout`), `SnapshotSourceRecoveryError`
|
|
139
|
+
(`snapshot-source-recovery`, with the recovery locator as attributes) and
|
|
140
|
+
the cloud-only `ModificationNotConfirmedError`
|
|
141
|
+
(`modification-not-confirmed`). `SandboxStopTimedOutError`
|
|
142
|
+
(`sandbox-stop-timed-out`) is reserved: the core does not raise it yet.
|
|
143
|
+
|
|
144
|
+
### Changed
|
|
145
|
+
|
|
146
|
+
- **A graceful stop never escalates to a kill** (runtime `v0.7`). `#stop`
|
|
147
|
+
waits without a deadline; `stop_with_timeout` and `restart`/`destroy`'s
|
|
148
|
+
`timeout:` raise `StopTimeoutError` on expiry and kill nothing. The block
|
|
149
|
+
forms of `create`, `connect_or_create` and `restore` therefore stop with a
|
|
150
|
+
`BLOCK_STOP_TIMEOUT` budget and then kill with a 15-second budget, both
|
|
151
|
+
covering the sandbox's transition lock, so a block exit cannot hang; an
|
|
152
|
+
interrupted create does the same. When that kill fails or runs out of time
|
|
153
|
+
the SDK warns (`cleanup gave up on sandbox "<name>", which may still be
|
|
154
|
+
running`) instead of raising over the block's own result or exception.
|
|
155
|
+
`#kill` keeps upstream's behaviour: it waits for the transition lock without
|
|
156
|
+
a deadline, then up to 5 seconds to see the sandbox stopped;
|
|
157
|
+
`#kill_with_timeout(n)` bounds the whole call, lock included.
|
|
158
|
+
`create(replace: true)` is the exception and still escalates when the name
|
|
159
|
+
is held by a running sandbox: `TERM`, a grace of `replace_with_timeout:`
|
|
160
|
+
(10 seconds by default; `0` skips the `TERM`), `KILL`, then 5 seconds to
|
|
161
|
+
prove the runtime exited. If it has not, the create raises
|
|
162
|
+
`SandboxStillRunningError`, as it does when an untracked runtime endpoint
|
|
163
|
+
may still be live; a failed signal raises its own error. This is separate
|
|
164
|
+
from `stop_with_timeout` and from `Snapshot.create`'s `force:`.
|
|
165
|
+
- **A request the network policy denies gets an HTTP `403` with a JSON body**
|
|
166
|
+
(`code: "network_policy_denied"`) instead of a reset, when it is plain HTTP
|
|
167
|
+
or HTTPS under TLS interception; a secret-policy block is answered the same
|
|
168
|
+
way. This applies to sandboxes created by 0.17.x too, from their next start.
|
|
169
|
+
Pass `http: { deny_response: false }` for the old behaviour.
|
|
170
|
+
- The transient error right after boot, before a sandbox's metrics slot is
|
|
171
|
+
live, now reads `sandbox N has no verified live metrics slot` (it was
|
|
172
|
+
`… has no live metrics slot`); code that retries on the message must match
|
|
173
|
+
the new text (`/no (verified )?live metrics slot/`). See
|
|
174
|
+
`docs/observability.md`.
|
|
175
|
+
- Execution flow control is fixed by the runtime: at most 128 executions per
|
|
176
|
+
sandbox (exited streams with unread output included), 64 KiB of pending
|
|
177
|
+
stdin, 1 MiB of unread output, 16 KiB chunks. See `docs/execution.md`.
|
|
178
|
+
- `Microsandbox.install` checks the runtime home itself (the exact two files
|
|
179
|
+
the resolver expects there) and downloads only when the pair is missing or
|
|
180
|
+
another version; a current pair is kept, as documented. Non-forced
|
|
181
|
+
`Microsandbox.setup` keeps any complete pair in the target home, and
|
|
182
|
+
`setup(version:)` warns when the version is not the SDK's runtime.
|
|
183
|
+
- The `microsandbox-rb-binaries` gem now claims the `libkrunfw` SDK slot as
|
|
184
|
+
well as the `msb` one (unless `MSB_PATH` is set when `microsandbox` is
|
|
185
|
+
required), so `Microsandbox.libkrunfw_path=` is a no-op with it, like
|
|
186
|
+
`runtime_path=`.
|
|
187
|
+
- **SSH `exec`/`attach` report abnormal exits** (upstream #2011) instead of
|
|
188
|
+
a success: the guest agent's exit code `-1` (a command killed by a signal,
|
|
189
|
+
or a lost exit notification) becomes status `1` — `exec("kill -KILL $$")`
|
|
190
|
+
returns `1` —, an exit signal the SSH channel reports becomes
|
|
191
|
+
`128 + <signal number>` (`128` for an unknown signal name), and a channel
|
|
192
|
+
that closes with no exit status raises.
|
|
193
|
+
- The runtime's cloud backend now implements `modify` for secrets (upstream
|
|
194
|
+
#1849): `secrets:`/`remove_secrets:` on a cloud sandbox go to the cloud API
|
|
195
|
+
(no gem change; not exercised by this gem's tests), other fields still
|
|
196
|
+
raise `UnsupportedError` there, and a change the cloud did not confirm
|
|
197
|
+
raises `ModificationNotConfirmedError`.
|
|
198
|
+
- `modify(labels:)` on a running sandbox applies live (upstream #1881) instead
|
|
199
|
+
of at the next start. `modify` refuses an empty label key and the reserved
|
|
200
|
+
`sandbox.`/`microsandbox.`/`service.` prefixes (#1857), and `create`/`modify`
|
|
201
|
+
refuse env the guest cannot boot with: an empty key, a key containing `=`
|
|
202
|
+
or NUL, or a value containing NUL (#1863). Nothing is saved; removing such
|
|
203
|
+
a key stays allowed.
|
|
204
|
+
- The runtime configuration can restrict backends (`allowed_backends`,
|
|
205
|
+
upstream #1898, in the user or managed config file); resolving a backend it
|
|
206
|
+
does not allow raises a configuration error.
|
|
207
|
+
- Published ports: finished inbound TCP connections free their slot at once,
|
|
208
|
+
and the inbound limit (256 before) is unlimited by default (upstream #1815;
|
|
209
|
+
the knob itself is not bound yet).
|
|
210
|
+
|
|
211
|
+
### Fixed
|
|
212
|
+
|
|
213
|
+
- On a runtime home where no install ever ran (the runtime came from
|
|
214
|
+
`MSB_PATH` or the binaries gem), creating a sandbox from a directory or disk
|
|
215
|
+
image failed with `No such file or directory`: runtime `v0.7.14` creates the
|
|
216
|
+
sandboxes directory only on the OCI path
|
|
217
|
+
([superradcompany/microsandbox#2041](https://github.com/superradcompany/microsandbox/issues/2041)).
|
|
218
|
+
The SDK creates `<home>/sandboxes` before every local create once a runtime
|
|
219
|
+
resolves.
|
|
220
|
+
- Runtime fixes that clear the known issues of 0.17.x: on macOS hosts a guest
|
|
221
|
+
`fallocate` no longer truncates a file on a bind mount or directory-backed
|
|
222
|
+
volume (upstream `v0.7.0`); `modify(secrets:)` that adds a sandbox's first
|
|
223
|
+
secret turns TLS interception on, so the value is substituted (`v0.7.3`);
|
|
224
|
+
`patches:` keeps the image's owner and mode on parent directories that
|
|
225
|
+
already exist (`v0.7.5`).
|
|
226
|
+
|
|
227
|
+
### Deprecated
|
|
228
|
+
|
|
229
|
+
- `Sandbox.create(max_connections:)`: an alias of `max_tcp_connections:` that
|
|
230
|
+
warns; passing both raises `ArgumentError`.
|
|
231
|
+
- A secret's `passthrough:` key: an alias of `allow_placeholder_for:` that
|
|
232
|
+
warns; the two lists are merged.
|
|
233
|
+
|
|
234
|
+
### Security
|
|
235
|
+
|
|
236
|
+
- `deny.toml` ignores RUSTSEC-2026-0459 (libsqlite3-sys): sqlx-sqlite 0.9.0
|
|
237
|
+
caps it below the fixed release, exploiting it needs a less-trusted writer
|
|
238
|
+
of the catalog database and its WAL, and the catalog directory has been
|
|
239
|
+
owner-only since runtime `v0.7.12`. The three zstd ignores of 0.17.5 are
|
|
240
|
+
gone: the runtime's external-kernel path (msb_krun_vmm 0.1.45) now pulls
|
|
241
|
+
zstd 0.13.4 / zstd-safe 7.4.0, which carry the fixes.
|
|
242
|
+
|
|
243
|
+
### Known issues
|
|
244
|
+
|
|
245
|
+
- On Linux, a detached sandbox (`detached: true`, `Sandbox.start(detached:
|
|
246
|
+
true)`, `#detach`, or a no-block `Sandbox.restore`) leaves a `<defunct>` VM
|
|
247
|
+
child in the SDK process after it stops, until that process exits
|
|
248
|
+
([superradcompany/microsandbox#1950](https://github.com/superradcompany/microsandbox/issues/1950),
|
|
249
|
+
open upstream). macOS reaps them. Long-running Ruby processes that create
|
|
250
|
+
many detached sandboxes accumulate zombies.
|
|
251
|
+
|
|
252
|
+
### Migration notes
|
|
253
|
+
|
|
254
|
+
- Rewrite secret specs with the table in
|
|
255
|
+
`docs/configuration.md#migrating-secrets-from-017x`.
|
|
256
|
+
- **Basic-only secrets** (`inject_basic_auth: true` without `inject_headers:
|
|
257
|
+
true`): rewrite them with `substitution: { headers: true, header_fields:
|
|
258
|
+
["Authorization"], query: false, body: false }`, never a bare `headers:
|
|
259
|
+
true`. Saved sandboxes need more: the first `v0.7` runtime to open a 0.17.x
|
|
260
|
+
home converts each saved Basic-only secret to substitution in every header,
|
|
261
|
+
with no allowlist (upstream migration `migrate_secret_config`), and
|
|
262
|
+
`modify` cannot narrow it. List those sandboxes with 0.17.x before
|
|
263
|
+
upgrading, then remove and recreate each with the recipe before it starts
|
|
264
|
+
again; `docs/configuration.md#basic-only-secrets-inject_basic_auth` has the
|
|
265
|
+
listing snippet.
|
|
266
|
+
- Replace `on_secret_violation:` with `secret_violation_action:`, and
|
|
267
|
+
`Snapshot.create(resumable: true)` with `full: true`.
|
|
268
|
+
- Keep `SnapshotInfo#id` from `Snapshot.create` and pass it (or
|
|
269
|
+
`"<source-sandbox>:<name>"`) wherever a snapshot name was passed before.
|
|
270
|
+
- Select a snapshot made by 0.17.x by its path, or pass the `SnapshotInfo`
|
|
271
|
+
from `Snapshot.list`: it is in no group, so its bare name raises
|
|
272
|
+
`InvalidConfigError` (the message names the path), and runtime `v0.7`
|
|
273
|
+
re-indexes it under a new digest and a `snap_…` id, so a digest recorded
|
|
274
|
+
under 0.17.x stops selecting it once the snapshot has been opened
|
|
275
|
+
(`Snapshot.list` reports a digest-shaped `sha256:…` id for it until it is
|
|
276
|
+
first opened, and a `snap_…` id afterwards). Its
|
|
277
|
+
files stay where they were. When the same artifact exists twice in a home
|
|
278
|
+
(for example after `Snapshot.load` of its own archive), its id and digest
|
|
279
|
+
are ambiguous: select it by path.
|
|
280
|
+
- Replace `Sandbox.create(name, from_snapshot: snap)` with
|
|
281
|
+
`Sandbox.restore(snap_info_or_id, name: name)`. Pass only destination
|
|
282
|
+
options; give captured bind/named mounts a destination in `volumes:`. Stop
|
|
283
|
+
a sandbox restored without a block yourself (or use the block form).
|
|
284
|
+
- Give `MSB_PATH` its `libkrunfw` (next to it, in `../lib/`, or via
|
|
285
|
+
`MSB_LIBKRUNFW_PATH`).
|
|
286
|
+
- Pass `strict: false` where a hostname-rule allow must keep working without
|
|
287
|
+
an inspectable authority.
|
|
288
|
+
- An older runtime in the runtime home is replaced on first use (or run
|
|
289
|
+
`Microsandbox.install` ahead of time). Point `MSB_PATH`, `runtime_path=` or
|
|
290
|
+
configured paths at a `v0.7.14` runtime yourself; with
|
|
291
|
+
`MICROSANDBOX_NO_AUTO_INSTALL`, provision `v0.7.14` out of band.
|
|
292
|
+
- Code that provisions the runtime home should call `Microsandbox.install`
|
|
293
|
+
unconditionally instead of guarding it with `installed?`: it is idempotent,
|
|
294
|
+
keeps a current pair and replaces a stale one, even when `MSB_PATH` or the
|
|
295
|
+
binaries gem shadows the home. `runtime_info` / `#matches_sdk?` describe
|
|
296
|
+
the *selected* pair, from whichever source wins, so they cannot tell you
|
|
297
|
+
whether the home is installed or current.
|
|
298
|
+
- On macOS, before starting a sandbox created by 0.17.x or earlier: stop
|
|
299
|
+
every pre-0.18 VM in every runtime home, then run
|
|
300
|
+
`Sandbox.recover_storage(name, legacy_writers_stopped: true)` for each
|
|
301
|
+
stopped sandbox (`Microsandbox.diagnose_storage(all_sandboxes: true)` lists
|
|
302
|
+
which need it — it reads a 0.17.x home without migrating it). Until then
|
|
303
|
+
`start` raises `Microsandbox::Error` ("macOS legacy storage requires
|
|
304
|
+
explicit maintenance recovery …"). The recovery keeps the original disks
|
|
305
|
+
and does not boot the sandbox; afterwards it starts normally, secrets
|
|
306
|
+
included. On Linux the move happens on the next start.
|
|
307
|
+
- A VM that 0.17.x started and that is still running keeps working for
|
|
308
|
+
`exec` and stop, but cannot be snapshotted, forked or have its disk grown
|
|
309
|
+
until it is stopped and started again under 0.18.0.
|
|
310
|
+
- The upgrade is one-way. The first `v0.7` runtime to open a runtime home
|
|
311
|
+
applies eight catalog migrations (`split_snapshot_identity`,
|
|
312
|
+
`snapshot_groups`, `migrate_secret_config`, `guest_clock_config`,
|
|
313
|
+
`sandbox_caller_config_overrides`, `sandbox_creation`, `volume_creation`,
|
|
314
|
+
`protected_sandbox_state`); 0.17.x then fails there with `database schema is
|
|
315
|
+
newer than this msb binary`. The first open also makes the catalog
|
|
316
|
+
owner-only (`0700` directory, `0600` files). Back the home up first, and
|
|
317
|
+
restore a backup to the same path: the catalog and image cache store
|
|
318
|
+
absolute paths into the home. To try 0.18.0 side by side, give it a
|
|
319
|
+
separate `MSB_HOME`.
|
|
320
|
+
- The runtime home must be private: no group- or world-writable ancestor
|
|
321
|
+
without the sticky bit.
|
|
322
|
+
- Denied plain-HTTP (and intercepted HTTPS) requests now get a JSON `403`,
|
|
323
|
+
in old sandboxes too (a 0.17.x sandbox answers a request to a private
|
|
324
|
+
address its stored policy denies with `network_policy_denied`); pass
|
|
325
|
+
`http: { deny_response: false }` where clients relied on the reset.
|
|
326
|
+
- Send EOF with `ExecStdin#close`; `write("")` no longer closes stdin.
|
|
327
|
+
- SSH `exec` of a command that dies abnormally now returns a non-zero
|
|
328
|
+
status (`1`, or `128 + <signal>` when the channel reports the signal)
|
|
329
|
+
instead of `0`; check `#success?` rather than a specific code.
|
|
330
|
+
- Executions are capped by the runtime (128 per sandbox, unread exited
|
|
331
|
+
streams included; 64 KiB pending stdin; 1 MiB unread output): drain or
|
|
332
|
+
close streams you start, and don't keep more than 128 open.
|
|
333
|
+
- Upgrade Ruby to 3.3 or newer first; Ruby 3.1 and 3.2 are not supported.
|
|
334
|
+
|
|
335
|
+
## [0.17.5] - 2026-10-27
|
|
336
|
+
|
|
337
|
+
Gem-only security release; the embedded runtime stays at **`v0.6.18`**.
|
|
338
|
+
Dependency updates clear ten new RustSec advisories, RUSTSEC-2026-0381 to
|
|
339
|
+
-0410. They include the zstd copy that decompresses pulled image layers.
|
|
340
|
+
Three zstd advisories remain on a second copy that sits only on an
|
|
341
|
+
external-kernel path the runtime never takes (see Security). `SECURITY.md`
|
|
342
|
+
now maps four more upstream advisories to gem versions.
|
|
343
|
+
|
|
344
|
+
### Security
|
|
345
|
+
|
|
346
|
+
- **zstd 0.13.3 → 0.14.3, zstd-safe 7.2.4 → 8.2.0 and zstd-sys 2.0.16 →
|
|
347
|
+
2.1.2 for image-layer decompression** (transitive, through
|
|
348
|
+
async-compression 0.4.51 / compression-codecs 0.4.46). The SDK decompresses
|
|
349
|
+
pulled OCI image layers through these, so this fixes RUSTSEC-2026-0391
|
|
350
|
+
(data from an abandoned stream leaked into the next stream on a reused
|
|
351
|
+
context), RUSTSEC-2026-0398 (`Seekable::decompress` set a `Vec` length past
|
|
352
|
+
its capacity) and RUSTSEC-2026-0403 (uninitialized memory exposed when
|
|
353
|
+
streaming decompression of a legacy frame failed) on that path. The
|
|
354
|
+
zstd-sys bump also fixes RUSTSEC-2026-0410 (its WebAssembly allocator shim
|
|
355
|
+
corrupted memory on allocation failure) for every zstd user in the build.
|
|
356
|
+
- **rustls-webpki 0.103.15 → 0.103.16, webpki-roots and webpki-root-certs
|
|
357
|
+
1.0.7 → 1.0.11** (transitive, through the TLS stack: the HTTP clients and
|
|
358
|
+
the network stack's DNS client). Fixes RUSTSEC-2026-0382 (certificate
|
|
359
|
+
verification could accept distrusted intermediates) and RUSTSEC-2026-0381 /
|
|
360
|
+
RUSTSEC-2026-0383 (the bundled root certificates trusted distrusted emSign
|
|
361
|
+
intermediates).
|
|
362
|
+
- **tokio 1.53.2 → 1.54.1.** Fixes RUSTSEC-2026-0386 (`AsyncFd::new` and
|
|
363
|
+
related constructors violated I/O safety).
|
|
364
|
+
- **crypto-bigint 0.7.5 → 0.7.10 and ctutils 0.4.2 → 0.4.6** (transitive,
|
|
365
|
+
through the SSH client, russh). Fixes RUSTSEC-2026-0387 and
|
|
366
|
+
RUSTSEC-2026-0385 (timing variability in operations meant to be constant
|
|
367
|
+
time). crypto-bigint 0.7.5 had also been yanked.
|
|
368
|
+
- **Not fixed: a second copy of zstd 0.13.3 / zstd-safe 7.2.4 stays in the
|
|
369
|
+
build** for RUSTSEC-2026-0391, -0398 and -0403. It comes only from the VM
|
|
370
|
+
monitor crate pinned by the embedded runtime `v0.6.18` (msb_krun_vmm
|
|
371
|
+
0.1.32; no release of it moves to zstd 0.14), which uses it on x86_64
|
|
372
|
+
solely to decompress an external zstd-compressed kernel image. The runtime
|
|
373
|
+
never configures one — it boots from libkrunfw — and VMs run in the `msb`
|
|
374
|
+
process, not in the gem. It will be re-checked on the next runtime
|
|
375
|
+
adoption.
|
|
376
|
+
|
|
377
|
+
### Docs
|
|
378
|
+
|
|
379
|
+
- **`SECURITY.md` maps four more upstream advisories to gem versions.** It
|
|
380
|
+
now lists GHSA-rh2c-vm8j-5gg6 (`Volume.fs` paths escaping the volume root:
|
|
381
|
+
affected `0.7.0`–`0.17.0`, mitigated in `0.17.1`; its upstream range is
|
|
382
|
+
incomplete), GHSA-v693-3rfr-6q3q (fixed from `0.9.2`) and
|
|
383
|
+
GHSA-89j4-256r-3pcq (fixed from `0.5.10`), and records that
|
|
384
|
+
GHSA-xgg5-hjwq-2gw8 affects no release of this gem.
|
|
385
|
+
|
|
11
386
|
## [0.17.4] - 2026-10-14
|
|
12
387
|
|
|
13
388
|
Gem-only fix release; the embedded runtime stays at **`v0.6.18`**. Fork safety
|
|
@@ -1579,7 +1954,9 @@ microsandbox runtime, aligned with the official Python/Node/Go SDKs.
|
|
|
1579
1954
|
core crate has Apple-native deps). Until precompiled gems are published,
|
|
1580
1955
|
installing from source requires a Rust toolchain (stable >= 1.91).
|
|
1581
1956
|
|
|
1582
|
-
[Unreleased]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.
|
|
1957
|
+
[Unreleased]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.18.0...HEAD
|
|
1958
|
+
[0.18.0]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.17.5...v0.18.0
|
|
1959
|
+
[0.17.5]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.17.4...v0.17.5
|
|
1583
1960
|
[0.17.4]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.17.3...v0.17.4
|
|
1584
1961
|
[0.17.3]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.17.2...v0.17.3
|
|
1585
1962
|
[0.17.2]: https://github.com/ya-luotao/microsandbox-rb/compare/v0.17.1...v0.17.2
|