Protect your dependencies from supply chain attacks.
Project description
🛡️ SafeDep: Your Dependency Guardian
SafeDep is an open-source tool designed to protect developers from Supply Chain Attacks. It analyzes packages and dependencies for malicious behavior, data exfiltration, and hidden vulnerabilities before you even install them.
"Don't just scan for known vulnerabilities. Detect suspicious behavior."
✨ Why SafeDep?
The package ecosystem (PyPI, NPM, Cargo) is under constant attack from Typosquatting, Dependency Injection, and Trojan Horses. SafeDep goes beyond standard vulnerability databases (CVEs) by analyzing both the static and dynamic behavior of the code.
Key Features
- 🔍 Pre-install Sandbox: Runs installation scripts in an isolated environment to monitor what they attempt to access.
- 📡 Network Monitor: Alerts you if a "text processing" package tries to make requests to unknown IP addresses.
- 🔑 Secret Leak Detection: Identifies if a package attempts to read your environment variables (
.env) or API keys. - 🏷️ Typosquatting Protection: Checks if a package name is dangerously similar to a popular one.
🛠️ Getting Started
To use SafeDep locally, clone the repository and install it in editable mode:
# create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install SafeDep in editable mode
pip install -e .
🚀 How to Use (CLI)
SafeDep provides two main commands:
1. Check a package before installing
Analyzes a package from PyPI for typosquatting and reputation risks.
safedep check <package_name>
2. Scan a local directory
Scans Python files for dangerous code patterns (e.g., eval, os.system).
safedep scan <path_to_directory>
🗺️ Development Roadmap
Phase 1: Foundation (MVP) - "The Scanner" ✅ (Implemented)
- ✅ Implementation of name similarity analysis (Anti-Typosquatting).
- ✅ Reputation verification (package creation date, author history).
- ✅ Static code scanner for dangerous functions.
Phase 2: Intelligence (Beta) - "The Behavioralist" 🧠
Sandboxing: Integration with Docker/Podman to run setup.py and monitor system calls (syscalls). Multi-language Support: Adding support for NPM (Node.js) and Cargo (Rust) in addition to Python. CI/CD Integration: GitHub Actions to block PRs with suspicious dependencies.
Phase 3: Community and Sustainability - "The Shield" 🛡️
SafeDep Hub: A community-driven database of "audited and clean" packages. Security Badges: A system for repositories to display security trust seals. Sponsorship Program: Launching the Sponsors program to maintain the heavy analysis infrastructure.
🤝 Contribute & Sponsor
This project is 100% free and community-focused. If you believe in a safer software ecosystem, consider becoming a contributor or sponsor. Give a ⭐ on GitHub Report Bugs Become a Sponsor: GitHub Sponsors / OpenCollective Developed for those who prioritize security.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safedep-0.1.0.tar.gz.
File metadata
- Download URL: safedep-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ef789db2ab6e8dc20372f0db4a5ddf657ddb0c7174f6e97509ed809b3d79aec
|
|
| MD5 |
c4516831ff6643de5e33385a189641fb
|
|
| BLAKE2b-256 |
869ec6e6985d366785b86910bef00b2fca7ecfae5c41c4f21922194edaed08ab
|
File details
Details for the file safedep-0.1.0-py3-none-any.whl.
File metadata
- Download URL: safedep-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a2ee3145ebceef1b05b951015467fadac012dcb9985882f49a2fd7be351881c
|
|
| MD5 |
56eddda7761efb982079f7140fa10bf0
|
|
| BLAKE2b-256 |
8f0d769428f5f4ec2e50080346160f3109326c14a8e0f989f654307eb03b2aaf
|