Safeguard
Security Guides•

What is a security checklist for a JavaScript monorepo's packaging?

A 15-item checklist for JavaScript packaging security: workspaces, lockfiles, registries, provenance and release. Each item names the setting to check.

Safeguard Security Team
4 min read

A JavaScript monorepo's packaging security comes down to five areas: one pinned package manager, a committed and frozen lockfile, controlled registries and tokens, limits on what installs and runs, and a publish path with provenance. Work through the 15 items below, and record the result for each in the repository.

1. One toolchain

  1. Pin the package manager. Use the packageManager field and Corepack so every developer and CI job uses the same version. See Corepack and packageManager.
  2. One lockfile for the workspace. npm workspaces resolve a single tree from the root, and pnpm workspaces typically share one lockfile. Confirm scanners read it. See what scanners read in a pnpm workspace.
  3. Delete the old lockfile after a switch. Two lockfiles mean two truths. See deleting the old lockfile.

2. Lockfile discipline

  1. Commit the lockfile for applications.
  2. Use the frozen install in CI. npm ci fails when package.json and the lockfile disagree and never writes to either. See frozen flags compared.
  3. Review lockfile diffs, especially changes without a manifest change. See lockfile poisoning.

3. Registries and tokens

  1. Scope private packages to your registry in .npmrc or yarnrc so internal names are never requested publicly.
  2. Scope tokens to a registry host, and keep them in environment variables. See npmrc precedence.
  3. Keep TLS strict. Never turn off strict SSL to get past a proxy.

4. What installs and runs

  1. Delay brand new versions. Settings exist in all three managers. See the settings comparison.
  2. Control git and URL dependencies, with an allowlist or a block.
  3. Decide the install script policy and write it down, since Yarn skips third party postinstall scripts by default while npm runs them.

5. Publishing

  1. Mark internal packages private and set publishConfig so they cannot reach the wrong registry. The npm docs say private true makes npm refuse to publish, and publishConfig can override the registry at publish time.
  2. Check what ships with npm pack and a dry run before publishing. In a workspace, publish with the workspace option, one package or all with the workspaces option.
  3. Publish with provenance or trusted publishing from a supported cloud runner, with no long-lived token where possible. See provenance from a release tool.

How to use the list

Copy it into an issue, mark each line pass, fail or not applicable, and attach evidence such as a config file path or a CI log line. For failed items, open tickets with owners. Repeat quarterly, and after any package manager upgrade.

What the list does not cover

It does not cover vulnerabilities in the code you already depend on. A clean checklist can sit on top of a tree with known issues, so scanning and monitoring run alongside it.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how a component is watched after the build, not only at install time.

Where Safeguard fits

Safeguard's dependency scanning and SBOM generation cover workspace lockfiles, reachability analysis helps prioritize what matters, and policies and gates enforce rules on pull requests. A free scan is at https://gold.safeguard.sh/scan.

Quick check

How often should I review this checklist?

Quarterly, and after any package manager or CI platform change. Record evidence for each item so a review takes minutes.

Does a perfect checklist mean no vulnerable dependencies?

No. It controls how packages arrive and are published. Known vulnerabilities in your tree need scanning and monitoring as well.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.