mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
doc: document --allow-fs-vfs in the permission model page
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/66793 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
6511fb8e34
commit
84f8e2f3a9
1 file changed
+14
-5
+14
-5
@@ -94,6 +94,11 @@ This flag grants broad authority to configured OpenSSL STORE loaders, which may
|
||||
access files, devices, tokens, or the network. Access performed by a loader is
|
||||
not constrained by the `fs.read`, `fs.write`, or `net` permission scopes.
|
||||
|
||||
Mounting a [virtual file system][] with [`vfs.mount()`][] throws
|
||||
`ERR_INVALID_STATE` unless the [`--allow-fs-vfs`][] flag is passed. A mounted
|
||||
VFS serves paths that the file system permissions do not describe, so it is not
|
||||
gated by [`--allow-fs-read`][] or [`--allow-fs-write`][].
|
||||
|
||||
#### Runtime API
|
||||
|
||||
When enabling the Permission Model through the [`--permission`][]
|
||||
@@ -158,11 +163,11 @@ mode. Execution continues normally.
|
||||
|
||||
Audit mode is useful for discovering what permissions your application
|
||||
requires before deploying with [`--permission`][]. It can also be combined
|
||||
with the [`--allow-fs-read`][], [`--allow-fs-write`][], [`--allow-net`][],
|
||||
[`--allow-env`][], [`--allow-child-process`][], [`--allow-worker`][],
|
||||
[`--allow-addons`][], [`--allow-wasi`][], [`--allow-ffi`][],
|
||||
[`--allow-inspector`][], and [`--allow-openssl-store`][] flags to audit a subset
|
||||
of permissions while granting others.
|
||||
with the [`--allow-fs-read`][], [`--allow-fs-write`][], [`--allow-fs-vfs`][],
|
||||
[`--allow-net`][], [`--allow-env`][], [`--allow-child-process`][],
|
||||
[`--allow-worker`][], [`--allow-addons`][], [`--allow-wasi`][],
|
||||
[`--allow-ffi`][], [`--allow-inspector`][], and [`--allow-openssl-store`][]
|
||||
flags to audit a subset of permissions while granting others.
|
||||
|
||||
When a permission check fails in audit mode, a message is published to the
|
||||
diagnostics channel corresponding to the denied scope. The channel names are:
|
||||
@@ -484,6 +489,7 @@ There are constraints you need to know before using this system:
|
||||
* WASI
|
||||
* FFI
|
||||
* OpenSSL STORE loaders
|
||||
* Virtual file system mounting
|
||||
* The Permission Model is initialized after the Node.js environment is set up.
|
||||
However, certain flags such as `--env-file` or `--openssl-config` are designed
|
||||
to read files before environment initialization. As a result, such flags are
|
||||
@@ -542,6 +548,7 @@ Developers relying on --permission to sandbox untrusted code should be aware tha
|
||||
[`--allow-env`]: cli.md#--allow-env
|
||||
[`--allow-ffi`]: cli.md#--allow-ffi
|
||||
[`--allow-fs-read`]: cli.md#--allow-fs-read
|
||||
[`--allow-fs-vfs`]: cli.md#--allow-fs-vfs
|
||||
[`--allow-fs-write`]: cli.md#--allow-fs-write
|
||||
[`--allow-inspector`]: cli.md#--allow-inspector
|
||||
[`--allow-net`]: cli.md#--allow-net
|
||||
@@ -559,3 +566,5 @@ Developers relying on --permission to sandbox untrusted code should be aware tha
|
||||
[`permission.drop()`]: process.md#processpermissiondropscope-reference
|
||||
[`permission.has()`]: process.md#processpermissionhasscope-reference
|
||||
[`process.loadEnvFile()`]: process.md#processloadenvfilepath
|
||||
[`vfs.mount()`]: vfs.md#vfsmount
|
||||
[virtual file system]: vfs.md
|
||||
Reference in new issue
Block a user