Skip to content

Commit 311a003

Browse files
committed
doc: move policy docs to the permissions scope
1 parent ccfd900 commit 311a003

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

doc/api/policy.md renamed to doc/api/permissions.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
# Policies
1+
# Permissions
2+
3+
This section exposes security features available to be adopted in a
4+
Node.js application. The available scopes are:
5+
6+
* [Resource-based permissions](#resource-based-permissions)
7+
* [Process-based permissions](#process-based-permissions)
8+
9+
Resource-based permissions stands for the managment of modules using
10+
policies. A policy can guarantee which module/resource is available
11+
during the application execution.
12+
13+
Process-based permissions stands for the management of resources such
14+
as _File System_ or _Network_. A permission can be configured to restrict
15+
access to specific resources, for instance, one can restrict access to
16+
all the _File System_ write.
17+
18+
Both permissions can be used together to provide a safer environment.
19+
20+
**Note**: if you find a potential security vulnerability on Node.js,
21+
refer to our [Security Policy][].
22+
23+
## Resource-based permissions
24+
25+
## Policies
226

327
<!--introduced_in=v11.8.0-->
428

@@ -22,7 +46,7 @@ by the running Node.js application in any way. A typical setup would be to
2246
create the policy file as a different user id than the one running Node.js
2347
and granting read permissions to the user id running Node.js.
2448

25-
## Enabling
49+
### Enabling
2650

2751
<!-- type=misc -->
2852

@@ -48,9 +72,9 @@ even if the file is changed on disk.
4872
node --experimental-policy=policy.json --policy-integrity="sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0" app.js
4973
```
5074

51-
## Features
75+
### Features
5276

53-
### Error behavior
77+
#### Error behavior
5478

5579
When a policy check fails, Node.js by default will throw an error.
5680
It is possible to change the error behavior to one of a few possibilities
@@ -74,7 +98,7 @@ available to change the behavior:
7498
}
7599
```
76100

77-
### Integrity checks
101+
#### Integrity checks
78102

79103
Policy files must use integrity checks with Subresource Integrity strings
80104
compatible with the browser
@@ -116,7 +140,7 @@ body for the resource which can be useful for local development. It is not
116140
recommended in production since it would allow unexpected alteration of
117141
resources to be considered valid.
118142

119-
### Dependency redirection
143+
#### Dependency redirection
120144

121145
An application may need to ship patched versions of modules or to prevent
122146
modules from allowing all modules access to all other modules. Redirection
@@ -423,6 +447,9 @@ not adopt the origin of the `blob:` URL.
423447
Additionally, import maps only work on `import` so it may be desirable to add a
424448
`"import"` condition to all dependency mappings.
425449

450+
## Process-based permissions
451+
426452
[import maps]: https://url.spec.whatwg.org/#relative-url-with-fragment-string
427453
[relative-url string]: https://url.spec.whatwg.org/#relative-url-with-fragment-string
428454
[special schemes]: https://url.spec.whatwg.org/#special-scheme
455+
[Security Policy]: https://github.com/nodejs/node/blob/main/SECURITY.md

0 commit comments

Comments
 (0)