@sysid/sandbox-runtime-improved 0.0.61-sysid.1 → 0.0.64-sysid.1
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.
- package/README.md +76 -15
- package/dist/cli.js +12 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/sandbox/credential-mask-files.d.ts +100 -15
- package/dist/sandbox/credential-mask-files.d.ts.map +1 -1
- package/dist/sandbox/credential-mask-files.js +172 -20
- package/dist/sandbox/credential-mask-files.js.map +1 -1
- package/dist/sandbox/http-proxy.d.ts +1 -1
- package/dist/sandbox/http-proxy.d.ts.map +1 -1
- package/dist/sandbox/http-proxy.js +20 -0
- package/dist/sandbox/http-proxy.js.map +1 -1
- package/dist/sandbox/linux-sandbox-utils.d.ts +5 -0
- package/dist/sandbox/linux-sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/linux-sandbox-utils.js +29 -19
- package/dist/sandbox/linux-sandbox-utils.js.map +1 -1
- package/dist/sandbox/linux-violation-monitor.d.ts +48 -0
- package/dist/sandbox/linux-violation-monitor.d.ts.map +1 -0
- package/dist/sandbox/linux-violation-monitor.js +156 -0
- package/dist/sandbox/linux-violation-monitor.js.map +1 -0
- package/dist/sandbox/macos-sandbox-utils.js +3 -3
- package/dist/sandbox/macos-sandbox-utils.js.map +1 -1
- package/dist/sandbox/mitm-ca.d.ts +52 -1
- package/dist/sandbox/mitm-ca.d.ts.map +1 -1
- package/dist/sandbox/mitm-ca.js +143 -11
- package/dist/sandbox/mitm-ca.js.map +1 -1
- package/dist/sandbox/mitm-leaf.d.ts +1 -1
- package/dist/sandbox/mitm-leaf.d.ts.map +1 -1
- package/dist/sandbox/mitm-leaf.js +21 -32
- package/dist/sandbox/mitm-leaf.js.map +1 -1
- package/dist/sandbox/sandbox-config.d.ts +231 -40
- package/dist/sandbox/sandbox-config.d.ts.map +1 -1
- package/dist/sandbox/sandbox-config.js +161 -32
- package/dist/sandbox/sandbox-config.js.map +1 -1
- package/dist/sandbox/sandbox-manager.d.ts +1 -1
- package/dist/sandbox/sandbox-manager.d.ts.map +1 -1
- package/dist/sandbox/sandbox-manager.js +331 -252
- package/dist/sandbox/sandbox-manager.js.map +1 -1
- package/dist/sandbox/sandbox-utils.d.ts +13 -0
- package/dist/sandbox/sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/sandbox-utils.js +32 -7
- package/dist/sandbox/sandbox-utils.js.map +1 -1
- package/dist/sandbox/windows-sandbox-utils.d.ts +353 -297
- package/dist/sandbox/windows-sandbox-utils.d.ts.map +1 -1
- package/dist/sandbox/windows-sandbox-utils.js +516 -396
- package/dist/sandbox/windows-sandbox-utils.js.map +1 -1
- package/dist/utils/shell-quote.d.ts +27 -0
- package/dist/utils/shell-quote.d.ts.map +1 -0
- package/dist/utils/shell-quote.js +47 -0
- package/dist/utils/shell-quote.js.map +1 -0
- package/package.json +1 -3
- package/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/vendor/seccomp/x64/apply-seccomp +0 -0
|
@@ -50,29 +50,71 @@ declare const credentialModeSchema: z.ZodEnum<["deny", "mask"]>;
|
|
|
50
50
|
/**
|
|
51
51
|
* Schema for a single credential file/directory entry.
|
|
52
52
|
*
|
|
53
|
-
* `mode: "mask"` is **whole-file** masking: the entire
|
|
54
|
-
* replaced inside the sandbox with one sentinel string,
|
|
55
|
-
* substitutes that sentinel back to the real bytes on egress.
|
|
56
|
-
* for files whose content *is* the credential (a token file, a
|
|
57
|
-
* secret).
|
|
58
|
-
* (`.netrc`, JSON/YAML configs) — the tool will fail to parse the sentinel.
|
|
59
|
-
* For those, prefer env-var masking where the tool supports it, or
|
|
60
|
-
* `mode: "deny"`. Format-aware extraction is a possible future extension.
|
|
53
|
+
* `mode: "mask"` without `extract` is **whole-file** masking: the entire
|
|
54
|
+
* file content is replaced inside the sandbox with one sentinel string,
|
|
55
|
+
* and the proxy substitutes that sentinel back to the real bytes on egress.
|
|
56
|
+
* This works for files whose content *is* the credential (a token file, a
|
|
57
|
+
* single-line secret).
|
|
61
58
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
59
|
+
* `mode: "mask"` with `extract` is **structured** masking: the regex is
|
|
60
|
+
* applied globally to the real file, capture group 1 of each match is a
|
|
61
|
+
* credential value, and only those captured spans are replaced with
|
|
62
|
+
* sentinels — the rest of the file is preserved byte-for-byte. This lets a
|
|
63
|
+
* tool that parses the file (`.netrc`, JSON/YAML configs) still succeed
|
|
64
|
+
* inside the sandbox while the credential values are protected. If the
|
|
65
|
+
* pattern matches nothing, behaviour is governed by `onExtractNoMatch`
|
|
66
|
+
* (default `"warn"` — the file is left readable as-is and a stderr
|
|
67
|
+
* warning is emitted).
|
|
68
|
+
*
|
|
69
|
+
* `maskDuplicates: true` (only meaningful with `extract`) additionally
|
|
70
|
+
* replaces every verbatim occurrence of each captured value *outside* the
|
|
71
|
+
* regex-matched spans — for a secret repeated where the regex does not
|
|
72
|
+
* reach (e.g. pasted into a comment). The scan is raw substring matching,
|
|
73
|
+
* so a short or common captured value may also hit unrelated content that
|
|
74
|
+
* happens to contain it; intended for long, high-entropy secrets.
|
|
75
|
+
*
|
|
76
|
+
* On macOS, SBPL cannot redirect reads, so `mode: "mask"` (with or without
|
|
77
|
+
* `extract`) currently degrades to `mode: "deny"` (the file is unreadable
|
|
78
|
+
* inside the sandbox).
|
|
64
79
|
*/
|
|
65
80
|
export declare const CredentialFileConfigSchema: z.ZodObject<{
|
|
66
81
|
path: z.ZodString;
|
|
67
82
|
mode: z.ZodEnum<["deny", "mask"]>;
|
|
83
|
+
extract: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
84
|
+
/**
|
|
85
|
+
* What to do when `extract` matches nothing in the file at runtime.
|
|
86
|
+
*
|
|
87
|
+
* - `"warn"` (default): emit a stderr warning and leave the file
|
|
88
|
+
* readable as-is inside the sandbox (fail-open). A non-matching
|
|
89
|
+
* pattern is treated as a config error to surface and fix, not a
|
|
90
|
+
* reason to break a tool that needs the file when the credential is
|
|
91
|
+
* legitimately absent.
|
|
92
|
+
* - `"deny"`: degrade the entry to `mode: "deny"` so the file is
|
|
93
|
+
* unreadable inside the sandbox (fail-closed). The operator declared
|
|
94
|
+
* this file as containing a credential; if the regex cannot find it,
|
|
95
|
+
* block access rather than expose it.
|
|
96
|
+
* - `"error"`: throw at wrap time so nothing runs until the operator
|
|
97
|
+
* fixes the regex.
|
|
98
|
+
*
|
|
99
|
+
* Only meaningful when `mode` is `"mask"` and `extract` is set;
|
|
100
|
+
* accepted but ignored otherwise.
|
|
101
|
+
*/
|
|
102
|
+
onExtractNoMatch: z.ZodOptional<z.ZodEnum<["warn", "deny", "error"]>>;
|
|
103
|
+
maskDuplicates: z.ZodOptional<z.ZodBoolean>;
|
|
68
104
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
69
105
|
}, "strip", z.ZodTypeAny, {
|
|
70
106
|
mode: "deny" | "mask";
|
|
71
107
|
path: string;
|
|
108
|
+
extract?: string | undefined;
|
|
109
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
110
|
+
maskDuplicates?: boolean | undefined;
|
|
72
111
|
injectHosts?: string[] | undefined;
|
|
73
112
|
}, {
|
|
74
113
|
mode: "deny" | "mask";
|
|
75
114
|
path: string;
|
|
115
|
+
extract?: string | undefined;
|
|
116
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
117
|
+
maskDuplicates?: boolean | undefined;
|
|
76
118
|
injectHosts?: string[] | undefined;
|
|
77
119
|
}>;
|
|
78
120
|
/**
|
|
@@ -108,14 +150,41 @@ export declare const CredentialsConfigSchema: z.ZodObject<{
|
|
|
108
150
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
151
|
path: z.ZodString;
|
|
110
152
|
mode: z.ZodEnum<["deny", "mask"]>;
|
|
153
|
+
extract: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
154
|
+
/**
|
|
155
|
+
* What to do when `extract` matches nothing in the file at runtime.
|
|
156
|
+
*
|
|
157
|
+
* - `"warn"` (default): emit a stderr warning and leave the file
|
|
158
|
+
* readable as-is inside the sandbox (fail-open). A non-matching
|
|
159
|
+
* pattern is treated as a config error to surface and fix, not a
|
|
160
|
+
* reason to break a tool that needs the file when the credential is
|
|
161
|
+
* legitimately absent.
|
|
162
|
+
* - `"deny"`: degrade the entry to `mode: "deny"` so the file is
|
|
163
|
+
* unreadable inside the sandbox (fail-closed). The operator declared
|
|
164
|
+
* this file as containing a credential; if the regex cannot find it,
|
|
165
|
+
* block access rather than expose it.
|
|
166
|
+
* - `"error"`: throw at wrap time so nothing runs until the operator
|
|
167
|
+
* fixes the regex.
|
|
168
|
+
*
|
|
169
|
+
* Only meaningful when `mode` is `"mask"` and `extract` is set;
|
|
170
|
+
* accepted but ignored otherwise.
|
|
171
|
+
*/
|
|
172
|
+
onExtractNoMatch: z.ZodOptional<z.ZodEnum<["warn", "deny", "error"]>>;
|
|
173
|
+
maskDuplicates: z.ZodOptional<z.ZodBoolean>;
|
|
111
174
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
112
175
|
}, "strip", z.ZodTypeAny, {
|
|
113
176
|
mode: "deny" | "mask";
|
|
114
177
|
path: string;
|
|
178
|
+
extract?: string | undefined;
|
|
179
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
180
|
+
maskDuplicates?: boolean | undefined;
|
|
115
181
|
injectHosts?: string[] | undefined;
|
|
116
182
|
}, {
|
|
117
183
|
mode: "deny" | "mask";
|
|
118
184
|
path: string;
|
|
185
|
+
extract?: string | undefined;
|
|
186
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
187
|
+
maskDuplicates?: boolean | undefined;
|
|
119
188
|
injectHosts?: string[] | undefined;
|
|
120
189
|
}>, "many">>;
|
|
121
190
|
envVars: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -136,6 +205,9 @@ export declare const CredentialsConfigSchema: z.ZodObject<{
|
|
|
136
205
|
files?: {
|
|
137
206
|
mode: "deny" | "mask";
|
|
138
207
|
path: string;
|
|
208
|
+
extract?: string | undefined;
|
|
209
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
210
|
+
maskDuplicates?: boolean | undefined;
|
|
139
211
|
injectHosts?: string[] | undefined;
|
|
140
212
|
}[] | undefined;
|
|
141
213
|
envVars?: {
|
|
@@ -148,6 +220,9 @@ export declare const CredentialsConfigSchema: z.ZodObject<{
|
|
|
148
220
|
files?: {
|
|
149
221
|
mode: "deny" | "mask";
|
|
150
222
|
path: string;
|
|
223
|
+
extract?: string | undefined;
|
|
224
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
225
|
+
maskDuplicates?: boolean | undefined;
|
|
151
226
|
injectHosts?: string[] | undefined;
|
|
152
227
|
}[] | undefined;
|
|
153
228
|
envVars?: {
|
|
@@ -185,22 +260,27 @@ export declare const NetworkConfigSchema: z.ZodObject<{
|
|
|
185
260
|
caCertPath: z.ZodOptional<z.ZodString>;
|
|
186
261
|
caKeyPath: z.ZodOptional<z.ZodString>;
|
|
187
262
|
excludeDomains: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
263
|
+
extraCaCertPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
188
264
|
}, "strip", z.ZodTypeAny, {
|
|
189
265
|
caCertPath?: string | undefined;
|
|
190
266
|
caKeyPath?: string | undefined;
|
|
191
267
|
excludeDomains?: string[] | undefined;
|
|
268
|
+
extraCaCertPaths?: string[] | undefined;
|
|
192
269
|
}, {
|
|
193
270
|
caCertPath?: string | undefined;
|
|
194
271
|
caKeyPath?: string | undefined;
|
|
195
272
|
excludeDomains?: string[] | undefined;
|
|
273
|
+
extraCaCertPaths?: string[] | undefined;
|
|
196
274
|
}>, {
|
|
197
275
|
caCertPath?: string | undefined;
|
|
198
276
|
caKeyPath?: string | undefined;
|
|
199
277
|
excludeDomains?: string[] | undefined;
|
|
278
|
+
extraCaCertPaths?: string[] | undefined;
|
|
200
279
|
}, {
|
|
201
280
|
caCertPath?: string | undefined;
|
|
202
281
|
caKeyPath?: string | undefined;
|
|
203
282
|
excludeDomains?: string[] | undefined;
|
|
283
|
+
extraCaCertPaths?: string[] | undefined;
|
|
204
284
|
}>>;
|
|
205
285
|
parentProxy: z.ZodOptional<z.ZodObject<{
|
|
206
286
|
http: z.ZodOptional<z.ZodString>;
|
|
@@ -234,6 +314,7 @@ export declare const NetworkConfigSchema: z.ZodObject<{
|
|
|
234
314
|
caCertPath?: string | undefined;
|
|
235
315
|
caKeyPath?: string | undefined;
|
|
236
316
|
excludeDomains?: string[] | undefined;
|
|
317
|
+
extraCaCertPaths?: string[] | undefined;
|
|
237
318
|
} | undefined;
|
|
238
319
|
parentProxy?: {
|
|
239
320
|
http?: string | undefined;
|
|
@@ -259,6 +340,7 @@ export declare const NetworkConfigSchema: z.ZodObject<{
|
|
|
259
340
|
caCertPath?: string | undefined;
|
|
260
341
|
caKeyPath?: string | undefined;
|
|
261
342
|
excludeDomains?: string[] | undefined;
|
|
343
|
+
extraCaCertPaths?: string[] | undefined;
|
|
262
344
|
} | undefined;
|
|
263
345
|
parentProxy?: {
|
|
264
346
|
http?: string | undefined;
|
|
@@ -312,29 +394,63 @@ export declare const RipgrepConfigSchema: z.ZodObject<{
|
|
|
312
394
|
args?: string[] | undefined;
|
|
313
395
|
argv0?: string | undefined;
|
|
314
396
|
}>;
|
|
397
|
+
/**
|
|
398
|
+
* Configuration for locating/invoking the `srt-win` helper (Windows
|
|
399
|
+
* only). An embedder that links `srt-win`'s CLI into its own
|
|
400
|
+
* multicall binary points `path` at that binary; spawns then pass
|
|
401
|
+
* `--srt-win` as `argv[1]` (see `SRT_WIN_DISPATCH_ARG1` in
|
|
402
|
+
* `windows-sandbox-utils.ts` / `srt_win::SRT_WIN_DISPATCH_ARG1`) so
|
|
403
|
+
* the embedder's dispatcher can route to `srt_win::run_from_args`.
|
|
404
|
+
* Windows cannot reliably preserve a spoofed `argv[0]` across
|
|
405
|
+
* `CreateProcessWithLogonW` / `ShellExecuteExW(runas)`, so dispatch
|
|
406
|
+
* keys on `argv[1]`, not on `argv[0]` like
|
|
407
|
+
* {@link SeccompConfigSchema} does on Linux.
|
|
408
|
+
*/
|
|
409
|
+
export declare const SrtWinConfigSchema: z.ZodObject<{
|
|
410
|
+
path: z.ZodOptional<z.ZodString>;
|
|
411
|
+
}, "strip", z.ZodTypeAny, {
|
|
412
|
+
path?: string | undefined;
|
|
413
|
+
}, {
|
|
414
|
+
path?: string | undefined;
|
|
415
|
+
}>;
|
|
315
416
|
/**
|
|
316
417
|
* Windows-specific configuration schema. See
|
|
317
418
|
* `windows-sandbox-utils.ts` for the install flow these settings
|
|
318
419
|
* must agree with.
|
|
420
|
+
*
|
|
421
|
+
* Canonical: `sublayerGuid`; the `wfpSublayerGuid` alias is resolved
|
|
422
|
+
* at read sites (`sublayerGuid ?? wfpSublayerGuid`) rather than via
|
|
423
|
+
* `.transform()` so this stays a plain `ZodObject` for consumers that
|
|
424
|
+
* `.extend()`/`.shape` it.
|
|
319
425
|
*/
|
|
320
426
|
export declare const WindowsConfigSchema: z.ZodObject<{
|
|
321
|
-
|
|
322
|
-
|
|
427
|
+
sandboxUser: z.ZodOptional<z.ZodString>;
|
|
428
|
+
sublayerGuid: z.ZodOptional<z.ZodString>;
|
|
323
429
|
wfpSublayerGuid: z.ZodOptional<z.ZodString>;
|
|
324
|
-
asSandboxUser: z.ZodDefault<z.ZodBoolean>;
|
|
325
430
|
proxyPortRange: z.ZodOptional<z.ZodEffects<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, [number, number], [number, number]>>;
|
|
431
|
+
srtWin: z.ZodOptional<z.ZodObject<{
|
|
432
|
+
path: z.ZodOptional<z.ZodString>;
|
|
433
|
+
}, "strip", z.ZodTypeAny, {
|
|
434
|
+
path?: string | undefined;
|
|
435
|
+
}, {
|
|
436
|
+
path?: string | undefined;
|
|
437
|
+
}>>;
|
|
326
438
|
}, "strip", z.ZodTypeAny, {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
groupSid?: string | undefined;
|
|
439
|
+
sandboxUser?: string | undefined;
|
|
440
|
+
sublayerGuid?: string | undefined;
|
|
330
441
|
wfpSublayerGuid?: string | undefined;
|
|
331
442
|
proxyPortRange?: [number, number] | undefined;
|
|
443
|
+
srtWin?: {
|
|
444
|
+
path?: string | undefined;
|
|
445
|
+
} | undefined;
|
|
332
446
|
}, {
|
|
333
|
-
|
|
334
|
-
|
|
447
|
+
sandboxUser?: string | undefined;
|
|
448
|
+
sublayerGuid?: string | undefined;
|
|
335
449
|
wfpSublayerGuid?: string | undefined;
|
|
336
|
-
asSandboxUser?: boolean | undefined;
|
|
337
450
|
proxyPortRange?: [number, number] | undefined;
|
|
451
|
+
srtWin?: {
|
|
452
|
+
path?: string | undefined;
|
|
453
|
+
} | undefined;
|
|
338
454
|
}>;
|
|
339
455
|
/**
|
|
340
456
|
* Seccomp configuration schema (Linux only)
|
|
@@ -378,22 +494,27 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
378
494
|
caCertPath: z.ZodOptional<z.ZodString>;
|
|
379
495
|
caKeyPath: z.ZodOptional<z.ZodString>;
|
|
380
496
|
excludeDomains: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
497
|
+
extraCaCertPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
381
498
|
}, "strip", z.ZodTypeAny, {
|
|
382
499
|
caCertPath?: string | undefined;
|
|
383
500
|
caKeyPath?: string | undefined;
|
|
384
501
|
excludeDomains?: string[] | undefined;
|
|
502
|
+
extraCaCertPaths?: string[] | undefined;
|
|
385
503
|
}, {
|
|
386
504
|
caCertPath?: string | undefined;
|
|
387
505
|
caKeyPath?: string | undefined;
|
|
388
506
|
excludeDomains?: string[] | undefined;
|
|
507
|
+
extraCaCertPaths?: string[] | undefined;
|
|
389
508
|
}>, {
|
|
390
509
|
caCertPath?: string | undefined;
|
|
391
510
|
caKeyPath?: string | undefined;
|
|
392
511
|
excludeDomains?: string[] | undefined;
|
|
512
|
+
extraCaCertPaths?: string[] | undefined;
|
|
393
513
|
}, {
|
|
394
514
|
caCertPath?: string | undefined;
|
|
395
515
|
caKeyPath?: string | undefined;
|
|
396
516
|
excludeDomains?: string[] | undefined;
|
|
517
|
+
extraCaCertPaths?: string[] | undefined;
|
|
397
518
|
}>>;
|
|
398
519
|
parentProxy: z.ZodOptional<z.ZodObject<{
|
|
399
520
|
http: z.ZodOptional<z.ZodString>;
|
|
@@ -427,6 +548,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
427
548
|
caCertPath?: string | undefined;
|
|
428
549
|
caKeyPath?: string | undefined;
|
|
429
550
|
excludeDomains?: string[] | undefined;
|
|
551
|
+
extraCaCertPaths?: string[] | undefined;
|
|
430
552
|
} | undefined;
|
|
431
553
|
parentProxy?: {
|
|
432
554
|
http?: string | undefined;
|
|
@@ -452,6 +574,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
452
574
|
caCertPath?: string | undefined;
|
|
453
575
|
caKeyPath?: string | undefined;
|
|
454
576
|
excludeDomains?: string[] | undefined;
|
|
577
|
+
extraCaCertPaths?: string[] | undefined;
|
|
455
578
|
} | undefined;
|
|
456
579
|
parentProxy?: {
|
|
457
580
|
http?: string | undefined;
|
|
@@ -485,14 +608,41 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
485
608
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
486
609
|
path: z.ZodString;
|
|
487
610
|
mode: z.ZodEnum<["deny", "mask"]>;
|
|
611
|
+
extract: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
612
|
+
/**
|
|
613
|
+
* What to do when `extract` matches nothing in the file at runtime.
|
|
614
|
+
*
|
|
615
|
+
* - `"warn"` (default): emit a stderr warning and leave the file
|
|
616
|
+
* readable as-is inside the sandbox (fail-open). A non-matching
|
|
617
|
+
* pattern is treated as a config error to surface and fix, not a
|
|
618
|
+
* reason to break a tool that needs the file when the credential is
|
|
619
|
+
* legitimately absent.
|
|
620
|
+
* - `"deny"`: degrade the entry to `mode: "deny"` so the file is
|
|
621
|
+
* unreadable inside the sandbox (fail-closed). The operator declared
|
|
622
|
+
* this file as containing a credential; if the regex cannot find it,
|
|
623
|
+
* block access rather than expose it.
|
|
624
|
+
* - `"error"`: throw at wrap time so nothing runs until the operator
|
|
625
|
+
* fixes the regex.
|
|
626
|
+
*
|
|
627
|
+
* Only meaningful when `mode` is `"mask"` and `extract` is set;
|
|
628
|
+
* accepted but ignored otherwise.
|
|
629
|
+
*/
|
|
630
|
+
onExtractNoMatch: z.ZodOptional<z.ZodEnum<["warn", "deny", "error"]>>;
|
|
631
|
+
maskDuplicates: z.ZodOptional<z.ZodBoolean>;
|
|
488
632
|
injectHosts: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
489
633
|
}, "strip", z.ZodTypeAny, {
|
|
490
634
|
mode: "deny" | "mask";
|
|
491
635
|
path: string;
|
|
636
|
+
extract?: string | undefined;
|
|
637
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
638
|
+
maskDuplicates?: boolean | undefined;
|
|
492
639
|
injectHosts?: string[] | undefined;
|
|
493
640
|
}, {
|
|
494
641
|
mode: "deny" | "mask";
|
|
495
642
|
path: string;
|
|
643
|
+
extract?: string | undefined;
|
|
644
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
645
|
+
maskDuplicates?: boolean | undefined;
|
|
496
646
|
injectHosts?: string[] | undefined;
|
|
497
647
|
}>, "many">>;
|
|
498
648
|
envVars: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -513,6 +663,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
513
663
|
files?: {
|
|
514
664
|
mode: "deny" | "mask";
|
|
515
665
|
path: string;
|
|
666
|
+
extract?: string | undefined;
|
|
667
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
668
|
+
maskDuplicates?: boolean | undefined;
|
|
516
669
|
injectHosts?: string[] | undefined;
|
|
517
670
|
}[] | undefined;
|
|
518
671
|
envVars?: {
|
|
@@ -525,6 +678,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
525
678
|
files?: {
|
|
526
679
|
mode: "deny" | "mask";
|
|
527
680
|
path: string;
|
|
681
|
+
extract?: string | undefined;
|
|
682
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
683
|
+
maskDuplicates?: boolean | undefined;
|
|
528
684
|
injectHosts?: string[] | undefined;
|
|
529
685
|
}[] | undefined;
|
|
530
686
|
envVars?: {
|
|
@@ -567,23 +723,33 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
567
723
|
bwrapPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
568
724
|
socatPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
569
725
|
windows: z.ZodOptional<z.ZodObject<{
|
|
570
|
-
|
|
571
|
-
|
|
726
|
+
sandboxUser: z.ZodOptional<z.ZodString>;
|
|
727
|
+
sublayerGuid: z.ZodOptional<z.ZodString>;
|
|
572
728
|
wfpSublayerGuid: z.ZodOptional<z.ZodString>;
|
|
573
|
-
asSandboxUser: z.ZodDefault<z.ZodBoolean>;
|
|
574
729
|
proxyPortRange: z.ZodOptional<z.ZodEffects<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, [number, number], [number, number]>>;
|
|
730
|
+
srtWin: z.ZodOptional<z.ZodObject<{
|
|
731
|
+
path: z.ZodOptional<z.ZodString>;
|
|
732
|
+
}, "strip", z.ZodTypeAny, {
|
|
733
|
+
path?: string | undefined;
|
|
734
|
+
}, {
|
|
735
|
+
path?: string | undefined;
|
|
736
|
+
}>>;
|
|
575
737
|
}, "strip", z.ZodTypeAny, {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
groupSid?: string | undefined;
|
|
738
|
+
sandboxUser?: string | undefined;
|
|
739
|
+
sublayerGuid?: string | undefined;
|
|
579
740
|
wfpSublayerGuid?: string | undefined;
|
|
580
741
|
proxyPortRange?: [number, number] | undefined;
|
|
742
|
+
srtWin?: {
|
|
743
|
+
path?: string | undefined;
|
|
744
|
+
} | undefined;
|
|
581
745
|
}, {
|
|
582
|
-
|
|
583
|
-
|
|
746
|
+
sandboxUser?: string | undefined;
|
|
747
|
+
sublayerGuid?: string | undefined;
|
|
584
748
|
wfpSublayerGuid?: string | undefined;
|
|
585
|
-
asSandboxUser?: boolean | undefined;
|
|
586
749
|
proxyPortRange?: [number, number] | undefined;
|
|
750
|
+
srtWin?: {
|
|
751
|
+
path?: string | undefined;
|
|
752
|
+
} | undefined;
|
|
587
753
|
}>>;
|
|
588
754
|
}, "strip", z.ZodTypeAny, {
|
|
589
755
|
network: {
|
|
@@ -605,6 +771,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
605
771
|
caCertPath?: string | undefined;
|
|
606
772
|
caKeyPath?: string | undefined;
|
|
607
773
|
excludeDomains?: string[] | undefined;
|
|
774
|
+
extraCaCertPaths?: string[] | undefined;
|
|
608
775
|
} | undefined;
|
|
609
776
|
parentProxy?: {
|
|
610
777
|
http?: string | undefined;
|
|
@@ -624,6 +791,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
624
791
|
files?: {
|
|
625
792
|
mode: "deny" | "mask";
|
|
626
793
|
path: string;
|
|
794
|
+
extract?: string | undefined;
|
|
795
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
796
|
+
maskDuplicates?: boolean | undefined;
|
|
627
797
|
injectHosts?: string[] | undefined;
|
|
628
798
|
}[] | undefined;
|
|
629
799
|
envVars?: {
|
|
@@ -652,11 +822,13 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
652
822
|
bwrapPath?: string | undefined;
|
|
653
823
|
socatPath?: string | undefined;
|
|
654
824
|
windows?: {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
groupSid?: string | undefined;
|
|
825
|
+
sandboxUser?: string | undefined;
|
|
826
|
+
sublayerGuid?: string | undefined;
|
|
658
827
|
wfpSublayerGuid?: string | undefined;
|
|
659
828
|
proxyPortRange?: [number, number] | undefined;
|
|
829
|
+
srtWin?: {
|
|
830
|
+
path?: string | undefined;
|
|
831
|
+
} | undefined;
|
|
660
832
|
} | undefined;
|
|
661
833
|
}, {
|
|
662
834
|
network: {
|
|
@@ -678,6 +850,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
678
850
|
caCertPath?: string | undefined;
|
|
679
851
|
caKeyPath?: string | undefined;
|
|
680
852
|
excludeDomains?: string[] | undefined;
|
|
853
|
+
extraCaCertPaths?: string[] | undefined;
|
|
681
854
|
} | undefined;
|
|
682
855
|
parentProxy?: {
|
|
683
856
|
http?: string | undefined;
|
|
@@ -697,6 +870,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
697
870
|
files?: {
|
|
698
871
|
mode: "deny" | "mask";
|
|
699
872
|
path: string;
|
|
873
|
+
extract?: string | undefined;
|
|
874
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
875
|
+
maskDuplicates?: boolean | undefined;
|
|
700
876
|
injectHosts?: string[] | undefined;
|
|
701
877
|
}[] | undefined;
|
|
702
878
|
envVars?: {
|
|
@@ -725,11 +901,13 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
725
901
|
bwrapPath?: string | undefined;
|
|
726
902
|
socatPath?: string | undefined;
|
|
727
903
|
windows?: {
|
|
728
|
-
|
|
729
|
-
|
|
904
|
+
sandboxUser?: string | undefined;
|
|
905
|
+
sublayerGuid?: string | undefined;
|
|
730
906
|
wfpSublayerGuid?: string | undefined;
|
|
731
|
-
asSandboxUser?: boolean | undefined;
|
|
732
907
|
proxyPortRange?: [number, number] | undefined;
|
|
908
|
+
srtWin?: {
|
|
909
|
+
path?: string | undefined;
|
|
910
|
+
} | undefined;
|
|
733
911
|
} | undefined;
|
|
734
912
|
}>, {
|
|
735
913
|
network: {
|
|
@@ -751,6 +929,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
751
929
|
caCertPath?: string | undefined;
|
|
752
930
|
caKeyPath?: string | undefined;
|
|
753
931
|
excludeDomains?: string[] | undefined;
|
|
932
|
+
extraCaCertPaths?: string[] | undefined;
|
|
754
933
|
} | undefined;
|
|
755
934
|
parentProxy?: {
|
|
756
935
|
http?: string | undefined;
|
|
@@ -770,6 +949,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
770
949
|
files?: {
|
|
771
950
|
mode: "deny" | "mask";
|
|
772
951
|
path: string;
|
|
952
|
+
extract?: string | undefined;
|
|
953
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
954
|
+
maskDuplicates?: boolean | undefined;
|
|
773
955
|
injectHosts?: string[] | undefined;
|
|
774
956
|
}[] | undefined;
|
|
775
957
|
envVars?: {
|
|
@@ -798,11 +980,13 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
798
980
|
bwrapPath?: string | undefined;
|
|
799
981
|
socatPath?: string | undefined;
|
|
800
982
|
windows?: {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
groupSid?: string | undefined;
|
|
983
|
+
sandboxUser?: string | undefined;
|
|
984
|
+
sublayerGuid?: string | undefined;
|
|
804
985
|
wfpSublayerGuid?: string | undefined;
|
|
805
986
|
proxyPortRange?: [number, number] | undefined;
|
|
987
|
+
srtWin?: {
|
|
988
|
+
path?: string | undefined;
|
|
989
|
+
} | undefined;
|
|
806
990
|
} | undefined;
|
|
807
991
|
}, {
|
|
808
992
|
network: {
|
|
@@ -824,6 +1008,7 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
824
1008
|
caCertPath?: string | undefined;
|
|
825
1009
|
caKeyPath?: string | undefined;
|
|
826
1010
|
excludeDomains?: string[] | undefined;
|
|
1011
|
+
extraCaCertPaths?: string[] | undefined;
|
|
827
1012
|
} | undefined;
|
|
828
1013
|
parentProxy?: {
|
|
829
1014
|
http?: string | undefined;
|
|
@@ -843,6 +1028,9 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
843
1028
|
files?: {
|
|
844
1029
|
mode: "deny" | "mask";
|
|
845
1030
|
path: string;
|
|
1031
|
+
extract?: string | undefined;
|
|
1032
|
+
onExtractNoMatch?: "error" | "warn" | "deny" | undefined;
|
|
1033
|
+
maskDuplicates?: boolean | undefined;
|
|
846
1034
|
injectHosts?: string[] | undefined;
|
|
847
1035
|
}[] | undefined;
|
|
848
1036
|
envVars?: {
|
|
@@ -871,11 +1059,13 @@ export declare const SandboxRuntimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
871
1059
|
bwrapPath?: string | undefined;
|
|
872
1060
|
socatPath?: string | undefined;
|
|
873
1061
|
windows?: {
|
|
874
|
-
|
|
875
|
-
|
|
1062
|
+
sandboxUser?: string | undefined;
|
|
1063
|
+
sublayerGuid?: string | undefined;
|
|
876
1064
|
wfpSublayerGuid?: string | undefined;
|
|
877
|
-
asSandboxUser?: boolean | undefined;
|
|
878
1065
|
proxyPortRange?: [number, number] | undefined;
|
|
1066
|
+
srtWin?: {
|
|
1067
|
+
path?: string | undefined;
|
|
1068
|
+
} | undefined;
|
|
879
1069
|
} | undefined;
|
|
880
1070
|
}>;
|
|
881
1071
|
export type MitmProxyConfig = z.infer<typeof MitmProxyConfigSchema>;
|
|
@@ -889,6 +1079,7 @@ export type CredentialsConfig = z.infer<typeof CredentialsConfigSchema>;
|
|
|
889
1079
|
export type IgnoreViolationsConfig = z.infer<typeof IgnoreViolationsConfigSchema>;
|
|
890
1080
|
export type RipgrepConfig = z.infer<typeof RipgrepConfigSchema>;
|
|
891
1081
|
export type SeccompConfig = z.infer<typeof SeccompConfigSchema>;
|
|
1082
|
+
export type SrtWinConfig = z.infer<typeof SrtWinConfigSchema>;
|
|
892
1083
|
export type WindowsConfig = z.infer<typeof WindowsConfigSchema>;
|
|
893
1084
|
export type SandboxRuntimeConfig = z.infer<typeof SandboxRuntimeConfigSchema>;
|
|
894
1085
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-config.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAGhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiEvB;;;GAGG;AACH,QAAA,MAAM,qBAAqB;;;;;;;;;EAQzB,CAAA;AAEF;;;;GAIG;AACH,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAoB3B,CAAA;AAEF;;;;;;;;;GASG;AACH,QAAA,MAAM,oBAAoB,6BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"sandbox-config.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAGhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAi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