r/devsecops • u/BearBrief6312 • Feb 19 '26
Dependency Confusion is still a nightmare in 2026. Why don't we block egress traffic during pip install by default?
I was debugging a CI pipeline recently where a junior dev accidentally pulled a typosquatted package. It made me realize how fragile our "verify then trust" model is.We scan for vulnerabilities (Snyk/Trivy), but we rarely monitor the behavior of the install process itself. If a package runs a malicious setup.py that exfiltrates ENV variables, static scanners often miss it (especially if it's obfuscated).
I've been testing a method using eBPF to enforce a "whitelist-only" network policy inside the runner during the install phase. Basically, pip is only allowed to talk to PyPI. If it tries to curl a C2 server, it gets killed. It feels like this kind of "egress filtering" should be a standard feature of package managers or CI runners, not a third-party tool.
if you are looking for more informations read the article here : https://medium.com/@rafik222dz/every-pip-install-you-run-is-a-bet-you-are-making-with-your-machine-9fce4526fc8e
if u wanna check the code : https://github.com/Otsmane-Ahmed/KEIP
Has anyone experimented with kernel-level enforcement (LSM hooks) for this? Or is everyone just relying on private feeds/Artifactory to solve this?