How do you prevent dependency confusion and typosquatting in build pipelines?
AdvancedProductionSupply Chain and Pipeline Security
Answer
Resolve all dependencies through a repository manager that you control, with routing rules so internal package names and scopes only come from private repositories, and public proxies block names that collide with internal ones. Use scoped packages, lockfiles with integrity hashes, npm ci/pip --require-hashes, a cooling-off delay for new versions (Renovate minimumReleaseAge), and block install scripts where practical (npm ci --ignore-scripts then run required scripts explicitly). Monitor with tools like Socket or OSV scanning.
More on Supply Chain and Pipeline Security
What is a software supply chain attack, and where does the pipeline fit?BeginnerWhat is an SBOM and why do you generate one in CI?BeginnerHow do you sign container images and verify them at deploy time?IntermediateWhat is SLSA and which level should a typical team aim for?IntermediateHow do you verify provenance before deploying?AdvancedHow do you scan images and dependencies in the pipeline without drowning in noise?Intermediate