You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update security best practices for current threat model
- Align examples with current SECURITY.md threat model
- Add scenarios for malicious deps and prototype pollution
- Document Node.js permission model usage
- Refresh policy mechanism guidance and external security resources
throw new ERR_SRI_PARSE(str, str[prevIndex], prevIndex);
402
-
^
403
-
404
-
SyntaxError [ERR_SRI_PARSE]: Subresource Integrity string "sha256-iuGZ6SFVFpMuHUcJciQTIKpIyaQVigMZlvg9Lx66HV8=%" had an unexpected "%" at position 51
405
-
at new NodeError (node:internal/errors:393:5)
406
-
at Object.parse (node:internal/policy/sri:65:13)
407
-
at processEntry (node:internal/policy/manifest:581:38)
408
-
at Manifest.assertIntegrity (node:internal/policy/manifest:588:32)
409
-
at Module._compile (node:internal/modules/cjs/loader:1119:21)
410
-
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
411
-
at Module.load (node:internal/modules/cjs/loader:1037:32)
412
-
at Module._load (node:internal/modules/cjs/loader:878:12)
413
-
at Module.require (node:internal/modules/cjs/loader:1061:19)
414
-
at require (node:internal/modules/cjs/helpers:99:18) {
415
-
code: 'ERR_SRI_PARSE'
416
-
}
417
-
```
428
+
With such a policy enabled, attempts to load unexpected files or files whose
429
+
content has changed will fail integrity checks instead of being silently
430
+
accepted.
418
431
419
432
Note, it's always recommended the use of `--policy-integrity` to avoid policy mutations.
420
433
434
+
## Node.js Permission Model
435
+
436
+
Node.js provides a **permission model**
437
+
that can be used to restrict what a given process is allowed to do at runtime.
438
+
This model complements the Node.js [threat model][] and the policy mechanism
439
+
described above by enforcing least-privilege at the runtime level.
440
+
441
+
When enabled (for example, using the `--permission` flag), the
442
+
permission model lets you selectively allow or deny access to sensitive
443
+
capabilities such as:
444
+
445
+
- File system reads and writes.
446
+
- Network access (inbound and outbound).
447
+
- Child process creation.
448
+
- Use of native addons and other powerful APIs.
449
+
450
+
This can help contain the impact of malicious or compromised dependencies,
451
+
untrusted configuration, or unexpected behavior in your own code, since even
452
+
trusted code will be prevented from performing actions outside the permissions
453
+
you have explicitly granted.
454
+
455
+
Refer to the Node.js permissions documentation for up-to-date flags and
456
+
options.
457
+
421
458
## Experimental Features in Production
422
459
423
460
The use of experimental features in production isn't recommended.
@@ -431,6 +468,8 @@ The [OpenSSF][] is leading several initiatives that can be very useful, especial
431
468
-[OpenSSF Scorecard][] Scorecard evaluates open source projects using a series of automated security risk checks. You can use it to proactively assess vulnerabilities and dependencies in your code base and make informed decisions about accepting vulnerabilities.
432
469
-[OpenSSF Best Practices Badge Program][] Projects can voluntarily self-certify by describing how they comply with each best practice. This will generate a badge that can be added to the project.
433
470
471
+
You can also collaborate with other projects and security experts through the [OpenJS Security Collaboration Space][].
0 commit comments