feat: Add support for environment protection (scrubbing) (#327)

* feat: Add support for environment variable protection for sandbox

* chore: Update dangerous env var list

* fix: Split profiles for improved environment protection

* fix: pipx sandbox profile separation

* chore: Show sandbox scrub info on error exit

* fix: Code review fixes

* test: Add e2e for sandbox environment scrubbing
This commit is contained in:
Abhisek Datta
2026-06-11 11:40:33 +05:30
committed by GitHub
parent 7620097613
commit c7244f921a
39 changed files with 1385 additions and 49 deletions
+21
View File
@@ -0,0 +1,21 @@
name: npm
description: Profile for npm, extending npm-restrictive with npm environment variables
inherits: npm-restrictive
package_managers:
- npm
environment:
# The npm-restrictive base allows no environment variables. Re-allow only
# what npm needs for auth, registry config, and TLS.
#
# Accepted trade-off: a malicious JS package executed during install can read
# the npm publishing token below, but NOT yarn/bun tokens, PyPI tokens, AWS
# keys, or other cloud/secret-manager credentials, which remain scrubbed.
allow:
- NPM_TOKEN
- NPM_AUTH_TOKEN
- NODE_AUTH_TOKEN
- npm_config_*
- NPM_CONFIG_*
- NODE_EXTRA_CA_CERTS