security: create .npmrc#745
Merged
Merged
Conversation
define npmrc with basic security policies to harden npm
sonukapoor
requested changes
Jun 22, 2026
sonukapoor
left a comment
Collaborator
There was a problem hiding this comment.
Good intent and the allow-git=none direction looks right. Two things need fixing before this is safe to ship.
Cleanup comment for ignore-scripts comment out min-release-age, not supported yet
sonukapoor
approved these changes
Jun 22, 2026
sonukapoor
left a comment
Collaborator
There was a problem hiding this comment.
Both issues from the first review are addressed - the ignore-scripts comment is clear and honest, and allow-git=none is the right value (it is a valid enum, not a boolean). The min-release-age note as a pnpm migration hint makes sense. Good contribution.
Collaborator
|
Merged - thank you @pfarikrispy! |
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
define npmrc with basic security policies to harden npm
Why this change
for best security, it is advised to disallow postinstall scripts, but this security scanner requires better-sqlite3 and for compatibility reasons, it needs to be able to build the library
What changed
.npmrcgitinstallsValidation
N/A
See #710
User-facing impact
Does this change:
Notes
Personally, I would start using/relying on
pnpmpackage manager as it allows for a global deny of scripts and individual, named overrides, such asbetter-sqlite3in this case. That makes it explicit and versionable. (As is recommened in the GitHub npm-security-best-practices repo.)pnpm-workspace.yaml: