Package Managers
package_managers
Protects against dangerous package manager operations like publishing packages and removing critical system packages
- 20blocking rules
- 18safe patterns
- 20High
[packs]
enabled = ["package_managers"]Evaluated when a command contains npm, yarn, pnpm, pip, apt, yum, dnf, cargo, gem, brew.
Blocking rules
Each rule ID is package_managers:<name>. Use it in allowlists and [policy.rules].
Highapt-removeapt remove/purge removes packages. Verify no critical packages are affected.
Highbrew-uninstallbrew uninstall removes packages. Verify no dependent packages are affected.
Highcargo-publishcargo publish releases a crate to crates.io. Use --dry-run first.
Highcargo-yankcargo yank marks a version as unavailable. This can break dependent projects.
Highgem-pushgem push releases a gem to rubygems.org. Verify before publishing.
Highgem-yankgem yank removes a published version from rubygems.org. This can break dependent projects.
Highgradle-publishgradle publish uploads artifacts. Use --dry-run first when possible.
Highmaven-deploymvn deploy publishes artifacts to a remote repository. Verify target repository.
Highmaven-release-performmvn release:perform publishes a release. Verify version and repository.
Highnpm-publishnpm publish releases a package publicly. Use --dry-run first.
Highnpm-unpublishnpm unpublish removes a published package. This can break dependent projects.
Highnuget-deletenuget delete removes or unlists a published package version. This can break dependent projects.
Highpip-systempip install to system directories requires careful review.
Highpip-uninstallpip uninstall removes installed packages. Verify dependencies before removing.
Highpip-urlpip install from URL can install unvetted code. Verify the source first.
Highpnpm-publishpnpm publish releases a package publicly.
Highpoetry-publishpoetry publish releases a package. Use --dry-run first.
Highpoetry-removepoetry remove uninstalls a dependency. Verify no critical packages are affected.
Highyarn-publishyarn publish releases a package publicly. Verify package.json first.
Highyum-removeyum/dnf remove removes packages. Verify no critical packages are affected.
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
npm-installyarn-addpnpm-installnpm-listyarn-listnpm-audityarn-auditpip-listpoetry-showpoetry-env-listcargo-safeapt-listapt-get-listnpm-dry-runyarn-dry-runpnpm-dry-runcargo-dry-runpoetry-dry-run