The best free, open-source supply-chain security tool? The lockfile
Blog post from Semgrep
Lockfiles play a crucial role in enhancing supply chain security by specifying exact dependency versions and content, thereby reducing the risk associated with trusting external code from numerous developers. They provide a deterministic and reproducible build environment, which is essential for identifying and responding to vulnerabilities or malicious packages. While lockfiles can create friction by limiting automatic updates, modern package managers offer tools to update them easily, ensuring security without sacrificing flexibility. Despite some arguments against their use, such as being stuck on outdated versions or not providing benefits if the original source code is not read, lockfiles complement dependency verification and are supported by many package managers, although not all have full features like content-hash locking. Implementing lockfiles involves creating them, checking them into source control, and ensuring that installations enforce their use, thereby guaranteeing that the same code is consistently used across different environments.