Skip to content

Harden npm install security#413

Merged
ybiquitous merged 2 commits intomainfrom
harden-npm-install
May 4, 2026
Merged

Harden npm install security#413
ybiquitous merged 2 commits intomainfrom
harden-npm-install

Conversation

@ybiquitous
Copy link
Copy Markdown
Member

@ybiquitous ybiquitous commented May 4, 2026

Which issue, if any, is this issue related to?

None

Is there anything in the PR that needs further explanation?

This PR adds three flags to .npmrc to reduce supply-chain risk:

  • allow-git = "none" — block git URL dependencies.
  • ignore-scripts = true — skip lifecycle scripts on install.
  • min-release-age = 3 — only install package versions at least 3 days old.

Note: contributors must run npm run prepare manually post-clone to set the local git hooks path, since ignore-scripts skips the prepare script.

Ref:

Add three flags to `.npmrc` to reduce supply-chain risk:

- `allow-git = none` — block git URL dependencies.
- `ignore-scripts = true` — skip lifecycle scripts on install.
- `min-release-age = 3` — only install package versions at least 3 days old.

Note: contributors must run `npm run prepare` manually post-clone to set
the local git hooks path, since `ignore-scripts` skips the `prepare`
script.

Ref: https://github.com/lirantal/npm-security-best-practices/blob/a98aeb7197d3820686337f28ea96ffe94333457b/README.md
@ybiquitous ybiquitous added the pr: dependencies relates to dependencies label May 4, 2026
@ybiquitous ybiquitous marked this pull request as ready for review May 4, 2026 08:02
Copy link
Copy Markdown
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: dependencies relates to dependencies

Development

Successfully merging this pull request may close these issues.

2 participants