Help us improve
Share bugs, ideas, or general feedback.
Pin dependency versions, disable install scripts, and secure registry configs
npx claudepluginhub latiotech/secure-supply-chain-skills --plugin supply-chain-securityHow this command is triggered — by the user, by Claude, or both
Slash command
/supply-chain-security:harden-packages package-managerFiles this command reads when invoked
This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
Harden the project's package manager configuration for supply chain security. **This command takes action by default** - it pins versions, disables scripts, and secures configs. Changes are explained as they are made.
Read `${CLAUDE_PLUGIN_ROOT}/skills/supply-chain-hardening/references/package-configs.md` for language-specific configurations.
## Detection
First, detect which package managers are in use by looking for these files:
- `package.json` / `package-lock.json` / `pnpm-lock.yaml` / `yarn.lock` → npm/pnpm/yarn
- `requirements.txt` / `requirements.in` / `pyproject.toml` / `uv.lock`.../deps-auditScans project dependencies for vulnerabilities, outdated packages, license conflicts, and supply chain risks, then provides actionable remediation strategies.
/depsScans project dependencies for vulnerabilities and outdated packages across Node.js, Python, PHP, Go, Ruby; generates markdown report with severity levels, affected packages, fixes, and upgrade commands.
/hardenInteractive wizard generates missing supply chain security configs for Rust project CI/CD at Minimal, Standard, or Hardened levels.
/check-depsChecks project dependencies for vulnerabilities, outdated packages, and license issues across npm, pip, Composer, Bundler, and Go modules. Generates report with CVE details, upgrade paths, and commands.
/dependency-auditAudits project dependencies for security vulnerabilities, outdated versions, licenses, maintenance, performance, conflicts, and supply chain risks; outputs health report and update plan.
/dependenciesScans project dependencies for CVE vulnerabilities across 11 package managers (npm, pip, cargo, bundler, etc.), generates risk scores, and provides fix recommendations.
Share bugs, ideas, or general feedback.
Harden the project's package manager configuration for supply chain security. This command takes action by default - it pins versions, disables scripts, and secures configs. Changes are explained as they are made.
Read ${CLAUDE_PLUGIN_ROOT}/skills/supply-chain-hardening/references/package-configs.md for language-specific configurations.
First, detect which package managers are in use by looking for these files:
package.json / package-lock.json / pnpm-lock.yaml / yarn.lock → npm/pnpm/yarnrequirements.txt / requirements.in / pyproject.toml / uv.lock → pip/uvgo.mod / go.sum → GoCargo.toml / Cargo.lock → RustGemfile / Gemfile.lock → Rubypom.xml / build.gradle → JavaIf $1 is provided, focus on that package manager only.
For each detected package manager, work through these in order. Make each change, explain what it does and why, then move to the next.
Scan dependency files for unpinned versions (ranges like ^, ~, >=, *). For each unpinned dependency:
# TODO: pin to exact version - run [lock command] and read the resolved version comment. Never guess a version number.For npm/pnpm/yarn: also add save-exact=true to .npmrc so future installs pin automatically.
For pip: generate pinned requirements with hashes using pip-compile --generate-hashes if pip-tools is available.
For Go: run go mod tidy && go mod verify to ensure checksums are valid.
Add the appropriate config to block pre/post-install script execution:
ignore-scripts=true to .npmrc (create the file if it doesn't exist)enableScripts: false to .yarnrc.ymlrequire-hashes = true to pip.conf if not already presentIf specific packages are known to need install scripts (e.g., esbuild, sharp, bcrypt), add them to an allowlist in the appropriate config format.
Check if the lockfile exists and is not in .gitignore. If the lockfile is gitignored:
.gitignoreCheck whether the project has any mechanism to avoid installing freshly-published packages — the highest-risk window for supply chain attacks. Look for:
renovate.json or renovate.json5 containing minimumReleaseAgewhich safe-chain)If none are found, flag this in the summary and recommend an approach based on the project's setup:
"minimumReleaseAge": "3 days" to renovate.json — this is the lowest-friction option and covers all ecosystems.minimumReleaseAge as the primary option.Explain why this matters: lockfiles pin versions but don't enforce age. When a developer runs npm install new-package or updates a dependency, the freshly-published version gets locked in immediately. A cooldown period gives the community time to detect compromised releases before they reach your lockfile.
Do NOT auto-configure this — it depends on the team's workflow. Flag it and recommend.
See ${CLAUDE_PLUGIN_ROOT}/skills/supply-chain-hardening/references/package-configs.md for configuration examples.
If the project uses scoped packages (e.g., @yourorg/), check for registry scoping in .npmrc or equivalent. If missing, add a commented-out template and explain how to configure it to prevent dependency confusion attacks.
If any of these tools are installed, run them and report results:
npm audit / pnpm audit / yarn auditcargo audit (for Rust)go mod verify (for Go)bundle audit (for Ruby)After making all changes, provide a summary:
## Package Hardening Summary
### Changes Made
- [x] Pinned N dependencies to exact versions in [file]
- [x] Added ignore-scripts=true to .npmrc
- [x] ...
### Manual Steps Needed
- [ ] Configure registry scoping for @yourorg packages
- [ ] Review allowScripts list for packages that need install scripts
### Recommended Next Steps
- Run `/setup-sbom` to generate a Software Bill of Materials
- Set up Dependabot or Renovate to keep pinned versions current
- **For JavaScript/Python projects**: install [Aikido SafeChain](https://github.com/AikidoSec/safe-chain) to block malicious packages at install time (`curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/install-safe-chain.sh | sh`)