microsandbox-rb 0.16.0 → 0.17.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 +98 -0
- data/Cargo.lock +194 -158
- data/DESIGN.md +1 -1
- data/README.md +46 -3
- data/ext/microsandbox/Cargo.toml +4 -4
- data/ext/microsandbox/src/error.rs +7 -0
- data/ext/microsandbox/src/sandbox.rs +82 -0
- data/lib/microsandbox/outbound_proxy.rb +332 -0
- data/lib/microsandbox/sandbox.rb +20 -1
- data/lib/microsandbox/version.rb +2 -2
- data/lib/microsandbox.rb +1 -0
- data/sig/microsandbox.rbs +40 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37f44ca952f2885719237b06ea10b5316c383fee0a2fdfa5c51c76fd295c1591
|
|
4
|
+
data.tar.gz: 81e55203c1aea73d0368d93d7c36c73015b9a5a97634b69a3f5d805a48c7446c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49876e1d24e9e64ab486932f6180c511ea5142a93f8b1c0edb67f04847b861310a4972046b08babe11679f88835883fa80b739fd2f8d5f7ff5d49316f6c26c8d
|
|
7
|
+
data.tar.gz: 3bf053fb8c2e63099c128655fce91335c3ce35c7459af3616acad7d3b773f32184107740c124df2e7f122053d807f74c2d9f6337f66d0c6ed9121c4ddadd2eb3
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,104 @@ All notable changes to this gem are documented here. The format is based on
|
|
|
6
6
|
microsandbox runtime it embeds; each release notes the upstream runtime tag it
|
|
7
7
|
wraps, and the README's Versioning section keeps the full gem→runtime map.
|
|
8
8
|
|
|
9
|
+
## [0.17.0] - 2026-09-13
|
|
10
|
+
|
|
11
|
+
Adopts upstream runtime **`v0.6.16` → `v0.6.18`**, stepping through the
|
|
12
|
+
intermediate tag (`v0.6.17` verified and committed on its own).
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Strict hostname policy** — `strict:` (Boolean, default `false`) on
|
|
17
|
+
`Sandbox.create` / `connect_or_create` / `create_with_progress` (upstream
|
|
18
|
+
`v0.6.18`, from the security fork-merge below). In strict mode a flow that the
|
|
19
|
+
egress policy allows *only* through a hostname rule must be backed by an
|
|
20
|
+
inspectable request authority — the plain-HTTP `Host` header, or SNI /
|
|
21
|
+
`:authority` under TLS interception. Without that visibility (bypassed or
|
|
22
|
+
non-intercepted HTTPS) the runtime fails closed *before* dialing upstream
|
|
23
|
+
instead of trusting opaque hostname evidence. Mirrors the Python SDK's
|
|
24
|
+
`Network(strict=...)`. An explicit `false` is sent as-is (not dropped), like
|
|
25
|
+
`trust_host_cas:`. Create-only in Ruby, matching the Python SDK's `modify`
|
|
26
|
+
surface (which does not expose `strict`); the core itself does carry a
|
|
27
|
+
generated `strict` field on its network config patch (`ConfigPatch` derive),
|
|
28
|
+
so this is an SDK-parity choice, not a core limitation. Accepted by the cloud
|
|
29
|
+
create contract (`CloudNetworkSpec.strict`), so there is no `UnsupportedError`
|
|
30
|
+
path.
|
|
31
|
+
|
|
32
|
+
- **Outbound SOCKS proxies** — `proxy:` on `Sandbox.create` /
|
|
33
|
+
`connect_or_create` / `create_with_progress` (upstream #1234 SOCKS4/SOCKS5
|
|
34
|
+
and #1507 SOCKS5 UDP + credentials, `v0.6.17`). The runtime's host-side
|
|
35
|
+
network stack dials the proxy for the sandbox's egress — SOCKS4 for TCP,
|
|
36
|
+
SOCKS5 for TCP and non-DNS UDP — uniformly for TLS-intercepted and
|
|
37
|
+
bypassed/plain TCP, while the egress policy (`network:`) still decides which
|
|
38
|
+
destinations may be reached. The address is resolved from the **host**
|
|
39
|
+
(`127.0.0.1` is the host's loopback). Spelled like the Python SDK's
|
|
40
|
+
`proxy=`, as a top-level create option rather than inside `network:`:
|
|
41
|
+
- `Microsandbox::OutboundProxy.socks4(address, user_id: nil)` and
|
|
42
|
+
`Microsandbox::OutboundProxy.socks5(address)`, the latter chaining
|
|
43
|
+
`#credentials(username, password)` which returns a **new** proxy (the
|
|
44
|
+
objects are immutable, like Python's frozen dataclass).
|
|
45
|
+
- `Microsandbox::SecretSource.env("VAR")` — the only password source: the
|
|
46
|
+
host environment variable's *name* is what reaches the runtime, which reads
|
|
47
|
+
the value host-side. No password value ever travels through the binding or
|
|
48
|
+
appears in `inspect`/error output.
|
|
49
|
+
- The equivalent plain Hash is accepted too: `{ protocol: :socks5,
|
|
50
|
+
address: "IP:port", credentials: { username:, password: { env: "VAR" } } }`
|
|
51
|
+
or `{ protocol: :socks4, address:, user_id: }`.
|
|
52
|
+
- Validation mirrors the Python SDK's `OutboundProxy.__post_init__`
|
|
53
|
+
(`ArgumentError`): `user_id` only for SOCKS4, credentials only for SOCKS5,
|
|
54
|
+
username and password together or neither, a non-empty String address.
|
|
55
|
+
`IP:port` parsing is left to the core, which reports an unparseable address
|
|
56
|
+
(or an invalid SOCKS4 user ID) at create time, before any boot; the binding
|
|
57
|
+
surfaces that as `InvalidConfigError` — a malformed proxy is a configuration
|
|
58
|
+
mistake, not a policy one — while every other network-builder error keeps
|
|
59
|
+
its `NetworkPolicyError` class. The cloud backend rejects the option with
|
|
60
|
+
`UnsupportedError` (`sandbox.create`, hint naming `network.outbound_proxy`).
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- **Plain-HTTP requests are now checked against the egress policy by their
|
|
65
|
+
`Host` / `:authority`, whenever the policy has any domain rule — in
|
|
66
|
+
non-strict mode too** (upstream `v0.6.18` hardening, `crates/network/lib/
|
|
67
|
+
tcp/proxy.rs`: `enforce_http_authority = network_policy.has_domain_rules()`).
|
|
68
|
+
Previously a plain-HTTP connection admitted by an IP/CIDR/group rule could
|
|
69
|
+
name any host in its `Host` header; now, if the policy carries `Domain` /
|
|
70
|
+
`DomainSuffix` rules (including `deny_domains:` / `deny_domain_suffixes:`,
|
|
71
|
+
which are domain rules), the request's authority is evaluated against the
|
|
72
|
+
**ordered** egress policy (rules first, then `default_egress`) together with
|
|
73
|
+
the real destination IP/port, and — for a request carrying valid authority
|
|
74
|
+
metadata — the request is denied only when that evaluation denies it.
|
|
75
|
+
Separately, a plain-HTTP request with a *missing*, *duplicate* or
|
|
76
|
+
*unparsable* `Host` / `:authority` is now rejected outright whenever domain
|
|
77
|
+
rules are present (the upstream validator requires exactly one well-formed
|
|
78
|
+
authority before any policy evaluation), so an HTTP/1.0 request without a
|
|
79
|
+
`Host` header no longer passes on such a policy. Existing IP/CIDR/group allows and a permissive
|
|
80
|
+
`default_egress` still count: a plain-HTTP request to an allowed IP that
|
|
81
|
+
sends an unrelated `Host` is still allowed unless a rule (or the default)
|
|
82
|
+
denies that hostname. Policies with no domain rules are unaffected, and so is
|
|
83
|
+
HTTPS without interception. What changes in practice: an IP-based request
|
|
84
|
+
whose `Host` names a host the ordered policy *denies* (a `deny_domains:`
|
|
85
|
+
entry, or a domain not matched by any allow under `default_egress: :deny`)
|
|
86
|
+
now fails even in non-strict mode — allow the hostname it actually sends.
|
|
87
|
+
`strict:` is not a substitute for a restrictive policy; it only tightens
|
|
88
|
+
hostname-rule allows that lack an inspectable authority.
|
|
89
|
+
|
|
90
|
+
### Security
|
|
91
|
+
|
|
92
|
+
- Runtime `v0.6.18` carries the upstream security fork-merge (`439a88a5`, no
|
|
93
|
+
public advisory identifier at the time of writing): aligns HTTP `Host` policy
|
|
94
|
+
checks with the rest of the egress enforcement (the Changed note above) and
|
|
95
|
+
adds the fail-closed pre-connect strict hostname mode (`strict:` above). No
|
|
96
|
+
gem-side change was needed beyond exposing `strict:`.
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
|
|
100
|
+
- Runtime `v0.6.17` restores the released database-migration order (upstream
|
|
101
|
+
#1517, fixing #1502): a local `~/.microsandbox` database last opened by an
|
|
102
|
+
upstream **`v0.6.15`** binary — typically the `msb` CLI, since this gem never
|
|
103
|
+
shipped `v0.6.15` on its own — failed to open under `v0.6.16` with "database
|
|
104
|
+
schema is newer than this msb binary". Any such database now migrates
|
|
105
|
+
forward cleanly on the next `require "microsandbox"` + first operation.
|
|
106
|
+
|
|
9
107
|
## [0.16.0] - 2026-09-01
|
|
10
108
|
|
|
11
109
|
Adopts upstream runtime **`v0.6.14` → `v0.6.16`**, stepping through the
|