mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
readme update
This commit is contained in:
@@ -1,2 +1,62 @@
|
||||
# 🚀 Package Manager Guard
|
||||
Protect developers against malicious OSS packages by wrapping package managers
|
||||
|
||||
# PMG (Package Manager Guard)
|
||||
|
||||
PMG is a security-focused wrapper for package managers that helps detect and prevent the installation of potentially malicious packages.
|
||||
|
||||
|
||||
## 📑 Table of Contents
|
||||
- [Supported Ecosystems](#supported-ecosystems)
|
||||
- [Installation](#installation)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Usage](#usage)
|
||||
- [Contributing](#contributing)
|
||||
|
||||
|
||||
## Supported Ecosystems
|
||||
Currently, PMG supports the following package ecosystems:
|
||||
|
||||
| Ecosystem | Status | Command |
|
||||
|-----------|--------|---------|
|
||||
| NPM | ✅ Active | `pmg npm install <package>` |
|
||||
| PyPI | 🚧 Planned | Coming soon |
|
||||
| Go | 🚧 Planned | Coming soon |
|
||||
|
||||
## Installation
|
||||
- Build from source
|
||||
|
||||
> Ensure $(go env GOPATH)/bin is in your $PATH
|
||||
|
||||
```bash
|
||||
go install github.com/safedep/pmg
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
- Go 1.24
|
||||
- SafeDep API credentials (SAFEDEP_API_KEY and SAFEDEP_TENANT_ID)
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `SAFEDEP_API_KEY`: Your SafeDep API key
|
||||
- `SAFEDEP_TENANT_ID`: Your SafeDep tenant ID
|
||||
- `NPM_AUTH_TOKEN`: (Optional) NPM authentication token for private packages
|
||||
|
||||
## Usage
|
||||
|
||||
### Scanning NPM packages
|
||||
```bash
|
||||
pmg npm install <package-name>
|
||||
```
|
||||
|
||||
OR
|
||||
```bash
|
||||
pmg npm i <package-name>
|
||||
```
|
||||
OR
|
||||
```bash
|
||||
pmg npm add <package-name>
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Please feel free to submit a Pull Request.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -11,13 +10,8 @@ func ExecCmd(name string, args, env []string) error {
|
||||
cmd := exec.Command(name, args...)
|
||||
cmd.Env = append(os.Environ(), env...)
|
||||
|
||||
var stdout, stderr bytes.Buffer
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
return fmt.Errorf("error running cmd %s: %s\nStderr: %s", name,
|
||||
err.Error(), stderr.String())
|
||||
return fmt.Errorf("error running cmd %s: %s\n", name, err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user