@bramvanoploo/sandbox-runtime 0.0.0-stage → 0.5.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.
Files changed (136) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +93 -2
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +285 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/index.d.ts +16 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +12 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/sandbox/credential-decode.d.ts +87 -0
  12. package/dist/sandbox/credential-decode.d.ts.map +1 -0
  13. package/dist/sandbox/credential-decode.js +143 -0
  14. package/dist/sandbox/credential-decode.js.map +1 -0
  15. package/dist/sandbox/credential-extract.d.ts +67 -0
  16. package/dist/sandbox/credential-extract.d.ts.map +1 -0
  17. package/dist/sandbox/credential-extract.js +122 -0
  18. package/dist/sandbox/credential-extract.js.map +1 -0
  19. package/dist/sandbox/credential-mask-env.d.ts +33 -0
  20. package/dist/sandbox/credential-mask-env.d.ts.map +1 -0
  21. package/dist/sandbox/credential-mask-env.js +155 -0
  22. package/dist/sandbox/credential-mask-env.js.map +1 -0
  23. package/dist/sandbox/credential-mask-files.d.ts +120 -0
  24. package/dist/sandbox/credential-mask-files.d.ts.map +1 -0
  25. package/dist/sandbox/credential-mask-files.js +285 -0
  26. package/dist/sandbox/credential-mask-files.js.map +1 -0
  27. package/dist/sandbox/credential-sentinel.d.ts +88 -0
  28. package/dist/sandbox/credential-sentinel.d.ts.map +1 -0
  29. package/dist/sandbox/credential-sentinel.js +177 -0
  30. package/dist/sandbox/credential-sentinel.js.map +1 -0
  31. package/dist/sandbox/domain-pattern.d.ts +36 -0
  32. package/dist/sandbox/domain-pattern.d.ts.map +1 -0
  33. package/dist/sandbox/domain-pattern.js +60 -0
  34. package/dist/sandbox/domain-pattern.js.map +1 -0
  35. package/dist/sandbox/generate-seccomp-filter.d.ts +20 -0
  36. package/dist/sandbox/generate-seccomp-filter.d.ts.map +1 -0
  37. package/dist/sandbox/generate-seccomp-filter.js +168 -0
  38. package/dist/sandbox/generate-seccomp-filter.js.map +1 -0
  39. package/dist/sandbox/http-proxy.d.ts +85 -0
  40. package/dist/sandbox/http-proxy.d.ts.map +1 -0
  41. package/dist/sandbox/http-proxy.js +379 -0
  42. package/dist/sandbox/http-proxy.js.map +1 -0
  43. package/dist/sandbox/linux-sandbox-utils.d.ts +162 -0
  44. package/dist/sandbox/linux-sandbox-utils.d.ts.map +1 -0
  45. package/dist/sandbox/linux-sandbox-utils.js +1179 -0
  46. package/dist/sandbox/linux-sandbox-utils.js.map +1 -0
  47. package/dist/sandbox/linux-violation-monitor.d.ts +48 -0
  48. package/dist/sandbox/linux-violation-monitor.d.ts.map +1 -0
  49. package/dist/sandbox/linux-violation-monitor.js +168 -0
  50. package/dist/sandbox/linux-violation-monitor.js.map +1 -0
  51. package/dist/sandbox/listen-in-range.d.ts +12 -0
  52. package/dist/sandbox/listen-in-range.d.ts.map +1 -0
  53. package/dist/sandbox/listen-in-range.js +43 -0
  54. package/dist/sandbox/listen-in-range.js.map +1 -0
  55. package/dist/sandbox/macos-sandbox-utils.d.ts +57 -0
  56. package/dist/sandbox/macos-sandbox-utils.d.ts.map +1 -0
  57. package/dist/sandbox/macos-sandbox-utils.js +810 -0
  58. package/dist/sandbox/macos-sandbox-utils.js.map +1 -0
  59. package/dist/sandbox/mitm-ca.d.ts +112 -0
  60. package/dist/sandbox/mitm-ca.d.ts.map +1 -0
  61. package/dist/sandbox/mitm-ca.js +380 -0
  62. package/dist/sandbox/mitm-ca.js.map +1 -0
  63. package/dist/sandbox/mitm-leaf.d.ts +28 -0
  64. package/dist/sandbox/mitm-leaf.d.ts.map +1 -0
  65. package/dist/sandbox/mitm-leaf.js +132 -0
  66. package/dist/sandbox/mitm-leaf.js.map +1 -0
  67. package/dist/sandbox/mux-proxy.d.ts +59 -0
  68. package/dist/sandbox/mux-proxy.d.ts.map +1 -0
  69. package/dist/sandbox/mux-proxy.js +161 -0
  70. package/dist/sandbox/mux-proxy.js.map +1 -0
  71. package/dist/sandbox/parent-proxy.d.ts +118 -0
  72. package/dist/sandbox/parent-proxy.d.ts.map +1 -0
  73. package/dist/sandbox/parent-proxy.js +469 -0
  74. package/dist/sandbox/parent-proxy.js.map +1 -0
  75. package/dist/sandbox/request-filter.d.ts +56 -0
  76. package/dist/sandbox/request-filter.d.ts.map +1 -0
  77. package/dist/sandbox/request-filter.js +109 -0
  78. package/dist/sandbox/request-filter.js.map +1 -0
  79. package/dist/sandbox/sandbox-config.d.ts +1347 -0
  80. package/dist/sandbox/sandbox-config.d.ts.map +1 -0
  81. package/dist/sandbox/sandbox-config.js +917 -0
  82. package/dist/sandbox/sandbox-config.js.map +1 -0
  83. package/dist/sandbox/sandbox-manager.d.ts +48 -0
  84. package/dist/sandbox/sandbox-manager.d.ts.map +1 -0
  85. package/dist/sandbox/sandbox-manager.js +1498 -0
  86. package/dist/sandbox/sandbox-manager.js.map +1 -0
  87. package/dist/sandbox/sandbox-schemas.d.ts +90 -0
  88. package/dist/sandbox/sandbox-schemas.d.ts.map +1 -0
  89. package/dist/sandbox/sandbox-schemas.js +3 -0
  90. package/dist/sandbox/sandbox-schemas.js.map +1 -0
  91. package/dist/sandbox/sandbox-temp-dir.d.ts +9 -0
  92. package/dist/sandbox/sandbox-temp-dir.d.ts.map +1 -0
  93. package/dist/sandbox/sandbox-temp-dir.js +73 -0
  94. package/dist/sandbox/sandbox-temp-dir.js.map +1 -0
  95. package/dist/sandbox/sandbox-utils.d.ts +121 -0
  96. package/dist/sandbox/sandbox-utils.d.ts.map +1 -0
  97. package/dist/sandbox/sandbox-utils.js +642 -0
  98. package/dist/sandbox/sandbox-utils.js.map +1 -0
  99. package/dist/sandbox/sandbox-violation-store.d.ts +19 -0
  100. package/dist/sandbox/sandbox-violation-store.d.ts.map +1 -0
  101. package/dist/sandbox/sandbox-violation-store.js +57 -0
  102. package/dist/sandbox/sandbox-violation-store.js.map +1 -0
  103. package/dist/sandbox/socks-proxy.d.ts +38 -0
  104. package/dist/sandbox/socks-proxy.d.ts.map +1 -0
  105. package/dist/sandbox/socks-proxy.js +123 -0
  106. package/dist/sandbox/socks-proxy.js.map +1 -0
  107. package/dist/sandbox/tls-terminate-proxy.d.ts +63 -0
  108. package/dist/sandbox/tls-terminate-proxy.d.ts.map +1 -0
  109. package/dist/sandbox/tls-terminate-proxy.js +332 -0
  110. package/dist/sandbox/tls-terminate-proxy.js.map +1 -0
  111. package/dist/sandbox/windows-sandbox-utils.d.ts +625 -0
  112. package/dist/sandbox/windows-sandbox-utils.d.ts.map +1 -0
  113. package/dist/sandbox/windows-sandbox-utils.js +982 -0
  114. package/dist/sandbox/windows-sandbox-utils.js.map +1 -0
  115. package/dist/utils/config-loader.d.ts +24 -0
  116. package/dist/utils/config-loader.d.ts.map +1 -0
  117. package/dist/utils/config-loader.js +65 -0
  118. package/dist/utils/config-loader.js.map +1 -0
  119. package/dist/utils/debug.d.ts +7 -0
  120. package/dist/utils/debug.d.ts.map +1 -0
  121. package/dist/utils/debug.js +25 -0
  122. package/dist/utils/debug.js.map +1 -0
  123. package/dist/utils/platform.d.ts +15 -0
  124. package/dist/utils/platform.d.ts.map +1 -0
  125. package/dist/utils/platform.js +52 -0
  126. package/dist/utils/platform.js.map +1 -0
  127. package/dist/utils/shell-quote.d.ts +27 -0
  128. package/dist/utils/shell-quote.d.ts.map +1 -0
  129. package/dist/utils/shell-quote.js +47 -0
  130. package/dist/utils/shell-quote.js.map +1 -0
  131. package/dist/utils/which.d.ts +9 -0
  132. package/dist/utils/which.d.ts.map +1 -0
  133. package/dist/utils/which.js +28 -0
  134. package/dist/utils/which.js.map +1 -0
  135. package/package.json +85 -4
  136. package/vendor/seccomp/x64/apply-seccomp +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tls-terminate-proxy.js","sourceRoot":"","sources":["../../src/s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1,625 @@
1
+ import type { SandboxDependencyCheck } from './linux-sandbox-utils.js';
2
+ import type { SrtWinConfig } from './sandbox-config.js';
3
+ /**
4
+ * Windows sandbox backend.
5
+ *
6
+ * Network isolation is enforced by `srt-win.exe` — a Rust helper that
7
+ * provisions a dedicated `srt-sandbox` local user account, installs a
8
+ * machine-wide WFP filter set keyed on that account's SID, and
9
+ * provides an `exec` subcommand that spawns the target via a two-hop
10
+ * launch (broker → `CreateProcessWithLogonW(runner)` → runner →
11
+ * restricted-token child) under `srt-sandbox`. The sandboxed child
12
+ * reaches the host only via the JS mux proxy, which the caller
13
+ * passes in via `--env`.
14
+ *
15
+ * The separate-user account structurally closes the surrogate-spawn
16
+ * class (schtasks, `PROC_THREAD_ATTRIBUTE_PARENT_PROCESS`, BITS,
17
+ * RunAs="Interactive User" COM): the child's token carries a
18
+ * different user SID, so it cannot reach real-user processes, tasks
19
+ * register under `srt-sandbox`, and the user-SID WFP filter fences
20
+ * `srt-sandbox` egress regardless of how the child was spawned.
21
+ *
22
+ * This module is a thin wrapper around the `srt-win` CLI; all status
23
+ * comes from live enumeration. There is no marker file.
24
+ *
25
+ * Filesystem rules (`denyRead`/`denyWrite`/`allowRead`/`allowWrite`)
26
+ * are enforced via additive explicit ACEs for `<sb-SID>` — see
27
+ * {@link grantWindowsAcl} / {@link stampWindowsAcl}.
28
+ */
29
+ export declare const DEFAULT_WINDOWS_PROXY_PORT_RANGE: readonly [number, number];
30
+ /**
31
+ * `cannot-read` is the graceful-degrade state when BFE enumeration
32
+ * is access-denied (it is admin-gated). The non-elevated readiness
33
+ * check is {@link verifyWindowsWfpEgress}, not this enum.
34
+ */
35
+ export type WindowsWfpStatus = 'absent' | 'installed' | 'cannot-read';
36
+ export interface WindowsWfpStatusResult {
37
+ state: WindowsWfpStatus;
38
+ /** Live filter count from BFE enum; `0` on `cannot-read`. */
39
+ filters: number;
40
+ /** `[low, high]` for the loopback PERMIT, when known. */
41
+ portRange?: [number, number];
42
+ /** Sandbox-user SID read from the first user-keyed filter tag. */
43
+ userSid?: string;
44
+ /**
45
+ * Populated only on `cannot-read` (BFE enumeration is admin-gated;
46
+ * a non-elevated caller can't read it). The non-elevated readiness
47
+ * check is {@link verifyWindowsWfpEgress}, not this enum.
48
+ */
49
+ hint?: string;
50
+ }
51
+ /**
52
+ * Result of `srt-win wfp verify` on success (exit 0, `blocked`) —
53
+ * see {@link verifyWindowsWfpEgress}. Any other outcome throws, so
54
+ * the tri-state is unobservable on the return path.
55
+ */
56
+ export interface WindowsWfpVerifyResult {
57
+ target: string;
58
+ /** Runner's stderr (carries the `BLOCKED (…)` diagnostic line). */
59
+ stderr: string;
60
+ }
61
+ /**
62
+ * State of the `srt-sandbox` local account that `srt-win install`
63
+ * provisions. The sandboxed child runs **as** this account.
64
+ */
65
+ export interface WindowsSandboxUserStatus {
66
+ /** The `srt-sandbox` local account exists. */
67
+ provisioned: boolean;
68
+ /** `S-1-5-21-…` of `srt-sandbox`, when provisioned. */
69
+ sid?: string;
70
+ /** The `sandbox-runtime-users` local group exists. */
71
+ groupExists: boolean;
72
+ /** `S-1-5-21-…` of `sandbox-runtime-users`, when it exists. */
73
+ groupSid?: string;
74
+ inBuiltinUsers: boolean;
75
+ inSandboxGroup: boolean;
76
+ hiddenFromLogon: boolean;
77
+ /**
78
+ * The credential row is present in `state.db` and readable by
79
+ * THIS process. False when not yet written, or when called from
80
+ * inside the sandbox (the state-DB directory carries an explicit
81
+ * DENY for `sandbox-runtime-users` — machine-scope DPAPI alone
82
+ * is not a confidentiality boundary).
83
+ */
84
+ credPresent: boolean;
85
+ /** Setup marker schema version, when the marker row exists. */
86
+ markerVersion?: number;
87
+ /**
88
+ * The calling (real) user's SID — the broker's identity, surfaced
89
+ * for diagnostics. The DENY-ACE trustee is `srt-sandbox`'s SID
90
+ * ({@link sid}), not this. Always present.
91
+ */
92
+ realUserSid: string;
93
+ /**
94
+ * SHA-1 thumbprint of the install-time CA, when one was
95
+ * installed via `srt-win user trust-ca`. Uppercase hex.
96
+ */
97
+ caCertThumb?: string;
98
+ /** PEM-encoded install-time CA certificate, when present. */
99
+ caCertPem?: string;
100
+ }
101
+ /**
102
+ * Inner shell to run `command` under, inside the sandbox: the
103
+ * executable to spawn and the flag argv placed between it and the
104
+ * user's command string. `exe` MUST originate from trusted host
105
+ * configuration (user settings / install detection), NEVER from
106
+ * workspace or repository content — the inner shell runs INSIDE the
107
+ * sandbox so an unexpected path is not a sandbox-escape vector, but
108
+ * it would still be an arbitrary-exec footgun if sourced from
109
+ * untrusted input.
110
+ *
111
+ * Construct via {@link parseWindowsBinShell} — it is the SOLE
112
+ * normalizer and the only place validation lives.
113
+ */
114
+ export type WindowsBinShell = {
115
+ /** Shell executable to spawn (absolute path when caller-supplied). */
116
+ exe: string;
117
+ /** Argv placed between `exe` and the user's command string. */
118
+ args: readonly string[];
119
+ };
120
+ /**
121
+ * Sole normalizer from the cross-platform `binShell?: string |
122
+ * WindowsBinShell` surface ({@link SandboxManager.wrapWithSandboxArgv})
123
+ * to a spawnable `{exe, args}` pair. All validation lives here —
124
+ * {@link wrapCommandWithSandboxWindows} consumes the result verbatim.
125
+ *
126
+ * String form: bare token (`'cmd'|'pwsh'|'powershell'`) resolves to
127
+ * the default install; absolute path to `bash.exe`/`sh.exe`/
128
+ * `pwsh.exe`/`powershell.exe`/`cmd.exe` keeps the caller's path with
129
+ * the matching flag shape. Object form: `exe` must be absolute; `args`
130
+ * pass through unchanged. Throws on anything else — no silent
131
+ * fallback to cmd.exe.
132
+ *
133
+ * Uses `path.win32` explicitly so the function (and its unit test)
134
+ * is platform-independent.
135
+ */
136
+ export declare function parseWindowsBinShell(raw?: string | WindowsBinShell): WindowsBinShell;
137
+ export interface WindowsSandboxParams {
138
+ command: string;
139
+ /**
140
+ * JS HTTP proxy port — fed to `generateProxyEnvVars` for the env
141
+ * overlay. With the in-process proxy this is the mux front-end
142
+ * port (same as `socksProxyPort`).
143
+ */
144
+ httpProxyPort?: number;
145
+ /**
146
+ * JS SOCKS proxy port — fed to `generateProxyEnvVars` for the env
147
+ * overlay. With the in-process proxy this is the mux front-end
148
+ * port (same as `httpProxyPort`).
149
+ */
150
+ socksProxyPort?: number;
151
+ /** Per-session proxy auth token; embedded in proxy env URLs. */
152
+ proxyAuthToken?: string;
153
+ /**
154
+ * `mode: 'mask'` credential env vars — sentinel values the
155
+ * sandboxed child should see in place of the real credentials.
156
+ * Threaded through the `--env` overlay so the runner forwards
157
+ * them into the child's fresh profile env (the broker's own
158
+ * environment never reaches the child, so an `env -u`-style
159
+ * scrub is structurally moot — there is no `unsetEnvVars`).
160
+ * Applied BEFORE the proxy assignments so the sandbox's own
161
+ * proxy plumbing survives even if a caller masks one of those
162
+ * names — same precedence as macOS/Linux.
163
+ */
164
+ setEnvVars?: Readonly<Record<string, string>>;
165
+ /**
166
+ * Per-exec read-deny paths, applied via an additive
167
+ * `(D;OICI;FA;;;<sb-SID>)` ACE under the `srt-win exec`
168
+ * process's own PID and released after the child exits. Same
169
+ * disk-first chokepoint as the session-level
170
+ * {@link stampWindowsAcl}; same fail-closed semantics (exec
171
+ * fails if any path cannot be stamped).
172
+ *
173
+ * Normalized concrete paths — globs expanded by the caller via
174
+ * {@link expandWindowsFsPaths}, the same as session-level.
175
+ * `srt-win exec`'s `canonicalize_ace_targets` hard-fails on a
176
+ * glob (it never expands), so a `*`/`?` reaching this field is
177
+ * a caller bug.
178
+ */
179
+ denyRead?: readonly string[];
180
+ /** Per-exec write-deny paths — see {@link denyRead}. */
181
+ denyWrite?: readonly string[];
182
+ /**
183
+ * Working directory the child starts in. Fed to
184
+ * {@link buildGitConfigEnv} as a `safe.directory` entry so git
185
+ * inside the sandbox accepts the real-user-owned working tree.
186
+ * Default: `process.cwd()`.
187
+ *
188
+ * `srt-win exec` has no `--cwd` flag — the child's working
189
+ * directory is whatever the caller passes as the spawn `{cwd:}`
190
+ * option (broker `current_dir()` → runner `lpCurrentDirectory` →
191
+ * child inherits). This field must match that spawn option so
192
+ * `safe.directory` covers where git actually runs.
193
+ */
194
+ cwd?: string;
195
+ /**
196
+ * Session-level write-granted paths (the resolved
197
+ * `filesystem.allowWrite` set). Each becomes a `safe.directory`
198
+ * entry — see {@link buildGitConfigEnv}.
199
+ */
200
+ allowWrite?: readonly string[];
201
+ /**
202
+ * Path to the TLS-termination trust bundle (the MITM CA + system
203
+ * roots) — fed to {@link generateProxyEnvVars} so the child's
204
+ * `NODE_EXTRA_CA_CERTS` / `CURL_CA_BUNDLE` / `SSL_CERT_FILE` /
205
+ * etc. point at it. Backslashes are normalised to forward slashes
206
+ * before emission so the value survives msys2 env conversion AND
207
+ * is accepted by native tools.
208
+ *
209
+ * The env-var layer covers OpenSSL-backed clients (msys2 curl,
210
+ * openssl-backed git, node, python, cargo). Schannel/.NET clients
211
+ * that read the Windows certificate store exclusively (System32
212
+ * `curl.exe`, `Invoke-WebRequest`, Go-built tools) trust via the
213
+ * separate `srt-win user trust-ca` / {@link windowsTrustCa}
214
+ * install-time write into the sandbox user's `CurrentUser\Root`.
215
+ *
216
+ * The caller is responsible for the sandbox user having read
217
+ * access to this path — `sandbox-manager.ts`'s `initialize()`
218
+ * pushes it into the session's `acl grant` read-set alongside the
219
+ * working-tree grants.
220
+ */
221
+ caCertPath?: string;
222
+ /**
223
+ * Suppress srt-win's informational stderr (progress lines,
224
+ * per-exec-deny summary, seclogon-job note). Actual errors still
225
+ * print. Default `true` — the host surfaces sandbox diagnostics
226
+ * via its own debug log, not the child's stderr stream.
227
+ */
228
+ quiet?: boolean;
229
+ /**
230
+ * Resolved `srt-win` spawn descriptor — from
231
+ * {@link resolveSrtWin}. Omit to resolve the packaged vendor
232
+ * binary at call time.
233
+ */
234
+ srtWin?: SrtWinSpawn;
235
+ /**
236
+ * Inner shell. Defaults to `parseWindowsBinShell(undefined)`
237
+ * (System32 cmd.exe). The child's post-`args` content is
238
+ * **passthrough** — `&` chains, `"…"`/`'…'` quotes exactly as
239
+ * written. The security boundary is at the OUTER spawn (this argv
240
+ * is spawned with `shell:false`); the inner shell runs INSIDE the
241
+ * sandbox so its metachars are the user's tool. Construct via
242
+ * {@link parseWindowsBinShell}.
243
+ */
244
+ binShell?: WindowsBinShell;
245
+ }
246
+ /**
247
+ * Locate the packaged `srt-win.exe`. Resolution order:
248
+ * 1. `<root>/vendor/srt-win/{arch}/srt-win.exe` (prebuilt — published npm
249
+ * package, or after `npm run build:srt-win` locally).
250
+ * 2. `<root>/vendor/srt-win-src/target/release/srt-win.exe` (local
251
+ * `cargo build --release` fallback for development).
252
+ *
253
+ * `<root>` is {@link repoRoot} — `__dirname/../..`, which resolves to the
254
+ * repo root from `src/sandbox/` and `dist/sandbox/` alike, and to the
255
+ * package root when installed under `node_modules`.
256
+ *
257
+ * Callers that ship their own binary (or a multicall binary that
258
+ * routes on `argv[1] == `{@link SRT_WIN_DISPATCH_ARG1}) pass
259
+ * `windows.srtWin` instead of relying on this lookup — see
260
+ * {@link resolveSrtWin}.
261
+ *
262
+ * Resolution via the optional `@anthropic-ai/sandbox-runtime-win32-*`
263
+ * platform packages is added separately.
264
+ *
265
+ * @throws if none exist.
266
+ */
267
+ export declare function getSrtWinPath(): string;
268
+ /**
269
+ * `argv[1]` sentinel a multicall embedder's dispatcher matches
270
+ * against to route into `srt_win::run_from_args`. Mirrors the Rust
271
+ * `srt_win::SRT_WIN_DISPATCH_ARG1`; the two MUST stay in sync.
272
+ * `run_from_args` strips it before clap, so the standalone binary
273
+ * accepts it harmlessly.
274
+ */
275
+ export declare const SRT_WIN_DISPATCH_ARG1 = "--srt-win";
276
+ /**
277
+ * Resolved `srt-win` spawn descriptor — the executable to load plus
278
+ * the leading arguments that carry the dispatch sentinel. Threaded
279
+ * to every spawn site so {@link resolveSrtWin} runs once (at
280
+ * `initialize()`) instead of re-`stat`ing on every helper call.
281
+ */
282
+ export type SrtWinSpawn = Readonly<{
283
+ exe: string;
284
+ prependArgs: readonly string[];
285
+ }>;
286
+ /**
287
+ * Resolve the `srt-win` spawn target from config. When `cfg.path` is
288
+ * set it is used verbatim (no fallback to the packaged binary — an
289
+ * explicit override is a directive, not a hint) and
290
+ * {@link SRT_WIN_DISPATCH_ARG1} is prepended so a multicall
291
+ * dispatcher routes on `argv[1]`. When unset, falls back to
292
+ * {@link getSrtWinPath} with no sentinel (the packaged binary
293
+ * doesn't need it; `run_from_args` would strip it anyway).
294
+ */
295
+ export declare function resolveSrtWin(cfg?: SrtWinConfig): SrtWinSpawn;
296
+ /**
297
+ * Query the WFP filter set under the given sublayer via live BFE
298
+ * enumeration. `installed` means at least one srt-win-tagged
299
+ * `block-user` filter is present. Detection is **tag-based**
300
+ * (providerData JSON); filters installed by other tooling without the
301
+ * tag are not counted.
302
+ *
303
+ * BFE enumeration is admin-gated — a non-elevated caller gets
304
+ * `state:"cannot-read"` with a `hint` (not an error). The
305
+ * non-elevated readiness check is {@link verifyWindowsWfpEgress}.
306
+ */
307
+ export declare function getWindowsWfpStatus(opts?: {
308
+ sublayerGuid?: string;
309
+ srtWin?: SrtWinSpawn;
310
+ }): WindowsWfpStatusResult;
311
+ /**
312
+ * Behavioral proof that the WFP egress fence is active for the
313
+ * sandbox user. Binds a local listener on an ephemeral loopback port
314
+ * outside the WFP loopback-permit range, then spawns `srt-win
315
+ * runner` as the sandbox user (via `CreateProcessWithLogonW`) to
316
+ * attempt a direct TCP connect to it. The WFP block-user filter
317
+ * fires at `ALE_AUTH_CONNECT` — before any packet leaves — so an
318
+ * active fence yields WSAEACCES immediately and a missing fence lets
319
+ * the connect through (the kernel completes the handshake against
320
+ * the listening socket's backlog; no event-loop tick required, so
321
+ * the synchronous `runSrtWin` is safe). Does not require elevation
322
+ * and does not depend on any external host.
323
+ *
324
+ * `initialize()` calls this once per session, so a stale install
325
+ * (sandbox user provisioned but filters since removed) fails closed
326
+ * at session start instead of running every exec with full egress.
327
+ *
328
+ * @param opts.target overrides the probe target (skips the local
329
+ * listener bind).
330
+ * @param opts.proxyPortRange the WFP loopback-permit range the
331
+ * listener must avoid. Default
332
+ * {@link DEFAULT_WINDOWS_PROXY_PORT_RANGE}.
333
+ * @throws on any outcome other than `blocked` (exit 0).
334
+ */
335
+ export declare function verifyWindowsWfpEgress(opts?: {
336
+ target?: string;
337
+ proxyPortRange?: readonly [number, number];
338
+ srtWin?: SrtWinSpawn;
339
+ }): Promise<WindowsWfpVerifyResult>;
340
+ /**
341
+ * Query the sandbox user account's provisioning state. Each field
342
+ * is independently observed so a half-provisioned install (e.g.
343
+ * user exists but credential file missing) is distinguishable.
344
+ * Does not require elevation.
345
+ */
346
+ export declare function getWindowsSandboxUserStatus(opts?: {
347
+ srtWin?: SrtWinSpawn;
348
+ }): WindowsSandboxUserStatus;
349
+ /**
350
+ * Read back the persistent MITM CA the sandbox was installed with
351
+ * (via `srt-win user trust-ca` / {@link windowsTrustCa}).
352
+ * Returns `null` when no CA was installed. The PEM is what `srt-win
353
+ * user status` reconstructs from the DER stored in `state.db`.
354
+ *
355
+ * On Windows, `tlsTerminate` requires this CA to be present in the
356
+ * sandbox user's `CurrentUser\Root` (schannel-level trust is an
357
+ * install-time concern, not per-session); the host calls this from
358
+ * `initialize()` to fail early with an actionable message when it
359
+ * isn't.
360
+ *
361
+ * @param status pass an already-fetched
362
+ * {@link getWindowsSandboxUserStatus} result to avoid a second
363
+ * `srt-win user status` spawn.
364
+ */
365
+ export declare function getWindowsSandboxCaCert(status?: WindowsSandboxUserStatus, opts?: {
366
+ srtWin?: SrtWinSpawn;
367
+ }): {
368
+ pem: string;
369
+ thumb: string;
370
+ } | null;
371
+ /**
372
+ * Install (or replace) the MITM CA in the **sandbox user's**
373
+ * `CurrentUser\Root` and record it in `state.db` (so
374
+ * {@link getWindowsSandboxCaCert} surfaces its thumbprint + PEM).
375
+ * Thin wrapper around `srt-win user trust-ca <path>`. Does NOT
376
+ * require elevation. Persistent until {@link uninstallWindowsSandbox}
377
+ * deletes the sandbox user's profile.
378
+ *
379
+ * The CA has a separate lifecycle from {@link installWindowsSandbox}
380
+ * — install provisions the account/filters and never touches the CA;
381
+ * call this AFTER install when `tlsTerminate` will be used.
382
+ *
383
+ * @throws when the sandbox user is not provisioned, the file is not a
384
+ * parseable X.509 certificate, or the registry write into the
385
+ * sandbox user's hive fails.
386
+ */
387
+ export declare function windowsTrustCa(caCertPath: string, opts?: {
388
+ srtWin?: SrtWinSpawn;
389
+ }): void;
390
+ export interface WindowsInstallOptions {
391
+ /** WFP sublayer GUID. Omit for srt-win's compile-time default. */
392
+ sublayerGuid?: string;
393
+ /**
394
+ * Loopback PERMIT port range. Must match what
395
+ * `SandboxRuntimeConfig.windows.proxyPortRange` will be set to.
396
+ * Default {@link DEFAULT_WINDOWS_PROXY_PORT_RANGE}.
397
+ */
398
+ proxyPortRange?: readonly [number, number];
399
+ /**
400
+ * Name for the sandbox user account (created if absent, adopted
401
+ * if it already exists as a local user). Default `srt-sandbox`.
402
+ */
403
+ sandboxUser?: string;
404
+ /**
405
+ * Replace an existing install whose configuration differs
406
+ * (different port range or sandbox-user name under the same
407
+ * sublayer). Without this, install refuses with "already
408
+ * installed with different config" rather than silently
409
+ * overwriting.
410
+ */
411
+ force?: boolean;
412
+ /** Resolved `srt-win` spawn descriptor — from {@link resolveSrtWin}. */
413
+ srtWin?: SrtWinSpawn;
414
+ }
415
+ export interface WindowsInstallResult {
416
+ /** Post-install WFP state. */
417
+ wfp: WindowsWfpStatusResult;
418
+ /** Post-install sandbox-user state. */
419
+ user: WindowsSandboxUserStatus;
420
+ /**
421
+ * `true` if the user dismissed the UAC prompt. Not an error —
422
+ * the install simply didn't happen. Re-run when the user is
423
+ * ready to grant elevation.
424
+ */
425
+ cancelled?: true;
426
+ }
427
+ /**
428
+ * One-shot install: provisions the `srt-sandbox` user account and
429
+ * installs the user-SID-keyed WFP filter set — all in a single
430
+ * self-elevating process (one UAC prompt). Idempotent; re-running
431
+ * rotates the sandbox user's password.
432
+ *
433
+ * Network for the calling user is **not disrupted**: the filters key
434
+ * on the `srt-sandbox` user's SID, so the broker, services, and
435
+ * every other principal fall through to default-permit. No logout
436
+ * is required.
437
+ *
438
+ * Returns the post-call WFP + sandbox-user state. If the user
439
+ * cancels the UAC prompt this returns `{cancelled: true, …}` rather
440
+ * than throwing — cancellation is a user choice, not an error.
441
+ *
442
+ * @throws on user/WFP creation failure, or if filters already exist
443
+ * under `sublayerGuid` with a different port range and `force` is
444
+ * not set.
445
+ */
446
+ export declare function installWindowsSandbox(opts?: WindowsInstallOptions): WindowsInstallResult;
447
+ /**
448
+ * Remove the WFP filter set under `sublayerGuid` and the
449
+ * `srt-sandbox` account, its credential file, and the setup marker
450
+ * (one UAC prompt). Idempotent.
451
+ *
452
+ * @returns `{cancelled: true}` if the user dismissed UAC.
453
+ */
454
+ export declare function uninstallWindowsSandbox(opts?: {
455
+ sublayerGuid?: string;
456
+ keepUser?: boolean;
457
+ srtWin?: SrtWinSpawn;
458
+ }): {
459
+ cancelled?: true;
460
+ };
461
+ /**
462
+ * Resolve any Windows filesystem-config path list — `allowRead`/
463
+ * `allowWrite` grants and `denyRead`/`denyWrite` stamps — to
464
+ * concrete existing paths via the single platform-aware
465
+ * {@link normalizePathForSandbox} chokepoint (Linux/macOS parity:
466
+ * point-in-time expansion at session initialize, not per-exec).
467
+ * Glob patterns are expanded; non-glob paths are normalized and
468
+ * returned 1:1. Missing paths are dropped (statSync probe).
469
+ * Directory targets are accepted — the additive sandbox-user ACE
470
+ * carries `(OI)(CI)` so it covers the subtree.
471
+ */
472
+ export declare function expandWindowsFsPaths(patterns: readonly string[]): string[];
473
+ export interface WindowsAclStampOptions {
474
+ /** Paths the sandboxed child must not read. */
475
+ denyRead: readonly string[];
476
+ /** Paths the sandboxed child must not write (read stays allowed). */
477
+ denyWrite: readonly string[];
478
+ /** SID of the dedicated sandbox user — {@link WindowsSandboxUserStatus.sid}. */
479
+ sandboxUserSid: string;
480
+ /** Long-lived host PID the holds are tied to. Default: this process. */
481
+ holderPid?: number;
482
+ /** Resolved `srt-win` spawn descriptor — from {@link resolveSrtWin}. */
483
+ srtWin?: SrtWinSpawn;
484
+ }
485
+ /**
486
+ * Apply the file-deny ACE set for one host session: an additive
487
+ * `(D;OICI;mask;;;<sb-SID>)` on the target plus a
488
+ * `(D;OICI;FILE_DELETE_CHILD;;;<sb-SID>)` on the parent — no
489
+ * PROTECTED rewrite, no SD snapshot. Idempotent and refcounted via
490
+ * srt-win's `working_aces` table.
491
+ *
492
+ * Inputs are passed verbatim to `srt-win` (which canonicalizes and
493
+ * rejects globs). Callers that accept globs should pre-expand via
494
+ * {@link expandWindowsFsPaths}.
495
+ *
496
+ * @throws on exit ≠ 0 — including exit 2 (one or more inputs
497
+ * skipped). srt-win stamps the resolvable inputs before exiting
498
+ * 2, so on throw the caller should call {@link restoreWindowsAcl}
499
+ * to release whatever WAS stamped.
500
+ */
501
+ export declare function stampWindowsAcl(opts: WindowsAclStampOptions): void;
502
+ /**
503
+ * Per-path outcome from `srt-win acl restore --json` /
504
+ * `revoke --json`. The status set is intentionally loose: the
505
+ * pre-/post- same-user-removal `srt-win` builds emit different
506
+ * vocabularies for `restore` (`restored`/`leftChanged`/… vs
507
+ * `revoked`/`stillHeld`/…). Callers (`reset()`) only log these,
508
+ * so the union is whatever the binary on PATH says.
509
+ */
510
+ export interface WindowsAclAceOutcome {
511
+ path: string;
512
+ status: string;
513
+ }
514
+ /**
515
+ * Release this holder's deny ACEs and remove the sandbox-user ACE
516
+ * on any path whose refcount falls to zero. Best-effort (does not
517
+ * throw on per-path anomalies); returns per-path outcomes for the
518
+ * caller to surface. Returns `undefined` only when `srt-win`
519
+ * itself failed (no JSON to parse).
520
+ */
521
+ export declare function restoreWindowsAcl(opts: {
522
+ sandboxUserSid: string;
523
+ holderPid?: number;
524
+ srtWin?: SrtWinSpawn;
525
+ }): WindowsAclAceOutcome[] | undefined;
526
+ export interface WindowsAclGrantOptions {
527
+ /** Paths to grant `MODIFY_NO_FDC` on (the working tree, `allowWrite`). */
528
+ write: readonly string[];
529
+ /** Paths to grant `FILE_GENERIC_READ|EXECUTE` on (`allowRead`). */
530
+ read: readonly string[];
531
+ /** SID of the dedicated sandbox user — {@link WindowsSandboxUserStatus.sid}. */
532
+ sandboxUserSid: string;
533
+ /** Long-lived host PID the holds are tied to. Default: this process. */
534
+ holderPid?: number;
535
+ /** Resolved `srt-win` spawn descriptor — from {@link resolveSrtWin}. */
536
+ srtWin?: SrtWinSpawn;
537
+ }
538
+ /**
539
+ * Apply per-session additive `(OI)(CI)` ALLOW ACEs for the sandbox
540
+ * user on each path. The sandbox user has no inherent rights on
541
+ * real-user-owned files; this is what makes the working tree (and
542
+ * explicit `allowRead`/`allowWrite` paths) reachable from the
543
+ * child. Idempotent and refcounted via srt-win's `working_aces`
544
+ * table.
545
+ *
546
+ * @throws on exit ≠ 0. On throw the caller should call
547
+ * {@link revokeWindowsAcl} to release whatever WAS granted.
548
+ */
549
+ export declare function grantWindowsAcl(opts: WindowsAclGrantOptions): void;
550
+ /**
551
+ * Release this holder's grants and remove the sandbox-user ACE on
552
+ * any path whose refcount falls to zero. Best-effort (does not
553
+ * throw); logs anomalies.
554
+ */
555
+ export declare function revokeWindowsAcl(opts: {
556
+ sandboxUserSid: string;
557
+ holderPid?: number;
558
+ srtWin?: SrtWinSpawn;
559
+ }): WindowsAclAceOutcome[] | undefined;
560
+ /**
561
+ * Build the `GIT_CONFIG_COUNT` / `GIT_CONFIG_KEY_<n>` /
562
+ * `GIT_CONFIG_VALUE_<n>` env-var set for the sandboxed child.
563
+ *
564
+ * Emits:
565
+ * - `safe.directory=<dir>` for each entry in `safeDirs` (or one
566
+ * `safe.directory=*` when the list is long) — the working tree
567
+ * is owned by the real user, so git running as `srt-sandbox`
568
+ * refuses with "detected dubious ownership" without it.
569
+ * - `http.schannelUseSSLCAInfo=true` and
570
+ * `http.schannelCheckRevoke=false` when `schannelCa` — makes
571
+ * git's default (schannel) backend honor `GIT_SSL_CAINFO`
572
+ * without `-c http.sslBackend=openssl`. Revocation is disabled
573
+ * because CryptoAPI CRL/OCSP fetches ignore proxy env and would
574
+ * be WFP-fenced.
575
+ *
576
+ * Composes with an existing `GIT_CONFIG_COUNT` in `baseEnv` by
577
+ * continuing its numbering; the returned `GIT_CONFIG_COUNT` is the
578
+ * new total. Under the two-hop launch the broker's own environment
579
+ * never reaches the child, so `baseEnv` is the caller-supplied
580
+ * overlay ({@link WindowsSandboxParams.setEnvVars}), not
581
+ * `process.env`.
582
+ *
583
+ * Paths are emitted with forward slashes so the value survives
584
+ * msys2's env conversion untouched and native git accepts it.
585
+ */
586
+ export declare function buildGitConfigEnv(opts: {
587
+ safeDirs: readonly string[];
588
+ schannelCa: boolean;
589
+ baseEnv?: Readonly<Record<string, string | undefined>>;
590
+ }): Record<string, string>;
591
+ /**
592
+ * Build the spawn descriptor for running `command` inside the Windows
593
+ * sandbox: an `argv` array plus the `env` to spawn it with.
594
+ *
595
+ * Caller MUST spawn the result with `{shell: false}` — that is the
596
+ * security boundary that keeps untrusted bytes off the host's shell
597
+ * (the inner `cmd.exe /c` runs INSIDE the sandbox; see
598
+ * `vendor/srt-win-src/src/launch.rs` `build_cmdline` for the passthrough
599
+ * rationale) — AND with the returned `env`.
600
+ *
601
+ * Proxy configuration is single-sourced by {@link generateProxyEnvVars}
602
+ * (the same canonical builder used on macOS/Linux). `srt-win exec`
603
+ * takes no `--http-proxy` / `--socks-proxy` flags and synthesizes no
604
+ * proxy env. The two-hop runner starts with the SANDBOX user's
605
+ * profile env (`USERPROFILE`/`TEMP` isolated) and overlays exactly
606
+ * what we pass as `--env` — built here from the broker's `PATH` plus
607
+ * the generated proxy set.
608
+ */
609
+ export declare function wrapCommandWithSandboxWindows(p: WindowsSandboxParams): {
610
+ argv: string[];
611
+ env: NodeJS.ProcessEnv;
612
+ };
613
+ /**
614
+ * Install instructions, surfaced verbatim in error messages.
615
+ */
616
+ export declare function windowsInstallInstructions(sublayerGuid: string | undefined): string;
617
+ /**
618
+ * Check the Windows backend is ready to sandbox. Errors block
619
+ * `initialize()`; warnings are informational.
620
+ */
621
+ export declare function checkWindowsDependencies(opts?: {
622
+ sublayerGuid?: string;
623
+ srtWin?: SrtWinSpawn;
624
+ }): SandboxDependencyCheck;
625
+ //# sourceMappingURL=windows-sandbox-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windows-sandbox-utils.d.ts","sourceRoot":"","sources":["../../src/sandbox/windows-sandbox-utils.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,eAAO,MAAM,gCAAgC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAEtE,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAA;AAErE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,gBAAgB,CAAA;IACvB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAA;IACpB,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,WAAW,EAAE,OAAO,CAAA;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IAC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