Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: initial version of security-model-strategy.md #42709

Closed
wants to merge 21 commits into from
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9061634
doc: initial version of security-model-strategy.md
mhdawson Apr 12, 2022
393e1e5
Update doc/contributing/security-model-strategy.md
mhdawson Apr 12, 2022
28e5d12
Update doc/contributing/security-model-strategy.md
mhdawson Apr 12, 2022
639ccfb
Update doc/contributing/security-model-strategy.md
mhdawson Apr 12, 2022
bf8afd3
Update doc/contributing/security-model-strategy.md
mhdawson Apr 12, 2022
cfbf58d
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
040cd02
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
72a2ef4
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
409228f
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
7ca04af
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
73b8917
Update doc/contributing/security-model-strategy.md
mhdawson Apr 13, 2022
6fb764f
Update doc/contributing/security-model-strategy.md
mhdawson Apr 20, 2022
2041c2b
Update doc/contributing/security-model-strategy.md
mhdawson Apr 20, 2022
2ff1ada
Update doc/contributing/security-model-strategy.md
mhdawson Apr 20, 2022
ac10cb4
Update doc/contributing/security-model-strategy.md
mhdawson Apr 20, 2022
313fcad
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
188ed8e
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
7d2529c
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
671682e
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
20a7563
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
094c117
Update doc/contributing/security-model-strategy.md
mhdawson Apr 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions doc/contributing/security-model-strategy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Security Model Strategy

A clear security model, with features like permissions and policy enforcement,
is a
[top technical priority](https://github.com/nodejs/node/blob/master/doc/contributing/technical-priorities.md#permissionspoliciessecurity-model)
of Node.js.

## High-level approach

* Document the security model
* Document threat models and current state of the art
* Support experimentation on features like permissions and policies
* Add a security component in Node.js certification covering
the Node.js security model

### Document the security model

The current security model for Node.js is not yet well documented.
At a high level it is:

* Node.js does not provide a sandbox, both the JavaScript and
native code which is run is trusted to not be malicious.
* The project works to help code running on top of Node.js to avoid
making mistakes, but not doing so is not considered a
vulnerability in Node.js. Just because you can build something
vulnerable with the APIs does not mean there is a vulnerability
in Node.js itself.

The project has a goal to better document the security model
and this section will be expanded when that happens.

Once the security model is documented the project will work
to add a security component in Node.js certification covering
the Node.js security model.

### Document threat models and current state of the art

Node.js is used in several different use cases and the
threats may be different in each use case. The project
should document the threat models and use that to
help define the security model in the context of each
of these use cases.

This section will be expanded as the use case/threat
models are defined. The initial list includes:

* Server
* Desktop application
* Cli
* Single executable application
* CI/CD pipeline components

### Support experimentation on features like permissions and policies

The project is not currently planning to provide supported
sandbox functionality, but wants to support experimentation on
related features like policies and permission enforcement.

Features in this category should:

* be opt-in, and additional overhead when not enabled must be low
* limit change in core to just what is needed to enable experimentation

## Current implementation and assets

Node.js has an experimental implementation of
[policies](https://nodejs.org/docs/latest/api/policy.html#policies).

The core implementation is in:

* [`lib/internal/process/policy.js`](https://github.com/nodejs/node/blob/HEAD/lib/internal/process/policy.js)
* [`lib/internal/policy`](https://github.com/nodejs/node/blob/HEAD/lib/internal/policy)

along with integration into the CJS and ESM loaders in:

* [`lib/internal/modules/esm`](https://github.com/nodejs/node/blob/HEAD/lib/internal/modules/esm)
* [`lib/internal/modules/cjs`](https://github.com/nodejs/node/blob/HEAD/lib/internal/modules/cjs)