Skip to main content

PYPI: https://pypi.org/project/supply-chain-guard/

PyPI Downloads

IEEE Publication: https://doi.org/10.1109/TELE71748.2026.11591271
Python: 3.8+

🛡 Features

  • Import Interception: Blocks unauthorized access to sensitive environment variables (e.g., AWS_SECRET_ACCESS_KEY, DATABASE_URL) during package initialization.
  • File System Guard: Prevents third-party packages from reading sensitive files like ~/.ssh/id_rsa or ~/.aws/credentials.
  • OS-level Telemetry & Execution Prevention: Uses Python's native Audit Hooks (PEP 578) to actively block remote code execution (os.system, subprocess) and reverse shell network connections (socket.connect) at the moment a suspicious package is imported.

🚀 Installation

Install the package via pip:

pip install supply-chain-guard

🛡️ Usage

Option 1: Direct Import

Import the guard at the very first line of your entry point script (main.py, app.py, etc.) to protect your application:

import supply_chain_guard  # Protection starts here
import requests
# ... your other imports

Option 2: Protect Environment

  1. Run in your environment 'setup_protection.sh' it will make your repository protected as long as you use this (virtual) environment
chmod +x ./setup_protection.sh
  1. Execute setup_protection.sh
./setup_protection.sh

Option 3: Protecting Jupyter Notebook Servers

If you manage a Jupyter server for students or a team, you can enforce security globally. This ensures that every notebook is protected, even if users try to install malicious packages themselves.

Steps for Administrator:

  1. Install the package in the Python environment used by your Jupyter server:

    pip install supply-chain-guard
    
  2. Get the startup directory for IPython Notebook

    python -c "from IPython import get_ipython; print(get_ipython().profile_dir.startup_dir)"
    
  3. Create '0_force_imports.py'

     # ~/.ipython/profile_default/startup/force_imports.py
     try:
         import supply_chain_guard
         print("✅ Supply Chain Guard installed")
     except ImportError as e:
         print(f"⚠️  Import Not implemented: {e}") 
    
  4. Restart IPyhton Notebook Server and it will force 'supply_chain_guard' to all kernels of Jupyter

Installation by hand

python3 -m venv venv

source venv/bin/activate

pip install -e .

установка тестовых пакетов

pip install -e test_package/clean_pkg

pip install -e test_package/malware_pkg

pip install -e test_package/sheep_package #which has dependency from 'malicious' wolf_package

Metadata

Release files for supply-chain-guard 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for supply-chain-guard 0.2.1
File Size Uploaded Provenance Actions
supply_chain_guard-0.2.1.tar.gz 5.1 kB Without provenance Details for supply_chain_guard-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for supply-chain-guard 0.2.1
File Interpreter ABI Platform Actions
supply_chain_guard-0.2.1-py3-none-any.whl Python 3 none any Details for supply_chain_guard-0.2.1-py3-none-any.whl

Total release size: 10.5 kB

Release files / supply_chain_guard-0.2.1.tar.gz

Download URL supply_chain_guard-0.2.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0fded670ae015dad2412688b66af55639c5f6a892820b50a7c1ecd6ad5b74d65
BLAKE2b-256 checksum
How to use checksums
63ff47ec16a7c4440af549bd81cce454854a245e74ad5c17cc08fad2ac35c52a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / supply_chain_guard-0.2.1-py3-none-any.whl

Download URL supply_chain_guard-0.2.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d09f99c610f5bc9a147a0ea21636f48446963851cd2cd74cea0297da23c2d54
BLAKE2b-256 checksum
How to use checksums
11a5f1171969d3b64c98267b13945a5c1488943447c3c1889a459fb1d6ad7977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for supply-chain-guard 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page