mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>Package Manager Guard (PMG)</h1>
|
<h1>Package Manager Guard (PMG)</h1>
|
||||||
<h3>Prevent supply chain attacks before they happen.</h3>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
@@ -30,14 +29,24 @@
|
|||||||
|
|
||||||
## Why PMG?
|
## Why PMG?
|
||||||
|
|
||||||
Modern software development relies heavily on open-source packages. However, standard package managers (`npm`, `pip`, etc.) prioritize convenience over security, executing arbitrary code (like `postinstall` scripts) on your machine without validation. This vector is frequently exploited by attackers to steal credentials or inject backdoors.
|
AI coding agents install packages you didn't choose. Claude Code, Cursor, Copilot, Windsurf all run `npm install` and `pip install` autonomously, and you have no idea what they just put on your machine.
|
||||||
|
|
||||||
**PMG acts as a security middleware layer.** It wraps your package manager to:
|
PMG ensures every package is checked for malware before it executes, whether you picked it or an AI agent did.
|
||||||
|
|
||||||
1. **Analyze** packages for malware before they are installed.
|
1. **Analyze** packages for malware before they are installed.
|
||||||
2. **Sandbox** the installation process to prevent system modification.
|
2. **Sandbox** the installation process to prevent system modification.
|
||||||
3. **Audit** every package installation event.
|
3. **Audit** every package installation event.
|
||||||
|
|
||||||
|
Install PMG once, and every `npm install`, `pip install`, and `poetry add` is protected automatically.
|
||||||
|
|
||||||
|
> Featured in [tl;dr sec](https://tldrsec.com/p/tldr-sec-316) and used by engineering teams worldwide to secure their software supply chain.
|
||||||
|
|
||||||
|
## How PMG is Different
|
||||||
|
|
||||||
|
Most security tools scan after installation and report vulnerabilities. By then, malicious code has already executed on your machine.
|
||||||
|
|
||||||
|
PMG intercepts package managers **before** code executes, blocking malicious packages at install time, not flagging them after the damage is done. Detection is powered by [SafeDep's malicious package analysis engine](https://safedep.io). For defense in depth, PMG sandboxes the installation process using OS-native isolation, so even zero-day malware that evades detection cannot modify your system.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
Get protected in seconds.
|
Get protected in seconds.
|
||||||
@@ -69,7 +78,7 @@ pmg setup install
|
|||||||
|
|
||||||
### 3. Use
|
### 3. Use
|
||||||
|
|
||||||
Continue using your favorite package manager tools as usual. PMG works silently in the background.
|
Use your package managers as usual — or let your AI coding agent use them. PMG works silently in the background.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install express
|
npm install express
|
||||||
@@ -77,17 +86,21 @@ npm install express
|
|||||||
pip install requests
|
pip install requests
|
||||||
```
|
```
|
||||||
|
|
||||||
If a malicious package is detected, PMG blocks it immediately:
|
When an AI agent (or you) tries to install a malicious package, PMG blocks it:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
[PMG] Blocked malicious package: malicious-lib@1.0.0
|
✗ Malicious package blocked
|
||||||
[PMG] Reason: Known malware signature detected
|
|
||||||
|
- safedep-test-pkg@1.0.0
|
||||||
|
|
||||||
|
✗ PMG: 1 packages analyzed, 1 blocked
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
| Feature | Description |
|
| Feature | Description |
|
||||||
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| **AI Agent Safety Net** | Protects against malicious packages installed by AI coding agents (Claude Code, Cursor, Copilot, Windsurf). |
|
||||||
| **Malicious Package Protection** | Real-time protection against malicious packages using [SafeDep](https://docs.safedep.io/cloud/malware-analysis). |
|
| **Malicious Package Protection** | Real-time protection against malicious packages using [SafeDep](https://docs.safedep.io/cloud/malware-analysis). |
|
||||||
| **Sandboxing** | Enforces least privilege using OS native sandboxing to contain installation scripts. |
|
| **Sandboxing** | Enforces least privilege using OS native sandboxing to contain installation scripts. |
|
||||||
| **Dependency Analysis** | Deep scans of direct and transitive dependencies before they hit your disk. |
|
| **Dependency Analysis** | Deep scans of direct and transitive dependencies before they hit your disk. |
|
||||||
@@ -156,48 +169,16 @@ Security is our first class requirement. PMG builds are reproducible and signed.
|
|||||||
* **Verification**: Users can cryptographically prove the binary matches the source code.
|
* **Verification**: Users can cryptographically prove the binary matches the source code.
|
||||||
* See [Trusting PMG](docs/trust.md) for verification steps.
|
* See [Trusting PMG](docs/trust.md) for verification steps.
|
||||||
|
|
||||||
## Usage Guide
|
## User Guide
|
||||||
|
|
||||||
PMG runs transparently, but you can control it when needed.
|
|
||||||
|
|
||||||
### Paranoid Mode
|
|
||||||
|
|
||||||
Treat all unverified or suspicious packages as malicious.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pmg --paranoid npm install <package>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Dry Run
|
|
||||||
|
|
||||||
Simulate installation to check for malware without writing to disk.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pmg --dry-run npm install <package>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Debugging
|
|
||||||
|
|
||||||
Enable verbose logs for troubleshooting.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pmg --debug npm install <package>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Emergency Bypass
|
|
||||||
> ⚠️ **Warning**: Bypassing security checks exposes users to risk.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export PMG_INSECURE_INSTALLATION=true
|
|
||||||
npm install <package>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Advanced Documentation
|
|
||||||
|
|
||||||
* [Trusted Packages Configuration](docs/trusted-packages.md)
|
* [Trusted Packages Configuration](docs/trusted-packages.md)
|
||||||
* [Proxy Mode Architecture](docs/proxy-mode.md)
|
* [Proxy Mode Architecture](docs/proxy-mode.md)
|
||||||
* [Sandboxing Details](docs/sandbox.md)
|
* [Sandboxing Details](docs/sandbox.md)
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
If PMG saved you from a bad package, [star this repo](https://github.com/safedep/pmg) — it helps others find it.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to build and test PMG locally.
|
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to build and test PMG locally.
|
||||||
|
|||||||
Reference in New Issue
Block a user