Hardening CI/CD Pipelines Against Open-Source Supply-Chain Attacks Using Packj

No ratings

Presented at SecTor 2023 by

From a benign left-pad beginning to the recent Pytorch incident, software supply-chain attacks have only been increasing every year on popular open-source package registries such as NPM, PyPI, and Rubygems. Unfortunately, packages receive little to no security vetting. As a result, bad actors today can not only exploit accidental programming bugs in the code, but also device novel attacking techniques such as typo-squatting and dependency confusion to compromise open-source software dependencies and "supply" malware.In this talk we will present an open-source tool, called Packj, to help developers, security engineers, and DevOps teams to harden their CI/CD pipelines and block deliberately bad (a.k.a. malicious) code that is propagated by bad actors. Unlike the state-of-the-art vulnerability scanners, Packj can mitigate Solarwinds-like modern software supply-chain attacks from new vulnerabilities in the supply channel, including dependency confusion, typo-squatting, and protestware (sabotaging).According to a recent academic study, a whopping 93.9% of malicious NPM packages use at least one install script to execute malware. Packj not only performs static analysis to detect suspicious behavior, but also creates an install-time sandbox for preventing malicious packages from exfiltrating sensitive data, accessing sensitive files (e.g., SSH keys), and executing/persisting malware. It does not require superuser privileges, is compatible with installation of packages containing native code and is easy to use. We have built a large-scale automated system for continuous vetting of packages using Packj, and have already identified several malicious packages. In this talk, we will present the technical details, highlight our findings as well as different types of attacks, and demo our tool to detect "risky" packages and mitigate supply chain attacks.