Enforce strict npm install script allowlisting - #185
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens dependency supply-chain controls by enabling npm’s strict install-script enforcement and introducing a test baseline that ensures any dependency with an install script in the lockfile is explicitly allowlisted in package.json.
Changes:
- Enable
strict-allow-scripts=truevia.npmrc(removing the emptyallow-scripts=setting). - Add
package.json#allowScriptsapproval foresbuild@0.28.1. - Add a dependency security baseline test that validates strict npm policy and that all lockfile install-script packages are allowlisted.
Dependency-security guard notes
- Changed packages: none (no dependency version changes in this PR;
allowScriptsreferences existingesbuild@0.28.1). - Added/updated tests:
src/test/suite/dependencyVersions.test.ts(new allowlist/strict-policy baseline test). - Validation command status (not provided in PR description):
npm run compile: not providednpm run lint: not providednpm test: not providednpm run security:check: not provided
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/test/suite/dependencyVersions.test.ts |
Adds a baseline test to assert strict npm allow-scripts policy is enabled and that lockfile install-script packages are allowlisted. |
package.json |
Introduces allowScripts allowlist entry for esbuild@0.28.1. |
.npmrc |
Enables strict install-script enforcement with strict-allow-scripts=true. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.npmrc.esbuild@0.28.1install script inpackage.json.Testing