@@ -92,6 +92,11 @@ This flag grants broad authority to configured OpenSSL STORE loaders, which may |
92 | 92 | access files, devices, tokens, or the network. Access performed by a loader is |
93 | 93 | not constrained by the `fs.read`, `fs.write`, or `net` permission scopes. |
94 | 94 |
|
| 95 | +Mounting a [virtual file system][] with [`vfs.mount()`][] throws |
| 96 | +`ERR_INVALID_STATE` unless the [`--allow-fs-vfs`][] flag is passed. A mounted |
| 97 | +VFS serves paths that the file system permissions do not describe, so it is not |
| 98 | +gated by [`--allow-fs-read`][] or [`--allow-fs-write`][]. |
| 99 | + |
95 | 100 | #### Runtime API |
96 | 101 |
|
97 | 102 | When enabling the Permission Model through the [`--permission`][] |
@@ -156,11 +161,11 @@ mode. Execution continues normally. |
156 | 161 |
|
157 | 162 | Audit mode is useful for discovering what permissions your application |
158 | 163 | requires before deploying with [`--permission`][]. It can also be combined |
159 | | -with the [`--allow-fs-read`][], [`--allow-fs-write`][], [`--allow-net`][], |
160 | | -[`--allow-child-process`][], [`--allow-worker`][], [`--allow-addons`][], |
161 | | -[`--allow-wasi`][], [`--allow-ffi`][], [`--allow-inspector`][], |
162 | | -and [`--allow-openssl-store`][] flags to audit a subset |
163 | | -of permissions while granting others. |
| 164 | +with the [`--allow-fs-read`][], [`--allow-fs-write`][], [`--allow-fs-vfs`][], |
| 165 | +[`--allow-net`][], [`--allow-child-process`][], |
| 166 | +[`--allow-worker`][], [`--allow-addons`][], [`--allow-wasi`][], |
| 167 | +[`--allow-ffi`][], [`--allow-inspector`][], and [`--allow-openssl-store`][] |
| 168 | +flags to audit a subset of permissions while granting others. |
164 | 169 |
|
165 | 170 | When a permission check fails in audit mode, a message is published to the |
166 | 171 | diagnostics channel corresponding to the denied scope. The channel names are: |
@@ -366,6 +371,7 @@ There are constraints you need to know before using this system: |
366 | 371 | * WASI |
367 | 372 | * FFI |
368 | 373 | * OpenSSL STORE loaders |
| 374 | + * Virtual file system mounting |
369 | 375 | * The Permission Model is initialized after the Node.js environment is set up. |
370 | 376 | However, certain flags such as `--env-file` or `--openssl-config` are designed |
371 | 377 | to read files before environment initialization. As a result, such flags are |
@@ -423,6 +429,7 @@ Developers relying on --permission to sandbox untrusted code should be aware tha |
423 | 429 | [`--allow-child-process`]: cli.md#--allow-child-process |
424 | 430 | [`--allow-ffi`]: cli.md#--allow-ffi |
425 | 431 | [`--allow-fs-read`]: cli.md#--allow-fs-read |
| 432 | +[`--allow-fs-vfs`]: cli.md#--allow-fs-vfs |
426 | 433 | [`--allow-fs-write`]: cli.md#--allow-fs-write |
427 | 434 | [`--allow-inspector`]: cli.md#--allow-inspector |
428 | 435 | [`--allow-net`]: cli.md#--allow-net |
@@ -436,3 +443,5 @@ Developers relying on --permission to sandbox untrusted code should be aware tha |
436 | 443 | [`npx`]: https://docs.npmjs.com/cli/commands/npx |
437 | 444 | [`permission.drop()`]: process.md#processpermissiondropscope-reference |
438 | 445 | [`permission.has()`]: process.md#processpermissionhasscope-reference |
| 446 | +[`vfs.mount()`]: vfs.md#vfsmount |
| 447 | +[virtual file system]: vfs.md |