@secure-exec/core 0.1.1-rc.3 → 0.2.0-rc.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/dist/esm-compiler.d.ts +5 -1
- package/dist/esm-compiler.js +5 -1
- package/dist/fs-helpers.d.ts +1 -1
- package/dist/generated/isolate-runtime.d.ts +15 -15
- package/dist/generated/isolate-runtime.js +15 -15
- package/dist/index.d.ts +24 -5
- package/dist/index.js +23 -3
- package/dist/isolate-runtime/apply-custom-global-policy.js +3 -3
- package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +2 -2
- package/dist/isolate-runtime/apply-timing-mitigation-off.js +2 -2
- package/dist/isolate-runtime/bridge-attach.js +2 -2
- package/dist/isolate-runtime/bridge-initial-globals.js +145 -6
- package/dist/isolate-runtime/eval-script-result.js +1 -1
- package/dist/isolate-runtime/global-exposure-helpers.js +2 -2
- package/dist/isolate-runtime/init-commonjs-module-globals.js +2 -2
- package/dist/isolate-runtime/override-process-cwd.js +1 -1
- package/dist/isolate-runtime/override-process-env.js +1 -1
- package/dist/isolate-runtime/require-setup.js +1600 -338
- package/dist/isolate-runtime/set-commonjs-file-globals.js +2 -2
- package/dist/isolate-runtime/set-stdin-data.js +1 -1
- package/dist/isolate-runtime/setup-dynamic-import.js +47 -19
- package/dist/isolate-runtime/setup-fs-facade.js +62 -23
- package/dist/kernel/command-registry.d.ts +44 -0
- package/dist/kernel/command-registry.js +114 -0
- package/dist/kernel/device-layer.d.ts +12 -0
- package/dist/kernel/device-layer.js +262 -0
- package/dist/kernel/dns-cache.d.ts +29 -0
- package/dist/kernel/dns-cache.js +52 -0
- package/dist/kernel/fd-table.d.ts +84 -0
- package/dist/kernel/fd-table.js +278 -0
- package/dist/kernel/file-lock.d.ts +34 -0
- package/dist/kernel/file-lock.js +123 -0
- package/dist/kernel/host-adapter.d.ts +50 -0
- package/dist/kernel/host-adapter.js +8 -0
- package/dist/kernel/index.d.ts +36 -0
- package/dist/kernel/index.js +34 -0
- package/dist/kernel/inode-table.d.ts +43 -0
- package/dist/kernel/inode-table.js +85 -0
- package/dist/kernel/kernel.d.ts +9 -0
- package/dist/kernel/kernel.js +1396 -0
- package/dist/kernel/permissions.d.ts +27 -0
- package/dist/kernel/permissions.js +118 -0
- package/dist/kernel/pipe-manager.d.ts +64 -0
- package/dist/kernel/pipe-manager.js +267 -0
- package/dist/kernel/proc-layer.d.ts +11 -0
- package/dist/kernel/proc-layer.js +501 -0
- package/dist/kernel/process-table.d.ts +124 -0
- package/dist/kernel/process-table.js +631 -0
- package/dist/kernel/pty.d.ts +108 -0
- package/dist/kernel/pty.js +541 -0
- package/dist/kernel/socket-table.d.ts +305 -0
- package/dist/kernel/socket-table.js +1124 -0
- package/dist/kernel/timer-table.d.ts +54 -0
- package/dist/kernel/timer-table.js +108 -0
- package/dist/kernel/types.d.ts +500 -0
- package/dist/kernel/types.js +89 -0
- package/dist/kernel/user.d.ts +29 -0
- package/dist/kernel/user.js +35 -0
- package/dist/kernel/vfs.d.ts +54 -0
- package/dist/kernel/vfs.js +8 -0
- package/dist/kernel/wait.d.ts +45 -0
- package/dist/kernel/wait.js +112 -0
- package/dist/kernel/wstatus.d.ts +21 -0
- package/dist/kernel/wstatus.js +33 -0
- package/dist/module-resolver.d.ts +4 -0
- package/dist/module-resolver.js +4 -0
- package/dist/package-bundler.d.ts +6 -1
- package/dist/runtime-driver.d.ts +3 -1
- package/dist/shared/bridge-contract.d.ts +329 -20
- package/dist/shared/bridge-contract.js +60 -5
- package/dist/shared/console-formatter.js +8 -4
- package/dist/shared/global-exposure.js +269 -19
- package/dist/shared/in-memory-fs.d.ts +30 -11
- package/dist/shared/in-memory-fs.js +383 -109
- package/dist/shared/permissions.d.ts +4 -6
- package/dist/shared/permissions.js +19 -39
- package/dist/types.d.ts +8 -159
- package/dist/types.js +5 -0
- package/package.json +12 -22
- package/dist/bridge/active-handles.d.ts +0 -22
- package/dist/bridge/active-handles.js +0 -55
- package/dist/bridge/child-process.d.ts +0 -99
- package/dist/bridge/child-process.js +0 -670
- package/dist/bridge/fs.d.ts +0 -281
- package/dist/bridge/fs.js +0 -2235
- package/dist/bridge/index.d.ts +0 -10
- package/dist/bridge/index.js +0 -41
- package/dist/bridge/module.d.ts +0 -75
- package/dist/bridge/module.js +0 -308
- package/dist/bridge/network.d.ts +0 -350
- package/dist/bridge/network.js +0 -2050
- package/dist/bridge/os.d.ts +0 -13
- package/dist/bridge/os.js +0 -256
- package/dist/bridge/polyfills.d.ts +0 -2
- package/dist/bridge/polyfills.js +0 -11
- package/dist/bridge/process.d.ts +0 -89
- package/dist/bridge/process.js +0 -1015
- package/dist/bridge.js +0 -12496
- package/dist/python-runtime.d.ts +0 -16
- package/dist/python-runtime.js +0 -45
- package/dist/runtime.d.ts +0 -31
- package/dist/runtime.js +0 -69
|
@@ -148,10 +148,14 @@ export function getConsoleSetupCode(budget = DEFAULT_CONSOLE_SERIALIZATION_BUDGE
|
|
|
148
148
|
const formatConsoleArgs = ${formatConsoleArgs.toString()};
|
|
149
149
|
|
|
150
150
|
globalThis.console = {
|
|
151
|
-
log: (...args) => _log
|
|
152
|
-
error: (...args) => _error
|
|
153
|
-
warn: (...args) => _error
|
|
154
|
-
info: (...args) => _log
|
|
151
|
+
log: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
|
|
152
|
+
error: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
|
|
153
|
+
warn: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
|
|
154
|
+
info: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
|
|
155
|
+
debug: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
|
|
156
|
+
trace: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
|
|
157
|
+
dir: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
|
|
158
|
+
table: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
|
|
155
159
|
};
|
|
156
160
|
`;
|
|
157
161
|
}
|
|
@@ -75,6 +75,26 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
75
75
|
classification: "hardened",
|
|
76
76
|
rationale: "Bridge-owned dns module handle for require resolution.",
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
name: "_dgramModule",
|
|
80
|
+
classification: "hardened",
|
|
81
|
+
rationale: "Bridge-owned dgram module handle for require resolution.",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "_netModule",
|
|
85
|
+
classification: "hardened",
|
|
86
|
+
rationale: "Bridge-owned net module handle for require resolution.",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "_tlsModule",
|
|
90
|
+
classification: "hardened",
|
|
91
|
+
rationale: "Bridge-owned tls module handle for require resolution.",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "_netSocketDispatch",
|
|
95
|
+
classification: "hardened",
|
|
96
|
+
rationale: "Host-to-sandbox net socket event dispatch entrypoint.",
|
|
97
|
+
},
|
|
78
98
|
{
|
|
79
99
|
name: "_httpServerDispatch",
|
|
80
100
|
classification: "hardened",
|
|
@@ -83,17 +103,32 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
83
103
|
{
|
|
84
104
|
name: "_httpServerUpgradeDispatch",
|
|
85
105
|
classification: "hardened",
|
|
86
|
-
rationale: "Host-to-sandbox HTTP
|
|
106
|
+
rationale: "Host-to-sandbox HTTP upgrade dispatch entrypoint.",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "_httpServerConnectDispatch",
|
|
110
|
+
classification: "hardened",
|
|
111
|
+
rationale: "Host-to-sandbox HTTP CONNECT dispatch entrypoint.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "_http2Dispatch",
|
|
115
|
+
classification: "hardened",
|
|
116
|
+
rationale: "Host-to-sandbox HTTP/2 event dispatch entrypoint.",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "_timerDispatch",
|
|
120
|
+
classification: "hardened",
|
|
121
|
+
rationale: "Host-to-sandbox timer callback dispatch entrypoint.",
|
|
87
122
|
},
|
|
88
123
|
{
|
|
89
124
|
name: "_upgradeSocketData",
|
|
90
125
|
classification: "hardened",
|
|
91
|
-
rationale: "Host-to-sandbox upgrade socket data
|
|
126
|
+
rationale: "Host-to-sandbox HTTP upgrade socket data dispatch entrypoint.",
|
|
92
127
|
},
|
|
93
128
|
{
|
|
94
129
|
name: "_upgradeSocketEnd",
|
|
95
130
|
classification: "hardened",
|
|
96
|
-
rationale: "Host-to-sandbox upgrade socket
|
|
131
|
+
rationale: "Host-to-sandbox HTTP upgrade socket close dispatch entrypoint.",
|
|
97
132
|
},
|
|
98
133
|
{
|
|
99
134
|
name: "ProcessExitError",
|
|
@@ -125,6 +160,16 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
125
160
|
classification: "hardened",
|
|
126
161
|
rationale: "Host file-loading bridge reference.",
|
|
127
162
|
},
|
|
163
|
+
{
|
|
164
|
+
name: "_resolveModuleSync",
|
|
165
|
+
classification: "hardened",
|
|
166
|
+
rationale: "Host synchronous module-resolution bridge reference.",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "_loadFileSync",
|
|
170
|
+
classification: "hardened",
|
|
171
|
+
rationale: "Host synchronous file-loading bridge reference.",
|
|
172
|
+
},
|
|
128
173
|
{
|
|
129
174
|
name: "_scheduleTimer",
|
|
130
175
|
classification: "hardened",
|
|
@@ -143,67 +188,107 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
143
188
|
{
|
|
144
189
|
name: "_cryptoHashDigest",
|
|
145
190
|
classification: "hardened",
|
|
146
|
-
rationale: "Host crypto bridge reference
|
|
191
|
+
rationale: "Host crypto digest bridge reference.",
|
|
147
192
|
},
|
|
148
193
|
{
|
|
149
194
|
name: "_cryptoHmacDigest",
|
|
150
195
|
classification: "hardened",
|
|
151
|
-
rationale: "Host crypto bridge reference
|
|
196
|
+
rationale: "Host crypto HMAC bridge reference.",
|
|
152
197
|
},
|
|
153
198
|
{
|
|
154
199
|
name: "_cryptoPbkdf2",
|
|
155
200
|
classification: "hardened",
|
|
156
|
-
rationale: "Host crypto bridge reference
|
|
201
|
+
rationale: "Host crypto PBKDF2 bridge reference.",
|
|
157
202
|
},
|
|
158
203
|
{
|
|
159
204
|
name: "_cryptoScrypt",
|
|
160
205
|
classification: "hardened",
|
|
161
|
-
rationale: "Host crypto bridge reference
|
|
206
|
+
rationale: "Host crypto scrypt bridge reference.",
|
|
162
207
|
},
|
|
163
208
|
{
|
|
164
209
|
name: "_cryptoCipheriv",
|
|
165
210
|
classification: "hardened",
|
|
166
|
-
rationale: "Host crypto bridge reference
|
|
211
|
+
rationale: "Host crypto cipher bridge reference.",
|
|
167
212
|
},
|
|
168
213
|
{
|
|
169
214
|
name: "_cryptoDecipheriv",
|
|
170
215
|
classification: "hardened",
|
|
171
|
-
rationale: "Host crypto bridge reference
|
|
216
|
+
rationale: "Host crypto decipher bridge reference.",
|
|
172
217
|
},
|
|
173
218
|
{
|
|
174
219
|
name: "_cryptoCipherivCreate",
|
|
175
220
|
classification: "hardened",
|
|
176
|
-
rationale: "Host
|
|
221
|
+
rationale: "Host streaming cipher bridge reference.",
|
|
177
222
|
},
|
|
178
223
|
{
|
|
179
224
|
name: "_cryptoCipherivUpdate",
|
|
180
225
|
classification: "hardened",
|
|
181
|
-
rationale: "Host
|
|
226
|
+
rationale: "Host streaming cipher update bridge reference.",
|
|
182
227
|
},
|
|
183
228
|
{
|
|
184
229
|
name: "_cryptoCipherivFinal",
|
|
185
230
|
classification: "hardened",
|
|
186
|
-
rationale: "Host
|
|
231
|
+
rationale: "Host streaming cipher finalization bridge reference.",
|
|
187
232
|
},
|
|
188
233
|
{
|
|
189
234
|
name: "_cryptoSign",
|
|
190
235
|
classification: "hardened",
|
|
191
|
-
rationale: "Host crypto bridge reference
|
|
236
|
+
rationale: "Host crypto sign bridge reference.",
|
|
192
237
|
},
|
|
193
238
|
{
|
|
194
239
|
name: "_cryptoVerify",
|
|
195
240
|
classification: "hardened",
|
|
196
|
-
rationale: "Host crypto bridge reference
|
|
241
|
+
rationale: "Host crypto verify bridge reference.",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "_cryptoAsymmetricOp",
|
|
245
|
+
classification: "hardened",
|
|
246
|
+
rationale: "Host asymmetric crypto operation bridge reference.",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "_cryptoCreateKeyObject",
|
|
250
|
+
classification: "hardened",
|
|
251
|
+
rationale: "Host asymmetric key import bridge reference.",
|
|
197
252
|
},
|
|
198
253
|
{
|
|
199
254
|
name: "_cryptoGenerateKeyPairSync",
|
|
200
255
|
classification: "hardened",
|
|
201
|
-
rationale: "Host crypto bridge reference
|
|
256
|
+
rationale: "Host crypto key-pair generation bridge reference.",
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "_cryptoGenerateKeySync",
|
|
260
|
+
classification: "hardened",
|
|
261
|
+
rationale: "Host symmetric crypto key generation bridge reference.",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "_cryptoGeneratePrimeSync",
|
|
265
|
+
classification: "hardened",
|
|
266
|
+
rationale: "Host prime generation bridge reference.",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "_cryptoDiffieHellman",
|
|
270
|
+
classification: "hardened",
|
|
271
|
+
rationale: "Host stateless Diffie-Hellman bridge reference.",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "_cryptoDiffieHellmanGroup",
|
|
275
|
+
classification: "hardened",
|
|
276
|
+
rationale: "Host Diffie-Hellman group bridge reference.",
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "_cryptoDiffieHellmanSessionCreate",
|
|
280
|
+
classification: "hardened",
|
|
281
|
+
rationale: "Host Diffie-Hellman/ECDH session creation bridge reference.",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "_cryptoDiffieHellmanSessionCall",
|
|
285
|
+
classification: "hardened",
|
|
286
|
+
rationale: "Host Diffie-Hellman/ECDH session method bridge reference.",
|
|
202
287
|
},
|
|
203
288
|
{
|
|
204
289
|
name: "_cryptoSubtle",
|
|
205
290
|
classification: "hardened",
|
|
206
|
-
rationale: "Host
|
|
291
|
+
rationale: "Host WebCrypto subtle bridge reference.",
|
|
207
292
|
},
|
|
208
293
|
{
|
|
209
294
|
name: "_fsReadFile",
|
|
@@ -355,20 +440,180 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
355
440
|
classification: "hardened",
|
|
356
441
|
rationale: "Host network bridge reference.",
|
|
357
442
|
},
|
|
443
|
+
{
|
|
444
|
+
name: "_networkHttpServerRespondRaw",
|
|
445
|
+
classification: "hardened",
|
|
446
|
+
rationale: "Host network bridge reference for sandbox HTTP server responses.",
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: "_networkHttpServerWaitRaw",
|
|
450
|
+
classification: "hardened",
|
|
451
|
+
rationale: "Host network bridge reference for sandbox HTTP server lifetime tracking.",
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "_networkHttp2ServerListenRaw",
|
|
455
|
+
classification: "hardened",
|
|
456
|
+
rationale: "Host HTTP/2 server listen bridge reference.",
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "_networkHttp2ServerCloseRaw",
|
|
460
|
+
classification: "hardened",
|
|
461
|
+
rationale: "Host HTTP/2 server close bridge reference.",
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "_networkHttp2ServerWaitRaw",
|
|
465
|
+
classification: "hardened",
|
|
466
|
+
rationale: "Host HTTP/2 server lifetime bridge reference.",
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: "_networkHttp2SessionConnectRaw",
|
|
470
|
+
classification: "hardened",
|
|
471
|
+
rationale: "Host HTTP/2 session connect bridge reference.",
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: "_networkHttp2SessionRequestRaw",
|
|
475
|
+
classification: "hardened",
|
|
476
|
+
rationale: "Host HTTP/2 session request bridge reference.",
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: "_networkHttp2SessionSettingsRaw",
|
|
480
|
+
classification: "hardened",
|
|
481
|
+
rationale: "Host HTTP/2 session settings bridge reference.",
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: "_networkHttp2SessionGoawayRaw",
|
|
485
|
+
classification: "hardened",
|
|
486
|
+
rationale: "Host HTTP/2 session GOAWAY bridge reference.",
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "_networkHttp2SessionCloseRaw",
|
|
490
|
+
classification: "hardened",
|
|
491
|
+
rationale: "Host HTTP/2 session close bridge reference.",
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: "_networkHttp2SessionDestroyRaw",
|
|
495
|
+
classification: "hardened",
|
|
496
|
+
rationale: "Host HTTP/2 session destroy bridge reference.",
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "_networkHttp2SessionWaitRaw",
|
|
500
|
+
classification: "hardened",
|
|
501
|
+
rationale: "Host HTTP/2 session lifetime bridge reference.",
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: "_networkHttp2StreamRespondRaw",
|
|
505
|
+
classification: "hardened",
|
|
506
|
+
rationale: "Host HTTP/2 stream respond bridge reference.",
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "_networkHttp2StreamPushStreamRaw",
|
|
510
|
+
classification: "hardened",
|
|
511
|
+
rationale: "Host HTTP/2 push stream bridge reference.",
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "_networkHttp2StreamWriteRaw",
|
|
515
|
+
classification: "hardened",
|
|
516
|
+
rationale: "Host HTTP/2 stream write bridge reference.",
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: "_networkHttp2StreamEndRaw",
|
|
520
|
+
classification: "hardened",
|
|
521
|
+
rationale: "Host HTTP/2 stream end bridge reference.",
|
|
522
|
+
},
|
|
358
523
|
{
|
|
359
524
|
name: "_upgradeSocketWriteRaw",
|
|
360
525
|
classification: "hardened",
|
|
361
|
-
rationale: "Host upgrade socket write bridge reference.",
|
|
526
|
+
rationale: "Host HTTP upgrade socket write bridge reference.",
|
|
362
527
|
},
|
|
363
528
|
{
|
|
364
529
|
name: "_upgradeSocketEndRaw",
|
|
365
530
|
classification: "hardened",
|
|
366
|
-
rationale: "Host upgrade socket
|
|
531
|
+
rationale: "Host HTTP upgrade socket half-close bridge reference.",
|
|
367
532
|
},
|
|
368
533
|
{
|
|
369
534
|
name: "_upgradeSocketDestroyRaw",
|
|
370
535
|
classification: "hardened",
|
|
371
|
-
rationale: "Host upgrade socket destroy bridge reference.",
|
|
536
|
+
rationale: "Host HTTP upgrade socket destroy bridge reference.",
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "_netSocketConnectRaw",
|
|
540
|
+
classification: "hardened",
|
|
541
|
+
rationale: "Host net socket connect bridge reference.",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: "_netSocketWaitConnectRaw",
|
|
545
|
+
classification: "hardened",
|
|
546
|
+
rationale: "Host net socket connect-wait bridge reference.",
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "_netSocketReadRaw",
|
|
550
|
+
classification: "hardened",
|
|
551
|
+
rationale: "Host net socket read bridge reference.",
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "_netSocketSetNoDelayRaw",
|
|
555
|
+
classification: "hardened",
|
|
556
|
+
rationale: "Host net socket no-delay bridge reference.",
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: "_netSocketSetKeepAliveRaw",
|
|
560
|
+
classification: "hardened",
|
|
561
|
+
rationale: "Host net socket keepalive bridge reference.",
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "_netSocketWriteRaw",
|
|
565
|
+
classification: "hardened",
|
|
566
|
+
rationale: "Host net socket write bridge reference.",
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "_netSocketEndRaw",
|
|
570
|
+
classification: "hardened",
|
|
571
|
+
rationale: "Host net socket end bridge reference.",
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "_netSocketDestroyRaw",
|
|
575
|
+
classification: "hardened",
|
|
576
|
+
rationale: "Host net socket destroy bridge reference.",
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: "_netSocketUpgradeTlsRaw",
|
|
580
|
+
classification: "hardened",
|
|
581
|
+
rationale: "Host net socket TLS-upgrade bridge reference.",
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "_netSocketGetTlsClientHelloRaw",
|
|
585
|
+
classification: "hardened",
|
|
586
|
+
rationale: "Host loopback TLS client-hello bridge reference.",
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "_netSocketTlsQueryRaw",
|
|
590
|
+
classification: "hardened",
|
|
591
|
+
rationale: "Host TLS socket query bridge reference.",
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: "_tlsGetCiphersRaw",
|
|
595
|
+
classification: "hardened",
|
|
596
|
+
rationale: "Host TLS cipher-list bridge reference.",
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "_netServerListenRaw",
|
|
600
|
+
classification: "hardened",
|
|
601
|
+
rationale: "Host net server listen bridge reference.",
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "_netServerAcceptRaw",
|
|
605
|
+
classification: "hardened",
|
|
606
|
+
rationale: "Host net server accept bridge reference.",
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: "_netServerCloseRaw",
|
|
610
|
+
classification: "hardened",
|
|
611
|
+
rationale: "Host net server close bridge reference.",
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
name: "_batchResolveModules",
|
|
615
|
+
classification: "hardened",
|
|
616
|
+
rationale: "Host bridge for batched module resolution to reduce IPC round-trips.",
|
|
372
617
|
},
|
|
373
618
|
{
|
|
374
619
|
name: "_ptySetRawMode",
|
|
@@ -475,6 +720,11 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
|
|
|
475
720
|
classification: "hardened",
|
|
476
721
|
rationale: "Blob API global stub — must not be replaceable by sandbox code.",
|
|
477
722
|
},
|
|
723
|
+
{
|
|
724
|
+
name: "FormData",
|
|
725
|
+
classification: "hardened",
|
|
726
|
+
rationale: "FormData API global stub — must not be replaceable by sandbox code.",
|
|
727
|
+
},
|
|
478
728
|
];
|
|
479
729
|
export const HARDENED_NODE_CUSTOM_GLOBALS = NODE_CUSTOM_GLOBAL_INVENTORY
|
|
480
730
|
.filter((entry) => entry.classification === "hardened")
|
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InodeTable } from "../kernel/inode-table.js";
|
|
2
|
+
import type { VirtualDirEntry, VirtualFileSystem, VirtualStat } from "../kernel/vfs.js";
|
|
2
3
|
/**
|
|
3
|
-
* A fully in-memory VirtualFileSystem backed by Maps.
|
|
4
|
+
* A fully in-memory VirtualFileSystem backed by inode-aware Maps.
|
|
4
5
|
* Used as the default filesystem for the browser sandbox and for tests.
|
|
5
6
|
* Paths are always POSIX-style (forward slashes, rooted at "/").
|
|
6
7
|
*/
|
|
7
8
|
export declare class InMemoryFileSystem implements VirtualFileSystem {
|
|
9
|
+
private inodeTable;
|
|
8
10
|
private files;
|
|
11
|
+
private fileContents;
|
|
9
12
|
private dirs;
|
|
10
13
|
private symlinks;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
constructor(inodeTable?: InodeTable);
|
|
15
|
+
setInodeTable(inodeTable: InodeTable): void;
|
|
16
|
+
getInodeForPath(path: string): number | null;
|
|
17
|
+
readFileByInode(ino: number): Uint8Array;
|
|
18
|
+
writeFileByInode(ino: number, content: Uint8Array): void;
|
|
19
|
+
preadByInode(ino: number, offset: number, length: number): Uint8Array;
|
|
20
|
+
statByInode(ino: number): VirtualStat;
|
|
21
|
+
deleteInodeData(ino: number): void;
|
|
15
22
|
private listDirEntries;
|
|
16
23
|
readFile(path: string): Promise<Uint8Array>;
|
|
17
24
|
readTextFile(path: string): Promise<string>;
|
|
18
25
|
readDir(path: string): Promise<string[]>;
|
|
19
|
-
readDirWithTypes(path: string): Promise<
|
|
20
|
-
name: string;
|
|
21
|
-
isDirectory: boolean;
|
|
22
|
-
}>>;
|
|
26
|
+
readDirWithTypes(path: string): Promise<VirtualDirEntry[]>;
|
|
23
27
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
28
|
+
prepareOpenSync(path: string, flags: number): boolean;
|
|
24
29
|
createDir(path: string): Promise<void>;
|
|
25
|
-
mkdir(path: string
|
|
30
|
+
mkdir(path: string, _options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
private resolveIfSymlink;
|
|
26
34
|
private resolveSymlink;
|
|
35
|
+
private statForInode;
|
|
27
36
|
private statEntry;
|
|
28
37
|
exists(path: string): Promise<boolean>;
|
|
29
38
|
stat(path: string): Promise<VirtualStat>;
|
|
@@ -37,6 +46,16 @@ export declare class InMemoryFileSystem implements VirtualFileSystem {
|
|
|
37
46
|
chmod(path: string, mode: number): Promise<void>;
|
|
38
47
|
chown(path: string, uid: number, gid: number): Promise<void>;
|
|
39
48
|
utimes(path: string, atime: number, mtime: number): Promise<void>;
|
|
49
|
+
realpath(path: string): Promise<string>;
|
|
50
|
+
pread(path: string, offset: number, length: number): Promise<Uint8Array>;
|
|
40
51
|
truncate(path: string, length: number): Promise<void>;
|
|
52
|
+
private reindexInodes;
|
|
53
|
+
private cloneInode;
|
|
54
|
+
private allocateFileInode;
|
|
55
|
+
private allocateDirectoryInode;
|
|
56
|
+
private updateFileMetadata;
|
|
57
|
+
private requirePathInode;
|
|
58
|
+
private requireFileInode;
|
|
59
|
+
private requireInode;
|
|
41
60
|
}
|
|
42
61
|
export declare function createInMemoryFileSystem(): InMemoryFileSystem;
|