Skip to main content

A defensive pip wrapper with supply-chain preflight checks.

Project description

Not Finished Yet. Contribution Welcome. Site at https://spip.lamentxu.top/

secured_pip

Test License: MIT Python_version PyPI Version Codecov

An open-source, free guard for your pip to avoid supply-chain attacks.

By using this, you can avoid being screwed by the poisoned LiteLLM, etc. just because you type pip install

What?

Currently, supply chain attacks are one of the major security concerns all over the world. The secured_pip project is a future pip wrapper focused on supply-chain risk controls.

Wait, What?

You can use

spip install requests

Instead of

pip install requests

To install a package more safely in the scope of supply chain security.

You do not need to configure. You do not need to learn. Just pure install-to-master.

In other words, you can completely replace pip install with spip install to make your installation safer :)

If you want a near drop-in experience, you can set a shell alias from pip to spip.

Command Prompt (Windows):

doskey pip=spip $*

Bash (Linux):

echo "alias pip='spip'" >> ~/.bashrc
source ~/.bashrc

Zsh (macOS):

echo "alias pip='spip'" >> ~/.zshrc
source ~/.zshrc

The secured_pip project will actively check for all the supply chain risks and avoid you installing potentially malicious packages when typing spip install

Except for the install commands, the project behaves exactly the same as the original pip program. That is, you can always use spip instead of pip in any case :)

If you want to refresh local caches used by spip, run:

spip refresh-cache

Why not SFW / GuardDog?

There are already good supply-chain tools out there. secured_pip is not trying to replace all of them. The point is different: keep the protection path as light as possible for everyday Python installs.

  • Compared with Socket Firewall (sfw): Socket Firewall works as a wrapper/proxy layer in front of package-manager network requests and uses Socket's security intelligence to block packages before download. secured_pip is much smaller in scope: it is a local Python-only pip wrapper, with no proxy service, no organization dashboard, and no extra infrastructure to run. Official Socket docs: https://docs.socket.dev/docs/socket-firewall-overview
  • Compared with GuardDog: GuardDog is a scanning CLI that downloads package source archives and applies source-code and metadata heuristics, including Semgrep-based rules. secured_pip is intentionally lighter: it stays close to pip install, does quick local checks around the install flow, and does not try to be a full package-code scanner. Official GuardDog README: https://github.com/DataDog/guarddog

In short, secured_pip optimizes for:

  • near-drop-in use with spip install
  • local, lightweight checks
  • minimal workflow change
  • Python / pip focus instead of broad multi-ecosystem coverage

Current minimum Python version: 3.10

We currently have three install warning policies:

  • HIGH: pause installation and require --ignore-warning
  • MEDIUM: prompt y/n before continuing
  • LOW: warn and continue

When spip detects a potential risk, a warning will be raised, with the level depending on the severity the risk is.

For now, the project has several major check points:

  • Fake typo checks: Hackers often use "fake typos" to inject a malicious dependency package into the poisoned source file. spip detects this by first resolving all the packages that pip install is going to download, and then comparing non-popular resolved package names with a local hot-package list. Warning levels:
    • Medium severity: requsets vs requests
    • Medium severity: pandaz vs pandas
    • Low severity: sixth vs six
  • Fresh release checks: If the selected PyPI release was published less than 2 days ago, spip will raise a MEDIUM warning.
  • Disposable email checks: If the PyPI release metadata uses a known disposable author or maintainer email domain, spip will raise a LOW warning. The built-in blocklist is vendored from disposable/disposable-email-domains strict mode.
  • Zero-version checks: If the selected package version is 0.0 or 0.0.0, spip will raise a LOW warning.
  • .pth file detection: Instead of directly injecting malicious code inside the package, today most hackers will place their bad stuff under a .pth file, with an import as the beginning. spip only checks the installed file-system diff after installation. The warning level is always MEDIUM, and spip will ask whether to delete the suspicious installed .pth file.
  • TODO ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secured_pip-0.3.0.tar.gz (443.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secured_pip-0.3.0-py3-none-any.whl (438.2 kB view details)

Uploaded Python 3

File details

Details for the file secured_pip-0.3.0.tar.gz.

File metadata

  • Download URL: secured_pip-0.3.0.tar.gz
  • Upload date:
  • Size: 443.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0b2

File hashes

Hashes for secured_pip-0.3.0.tar.gz
Algorithm Hash digest
SHA256 515e95dcffcdb8cbc15d77ddb714fccc43ae05bbf4432ff7fbef03185253aa53
MD5 239f6421385f634ef5beadf052719cee
BLAKE2b-256 a76fd9b396b1e3ff5a9b1a5eb0ed8e3ef6c16c95139e7f24b82755555c41aa65

See more details on using hashes here.

File details

Details for the file secured_pip-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: secured_pip-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 438.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0b2

File hashes

Hashes for secured_pip-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd0e48c15836b03e2323511c687c040b8892d187be1d6c073f83c157c5cfdd2f
MD5 2b41720da17defcc5849756f8341974c
BLAKE2b-256 6b63bf9a545d8483c1271dd759fb3f7e0fede2bc783d6a258d0a2dd7230c2c16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page