{
  "type": "module",
  "source": "doc/api/permissions.md",
  "modules": [
    {
      "textRaw": "Permissions",
      "name": "permissions",
      "desc": "<p>Permissions can be used to control what system resources the\nNode.js process has access to or what actions the process can take\nwith those resources. Permissions can also control what modules can\nbe accessed by other modules.</p>\n<ul>\n<li>\n<p><a href=\"#module-based-permissions\">Module-based permissions</a> control which files\nor URLs are available to other modules during application execution.\nThis can be used to control what modules can be accessed by third-party\ndependencies, for example.</p>\n</li>\n<li>\n<p><a href=\"#process-based-permissions\">Process-based permissions</a> control the Node.js\nprocess's access to resources.\nThe resource can be entirely allowed or denied, or actions related to it can\nbe controlled. For example, file system reads can be allowed while denying\nwrites.\nThis feature does not protect against malicious code. According to the Node.js\n<a href=\"https://github.com/nodejs/node/blob/main/SECURITY.md\">Security Policy</a>, Node.js trusts any code it is asked to run.</p>\n</li>\n</ul>\n<p>The permission model implements a \"seat belt\" approach, which prevents trusted\ncode from unintentionally changing files or using resources that access has\nnot explicitly been granted to. It does not provide security guarantees in the\npresence of malicious code. Malicious code can bypass the permission model and\nexecute arbitrary code without the restrictions imposed by the permission\nmodel.</p>\n<p>If you find a potential security vulnerability, please refer to our\n<a href=\"https://github.com/nodejs/node/blob/main/SECURITY.md\">Security Policy</a>.</p>",
      "modules": [
        {
          "textRaw": "Module-based permissions",
          "name": "module-based_permissions",
          "introduced_in": "v11.8.0",
          "stability": 0,
          "stabilityText": "Deprecated: Will be removed shortly",
          "miscs": [
            {
              "textRaw": "Policies",
              "name": "policy",
              "introduced_in": "v11.8.0",
              "type": "misc",
              "stability": 0,
              "stabilityText": "Deprecated: Will be removed shortly",
              "desc": "<p>Node.js contains experimental support for creating policies on loading code.</p>\n<p>Policies are a security feature intended to ensure the integrity\nof the loaded code.</p>\n<p>While it does not function as a provenance mechanism to trace the origin of\ncode, it serves as a robust defense against the execution of malicious code.\nUnlike runtime-based models that may restrict capabilities once the code is\nloaded, Node.js policies focus on preventing malicious code from ever being\nfully loaded into the application in the first place.</p>\n<p>The use of policies assumes safe practices for the policy\nfiles such as ensuring that policy files cannot be overwritten by the Node.js\napplication by using file permissions.</p>\n<p>A best practice would be to ensure that the policy manifest is read-only for\nthe running Node.js application and that the file cannot be changed\nby the running Node.js application in any way. A typical setup would be to\ncreate the policy file as a different user id than the one running Node.js\nand granting read permissions to the user id running Node.js.</p>",
              "miscs": [
                {
                  "textRaw": "Enabling",
                  "name": "Enabling",
                  "type": "misc",
                  "desc": "<p>The <code>--experimental-policy</code> flag can be used to enable features for policies\nwhen loading modules.</p>\n<p>Once this has been set, all modules must conform to a policy manifest file\npassed to the flag:</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json app.js\n</code></pre>\n<p>The policy manifest will be used to enforce constraints on code loaded by\nNode.js.</p>\n<p>To mitigate tampering with policy files on disk, an integrity for\nthe policy file itself may be provided via <code>--policy-integrity</code>.\nThis allows running <code>node</code> and asserting the policy file contents\neven if the file is changed on disk.</p>\n<pre><code class=\"language-bash\">node --experimental-policy=policy.json --policy-integrity=\"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\" app.js\n</code></pre>"
                },
                {
                  "textRaw": "Features",
                  "name": "features",
                  "modules": [
                    {
                      "textRaw": "Error behavior",
                      "name": "error_behavior",
                      "desc": "<p>When a policy check fails, Node.js by default will throw an error.\nIt is possible to change the error behavior to one of a few possibilities\nby defining an \"onerror\" field in a policy manifest. The following values are\navailable to change the behavior:</p>\n<ul>\n<li><code>\"exit\"</code>: will exit the process immediately.\nNo cleanup code will be allowed to run.</li>\n<li><code>\"log\"</code>: will log the error at the site of the failure.</li>\n<li><code>\"throw\"</code>: will throw a JS error at the site of the failure. This is the\ndefault.</li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"onerror\": \"log\",\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n    }\n  }\n}\n</code></pre>",
                      "type": "module",
                      "displayName": "Error behavior"
                    },
                    {
                      "textRaw": "Integrity checks",
                      "name": "integrity_checks",
                      "desc": "<p>Policy files must use integrity checks with Subresource Integrity strings\ncompatible with the browser\n<a href=\"https://www.w3.org/TR/SRI/#the-integrity-attribute\">integrity attribute</a>\nassociated with absolute URLs.</p>\n<p>When using <code>require()</code> or <code>import</code> all resources involved in loading are checked\nfor integrity if a policy manifest has been specified. If a resource does not\nmatch the integrity listed in the manifest, an error will be thrown.</p>\n<p>An example policy file that would allow loading a file <code>checked.js</code>:</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"integrity\": \"sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0\"\n    }\n  }\n}\n</code></pre>\n<p>Each resource listed in the policy manifest can be of one the following\nformats to determine its location:</p>\n<ol>\n<li>A <a href=\"https://url.spec.whatwg.org/#relative-url-with-fragment-string\">relative-URL string</a> to a resource from the manifest such as <code>./resource.js</code>, <code>../resource.js</code>, or <code>/resource.js</code>.</li>\n<li>A complete URL string to a resource such as <code>file:///resource.js</code>.</li>\n</ol>\n<p>When loading resources the entire URL must match including search parameters\nand hash fragment. <code>./a.js?b</code> will not be used when attempting to load\n<code>./a.js</code> and vice versa.</p>\n<p>To generate integrity strings, a script such as\n<code>node -e 'process.stdout.write(\"sha256-\");process.stdin.pipe(crypto.createHash(\"sha256\").setEncoding(\"base64\")).pipe(process.stdout)' &#x3C; FILE</code>\ncan be used.</p>\n<p>Integrity can be specified as the boolean value <code>true</code> to accept any\nbody for the resource which can be useful for local development. It is not\nrecommended in production since it would allow unexpected alteration of\nresources to be considered valid.</p>",
                      "type": "module",
                      "displayName": "Integrity checks"
                    },
                    {
                      "textRaw": "Dependency redirection",
                      "name": "dependency_redirection",
                      "desc": "<p>An application may need to ship patched versions of modules or to prevent\nmodules from allowing all modules access to all other modules. Redirection\ncan be used by intercepting attempts to load the modules wishing to be\nreplaced.</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"dependencies\": {\n        \"fs\": true,\n        \"os\": \"./app/node_modules/alt-os\",\n        \"http\": { \"import\": true }\n      }\n    }\n  }\n}\n</code></pre>\n<p>The dependencies are keyed by the requested specifier string and have values\nof either <code>true</code>, <code>null</code>, a string pointing to a module to be resolved,\nor a conditions object.</p>\n<p>The specifier string does not perform any searching and must match exactly what\nis provided to the <code>require()</code> or <code>import</code> except for a canonicalization step.\nTherefore, multiple specifiers may be needed in the policy if it uses multiple\ndifferent strings to point to the same module (such as excluding the extension).</p>\n<p>Specifier strings are canonicalized but not resolved prior to be used for\nmatching in order to have some compatibility with import maps, for example if a\nresource <code>file:///C:/app/utils.js</code> was given the following redirection from a\npolicy located at <code>file:///C:/app/policy.json</code>:</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"file:///C:/app/utils.js\": {\n      \"dependencies\": {\n        \"./utils.js\": \"./utils-v2.js\"\n      }\n    }\n  }\n}\n</code></pre>\n<p>Any specifier used to load <code>file:///C:/app/utils.js</code> would then be intercepted\nand redirected to <code>file:///C:/app/utils-v2.js</code> instead regardless of using an\nabsolute or relative specifier. However, if a specifier that is not an absolute\nor relative URL string is used, it would not be intercepted. So, if an import\nsuch as <code>import('#utils')</code> was used, it would not be intercepted.</p>\n<p>If the value of the redirection is <code>true</code>, a \"dependencies\" field at the top of\nthe policy file will be used. If that field at the top of the policy file is\n<code>true</code> the default node searching algorithms are used to find the module.</p>\n<p>If the value of the redirection is a string, it is resolved relative to\nthe manifest and then immediately used without searching.</p>\n<p>Any specifier string for which resolution is attempted and that is not listed in\nthe dependencies results in an error according to the policy.</p>\n<p>A boolean value of <code>true</code> for the dependencies map can be specified to allow a\nmodule to load any specifier without redirection. This can be useful for local\ndevelopment and may have some valid usage in production, but should be used\nonly with care after auditing a module to ensure its behavior is valid.</p>\n<p>Similar to <code>\"exports\"</code> in <code>package.json</code>, dependencies can also be specified to\nbe objects containing conditions which branch how dependencies are loaded. In\nthe preceding example, <code>\"http\"</code> is allowed when the <code>\"import\"</code> condition is\npart of loading it.</p>\n<p>A value of <code>null</code> for the resolved value causes the resolution to fail. This\ncan be used to ensure some kinds of dynamic access are explicitly prevented.</p>\n<p>Unknown values for the resolved module location cause failures but are\nnot guaranteed to be forward compatible.</p>\n<p>All the guarantees for policy redirection are specified in the\n<a href=\"#guarantees\">Guarantees</a> section.</p>\n<h5>Example: Patched dependency</h5>\n<p>Redirected dependencies can provide attenuated or modified functionality as fits\nthe application. For example, log data about timing of function durations by\nwrapping the original:</p>\n<pre><code class=\"language-js\">const original = require('fn');\nmodule.exports = function fn(...args) {\n  console.time();\n  try {\n    return new.target ?\n      Reflect.construct(original, args) :\n      Reflect.apply(original, this, args);\n  } finally {\n    console.timeEnd();\n  }\n};\n</code></pre>",
                      "type": "module",
                      "displayName": "Dependency redirection"
                    }
                  ],
                  "type": "misc",
                  "displayName": "Features"
                },
                {
                  "textRaw": "Scopes",
                  "name": "scopes",
                  "desc": "<p>Use the <code>\"scopes\"</code> field of a manifest to set configuration for many resources\nat once. The <code>\"scopes\"</code> field works by matching resources by their segments.\nIf a scope or resource includes <code>\"cascade\": true</code>, unknown specifiers will\nbe searched for in their containing scope. The containing scope for cascading\nis found by recursively reducing the resource URL by removing segments for\n<a href=\"https://url.spec.whatwg.org/#special-scheme\">special schemes</a>, keeping trailing <code>\"/\"</code> suffixes, and removing the query and\nhash fragment. This leads to the eventual reduction of the URL to its origin.\nIf the URL is non-special the scope will be located by the URL's origin. If no\nscope is found for the origin or in the case of opaque origins, a protocol\nstring can be used as a scope. If no scope is found for the URL's protocol, a\nfinal empty string <code>\"\"</code> scope will be used.</p>\n<p>Note, <code>blob:</code> URLs adopt their origin from the path they contain, and so a scope\nof <code>\"blob:https://nodejs.org\"</code> will have no effect since no URL can have an\norigin of <code>blob:https://nodejs.org</code>; URLs starting with\n<code>blob:https://nodejs.org/</code> will use <code>https://nodejs.org</code> for its origin and\nthus <code>https:</code> for its protocol scope. For opaque origin <code>blob:</code> URLs they will\nhave <code>blob:</code> for their protocol scope since they do not adopt origins.</p>\n<h5>Example</h5>\n<pre><code class=\"language-json\">{\n  \"scopes\": {\n    \"file:///C:/app/\": {},\n    \"file:\": {},\n    \"\": {}\n  }\n}\n</code></pre>\n<p>Given a file located at <code>file:///C:/app/bin/main.js</code>, the following scopes would\nbe checked in order:</p>\n<ol>\n<li><code>\"file:///C:/app/bin/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within\n<code>\"file:///C:/app/bin/\"</code>. This is not in the <code>\"scopes\"</code> field of the policy and\nwould be skipped. Adding this scope to the policy would cause it to be used\nprior to the <code>\"file:///C:/app/\"</code> scope.</p>\n<ol start=\"2\">\n<li><code>\"file:///C:/app/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within\n<code>\"file:///C:/app/\"</code>. This is in the <code>\"scopes\"</code> field of the policy and it would\ndetermine the policy for the resource at <code>file:///C:/app/bin/main.js</code>. If the\nscope has <code>\"cascade\": true</code>, any unsatisfied queries about the resource would\ndelegate to the next relevant scope for <code>file:///C:/app/bin/main.js</code>, <code>\"file:\"</code>.</p>\n<ol start=\"3\">\n<li><code>\"file:///C:/\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources within <code>\"file:///C:/\"</code>.\nThis is not in the <code>\"scopes\"</code> field of the policy and would be skipped. It would\nnot be used for <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///C:/app/\"</code> is set\nto cascade or is not in the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"4\">\n<li><code>\"file:///\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources on the <code>localhost</code>. This\nis not in the <code>\"scopes\"</code> field of the policy and would be skipped. It would not\nbe used for <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///C:/\"</code> is set to\ncascade or is not in the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"5\">\n<li><code>\"file:\"</code></li>\n</ol>\n<p>This determines the policy for all file based resources. It would not be used\nfor <code>file:///C:/app/bin/main.js</code> unless <code>\"file:///\"</code> is set to cascade or is not\nin the <code>\"scopes\"</code> of the policy.</p>\n<ol start=\"6\">\n<li><code>\"\"</code></li>\n</ol>\n<p>This determines the policy for all resources. It would not be used for\n<code>file:///C:/app/bin/main.js</code> unless <code>\"file:\"</code> is set to cascade.</p>",
                  "modules": [
                    {
                      "textRaw": "Integrity using scopes",
                      "name": "integrity_using_scopes",
                      "desc": "<p>Setting an integrity to <code>true</code> on a scope will set the integrity for any\nresource not found in the manifest to <code>true</code>.</p>\n<p>Setting an integrity to <code>null</code> on a scope will set the integrity for any\nresource not found in the manifest to fail matching.</p>\n<p>Not including an integrity is the same as setting the integrity to <code>null</code>.</p>\n<p><code>\"cascade\"</code> for integrity checks will be ignored if <code>\"integrity\"</code> is explicitly\nset.</p>\n<p>The following example allows loading any file:</p>\n<pre><code class=\"language-json\">{\n  \"scopes\": {\n    \"file:\": {\n      \"integrity\": true\n    }\n  }\n}\n</code></pre>",
                      "type": "module",
                      "displayName": "Integrity using scopes"
                    },
                    {
                      "textRaw": "Dependency redirection using scopes",
                      "name": "dependency_redirection_using_scopes",
                      "desc": "<p>The following example, would allow access to <code>fs</code> for all resources within\n<code>./app/</code>:</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"./app/checked.js\": {\n      \"cascade\": true,\n      \"integrity\": true\n    }\n  },\n  \"scopes\": {\n    \"./app/\": {\n      \"dependencies\": {\n        \"fs\": true\n      }\n    }\n  }\n}\n</code></pre>\n<p>The following example, would allow access to <code>fs</code> for all <code>data:</code> resources:</p>\n<pre><code class=\"language-json\">{\n  \"resources\": {\n    \"data:text/javascript,import('node:fs');\": {\n      \"cascade\": true,\n      \"integrity\": true\n    }\n  },\n  \"scopes\": {\n    \"data:\": {\n      \"dependencies\": {\n        \"fs\": true\n      }\n    }\n  }\n}\n</code></pre>\n<h5>Example: import maps emulation</h5>\n<p>Given an import map:</p>\n<pre><code class=\"language-json\">{\n  \"imports\": {\n    \"react\": \"./app/node_modules/react/index.js\"\n  },\n  \"scopes\": {\n    \"./ssr/\": {\n      \"react\": \"./app/node_modules/server-side-react/index.js\"\n    }\n  }\n}\n</code></pre>\n<pre><code class=\"language-json\">{\n  \"dependencies\": true,\n  \"scopes\": {\n    \"\": {\n      \"cascade\": true,\n      \"dependencies\": {\n        \"react\": \"./app/node_modules/react/index.js\"\n      }\n    },\n    \"./ssr/\": {\n      \"cascade\": true,\n      \"dependencies\": {\n        \"react\": \"./app/node_modules/server-side-react/index.js\"\n      }\n    }\n  }\n}\n</code></pre>\n<p><a href=\"https://url.spec.whatwg.org/#relative-url-with-fragment-string\">Import maps</a> assume you can get any resource by default. This means\n<code>\"dependencies\"</code> at the top level of the policy should be set to <code>true</code>.\nPolicies require this to be opt-in since it enables all resources of the\napplication cross linkage which doesn't make sense for many scenarios. They also\nassume any given scope has access to any scope above its allowed dependencies;\nall scopes emulating import maps must set <code>\"cascade\": true</code>.</p>\n<p>Import maps only have a single top level scope for their \"imports\". So for\nemulating <code>\"imports\"</code> use the <code>\"\"</code> scope. For emulating <code>\"scopes\"</code> use the\n<code>\"scopes\"</code> in a similar manner to how <code>\"scopes\"</code> works in import maps.</p>\n<p>Caveats: Policies do not use string matching for various finding of scope. They\ndo URL traversals. This means things like <code>blob:</code> and <code>data:</code> URLs might not be\nentirely interoperable between the two systems. For example import maps can\npartially match a <code>data:</code> or <code>blob:</code> URL by partitioning the URL on a <code>/</code>\ncharacter, policies intentionally cannot. For <code>blob:</code> URLs import map scopes do\nnot adopt the origin of the <code>blob:</code> URL.</p>\n<p>Additionally, import maps only work on <code>import</code> so it may be desirable to add a\n<code>\"import\"</code> condition to all dependency mappings.</p>",
                      "type": "module",
                      "displayName": "Dependency redirection using scopes"
                    }
                  ],
                  "type": "misc",
                  "displayName": "Scopes"
                },
                {
                  "textRaw": "Guarantees",
                  "name": "guarantees",
                  "desc": "<ul>\n<li>The policies guarantee the file integrity when a module is loaded using\n<code>require()</code>, <code>import()</code> or <code>new Module()</code>.</li>\n<li>Redirection does not prevent access to APIs through means such as direct\naccess to <code>require.cache</code> which allow access to loaded modules.\nPolicy redirection only affects specifiers to <code>require()</code> and\n<code>import</code>.</li>\n<li>The approval of the module integrity in policies threat model implies\nthey are allowed to muck with and even circumvent security features once\nloaded so environmental/runtime hardening is expected.</li>\n</ul>",
                  "type": "misc",
                  "displayName": "Guarantees"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Module-based permissions"
        },
        {
          "textRaw": "Process-based permissions",
          "name": "process-based_permissions",
          "stability": 1,
          "stabilityText": ".1 - Active development",
          "miscs": [
            {
              "textRaw": "Permission Model",
              "name": "Permission Model",
              "type": "misc",
              "stability": 1,
              "stabilityText": ".1 - Active development",
              "desc": "<!-- name=permission-model -->\n<p>The Node.js Permission Model is a mechanism for restricting access to specific\nresources during execution.\nThe API exists behind a flag <a href=\"cli.html#--experimental-permission\"><code>--experimental-permission</code></a> which when enabled,\nwill restrict access to all available permissions.</p>\n<p>The available permissions are documented by the <a href=\"cli.html#--experimental-permission\"><code>--experimental-permission</code></a>\nflag.</p>\n<p>When starting Node.js with <code>--experimental-permission</code>,\nthe ability to access the file system through the <code>fs</code> module, spawn processes,\nuse <code>node:worker_threads</code>, use native addons, use WASI, and enable the runtime inspector\nwill be restricted.</p>\n<pre><code class=\"language-console\">$ node --experimental-permission index.js\nnode:internal/modules/cjs/loader:171\n  const result = internalModuleStat(filename);\n                 ^\n\nError: Access to this API has been restricted\n    at stat (node:internal/modules/cjs/loader:171:18)\n    at Module._findPath (node:internal/modules/cjs/loader:627:16)\n    at resolveMainPath (node:internal/modules/run_main:19:25)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:24)\n    at node:internal/main/run_main_module:23:47 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'FileSystemRead',\n  resource: '/home/user/index.js'\n}\n</code></pre>\n<p>Allowing access to spawning a process and creating worker threads can be done\nusing the <a href=\"cli.html#--allow-child-process\"><code>--allow-child-process</code></a> and <a href=\"cli.html#--allow-worker\"><code>--allow-worker</code></a> respectively.</p>\n<p>To allow native addons when using permission model, use the <a href=\"cli.html#--allow-addons\"><code>--allow-addons</code></a>\nflag. For WASI, use the <a href=\"cli.html#--allow-wasi\"><code>--allow-wasi</code></a> flag.</p>",
              "miscs": [
                {
                  "textRaw": "Runtime API",
                  "name": "runtime_api",
                  "desc": "<p>When enabling the Permission Model through the <a href=\"cli.html#--experimental-permission\"><code>--experimental-permission</code></a>\nflag a new property <code>permission</code> is added to the <code>process</code> object.\nThis property contains one function:</p>",
                  "methods": [
                    {
                      "textRaw": "`permission.has(scope[, reference])`",
                      "type": "method",
                      "name": "has",
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>API call to check permissions at runtime (<a href=\"process.html#processpermissionhasscope-reference\"><code>permission.has()</code></a>)</p>\n<pre><code class=\"language-js\">process.permission.has('fs.write'); // true\nprocess.permission.has('fs.write', '/home/rafaelgss/protected-folder'); // true\n\nprocess.permission.has('fs.read'); // true\nprocess.permission.has('fs.read', '/home/rafaelgss/protected-folder'); // false\n</code></pre>"
                    }
                  ],
                  "type": "misc",
                  "displayName": "Runtime API"
                },
                {
                  "textRaw": "File System Permissions",
                  "name": "file_system_permissions",
                  "desc": "<p>The Permission Model, by default, restricts access to the file system through the <code>node:fs</code> module.\nIt does not guarantee that users will not be able to access the file system through other means,\nsuch as through the <code>node:sqlite</code> module.</p>\n<p>To allow access to the file system, use the <a href=\"cli.html#--allow-fs-read\"><code>--allow-fs-read</code></a> and\n<a href=\"cli.html#--allow-fs-write\"><code>--allow-fs-write</code></a> flags:</p>\n<pre><code class=\"language-console\">$ node --experimental-permission --allow-fs-read=* --allow-fs-write=* index.js\nHello world!\n(node:19836) ExperimentalWarning: Permission is an experimental feature\n(Use `node --trace-warnings ...` to show where the warning was created)\n</code></pre>\n<p>The valid arguments for both flags are:</p>\n<ul>\n<li><code>*</code> - To allow all <code>FileSystemRead</code> or <code>FileSystemWrite</code> operations,\nrespectively.</li>\n<li>Paths delimited by comma (<code>,</code>) to allow only matching <code>FileSystemRead</code> or\n<code>FileSystemWrite</code> operations, respectively.</li>\n</ul>\n<p>Example:</p>\n<ul>\n<li><code>--allow-fs-read=*</code> - It will allow all <code>FileSystemRead</code> operations.</li>\n<li><code>--allow-fs-write=*</code> - It will allow all <code>FileSystemWrite</code> operations.</li>\n<li><code>--allow-fs-write=/tmp/</code> - It will allow <code>FileSystemWrite</code> access to the <code>/tmp/</code>\nfolder.</li>\n<li><code>--allow-fs-read=/tmp/ --allow-fs-read=/home/.gitignore</code> - It allows <code>FileSystemRead</code> access\nto the <code>/tmp/</code> folder <strong>and</strong> the <code>/home/.gitignore</code> path.</li>\n</ul>\n<p>Wildcards are supported too:</p>\n<ul>\n<li><code>--allow-fs-read=/home/test*</code> will allow read access to everything\nthat matches the wildcard. e.g: <code>/home/test/file1</code> or <code>/home/test2</code></li>\n</ul>\n<p>After passing a wildcard character (<code>*</code>) all subsequent characters will\nbe ignored. For example: <code>/home/*.js</code> will work similar to <code>/home/*</code>.</p>\n<p>When the permission model is initialized, it will automatically add a wildcard\n(*) if the specified directory exists. For example, if <code>/home/test/files</code>\nexists, it will be treated as <code>/home/test/files/*</code>. However, if the directory\ndoes not exist, the wildcard will not be added, and access will be limited to\n<code>/home/test/files</code>. If you want to allow access to a folder that does not exist\nyet, make sure to explicitly include the wildcard:\n<code>/my-path/folder-do-not-exist/*</code>.</p>",
                  "type": "misc",
                  "displayName": "File System Permissions"
                },
                {
                  "textRaw": "Permission Model constraints",
                  "name": "permission_model_constraints",
                  "desc": "<p>There are constraints you need to know before using this system:</p>\n<ul>\n<li>The model does not inherit to a child node process or a worker thread.</li>\n<li>When using the Permission Model the following features will be restricted:\n<ul>\n<li>Native modules</li>\n<li>Child process</li>\n<li>Worker Threads</li>\n<li>Inspector protocol</li>\n<li>File system access</li>\n<li>WASI</li>\n</ul>\n</li>\n<li>The Permission Model is initialized after the Node.js environment is set up.\nHowever, certain flags such as <code>--env-file</code> or <code>--openssl-config</code> are designed\nto read files before environment initialization. As a result, such flags are\nnot subject to the rules of the Permission Model. The same applies for V8\nflags that can be set via runtime through <code>v8.setFlagsFromString</code>.</li>\n<li>OpenSSL engines cannot be requested at runtime when the Permission\nModel is enabled, affecting the built-in crypto, https, and tls modules.</li>\n<li>Using existing file descriptors via the <code>node:fs</code> module bypasses the\nPermission Model.</li>\n</ul>",
                  "type": "misc",
                  "displayName": "Permission Model constraints"
                },
                {
                  "textRaw": "Limitations and Known Issues",
                  "name": "limitations_and_known_issues",
                  "desc": "<ul>\n<li>Symbolic links will be followed even to locations outside of the set of paths\nthat access has been granted to. Relative symbolic links may allow access to\narbitrary files and directories. When starting applications with the\npermission model enabled, you must ensure that no paths to which access has\nbeen granted contain relative symbolic links.</li>\n</ul>",
                  "type": "misc",
                  "displayName": "Limitations and Known Issues"
                }
              ]
            }
          ],
          "type": "module",
          "displayName": "Process-based permissions"
        }
      ],
      "type": "module",
      "displayName": "Permissions"
    }
  ]
}