What is a malicious-package defence strategy for npm, PyPI and Maven?
AdvancedConceptSupply Chain, SBOM, Signing and Image/IaC Scanning
Answer
Route all installs through a proxy registry with a quarantine or minimum-age policy for brand-new versions; use lockfiles and npm ci / pip install --require-hashes; disable install scripts where possible (npm ci --ignore-scripts); scan with tools that detect malicious behaviour (Socket, OpenSSF package-analysis, GuardDog); and require review for new direct dependencies.
Build in an egress-restricted environment so a malicious install script cannot phone home.
More on Supply Chain, SBOM, Signing and Image/IaC Scanning
What is a software supply chain attack? Give examples.BeginnerExplain dependency confusion and typosquatting.IntermediateWhat is an SBOM and why do we need one?BeginnerCycloneDX vs SPDX: how do they differ?IntermediateHow do you generate and use an SBOM with Syft and Grype?BeginnerWhat is VEX?Intermediate