mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
chore: Improve UX
This commit is contained in:
+31
-23
@@ -16,11 +16,11 @@ features, we particularly value contributions in the form of:
|
|||||||
|
|
||||||
## How to report a bug
|
## How to report a bug
|
||||||
|
|
||||||
Create a new issue and add the label "bug".
|
Create a new issue and add the label `bug`.
|
||||||
|
|
||||||
## How to suggest a new feature
|
## How to suggest a new feature
|
||||||
|
|
||||||
Create a new issue and add the label "enhancement".
|
Create a new issue and add the label `enhancement`.
|
||||||
|
|
||||||
## Development workflow
|
## Development workflow
|
||||||
|
|
||||||
@@ -41,38 +41,46 @@ When contributing changes to repository, follow these steps:
|
|||||||
### Getting Started
|
### Getting Started
|
||||||
|
|
||||||
1. Clone your fork:
|
1. Clone your fork:
|
||||||
```bash
|
|
||||||
git clone https://github.com/YOUR_USERNAME/pmg.git
|
```shell
|
||||||
cd pmg
|
git clone https://github.com/YOUR_USERNAME/pmg.git
|
||||||
```
|
cd pmg
|
||||||
|
```
|
||||||
|
|
||||||
2. Install dependencies:
|
2. Install dependencies:
|
||||||
```bash
|
|
||||||
go mod tidy
|
```shell
|
||||||
```
|
go mod tidy
|
||||||
|
```
|
||||||
|
|
||||||
3. Build the project:
|
3. Build the project:
|
||||||
```bash
|
|
||||||
make all
|
```shell
|
||||||
```
|
make all
|
||||||
|
```
|
||||||
|
|
||||||
### Development Workflow
|
### Development Workflow
|
||||||
|
|
||||||
1. Create a branch:
|
1. Create a branch:
|
||||||
```bash
|
|
||||||
git checkout -b feature/your-feature
|
```shell
|
||||||
```
|
git checkout -b feature/your-feature
|
||||||
|
```
|
||||||
|
|
||||||
2. Make your changes and test:
|
2. Make your changes and test:
|
||||||
```bash
|
|
||||||
make test
|
```shell
|
||||||
```
|
make test
|
||||||
|
```
|
||||||
|
|
||||||
3. Commit with sign-off:
|
3. Commit with sign-off:
|
||||||
```bash
|
|
||||||
git commit -s -m "feat: add new feature"
|
```shell
|
||||||
```
|
git commit -s -m "feat: add new feature"
|
||||||
|
```
|
||||||
|
|
||||||
4. Push and create PR:
|
4. Push and create PR:
|
||||||
```bash
|
|
||||||
git push origin feature/your-feature
|
```shell
|
||||||
|
git push origin feature/your-feature
|
||||||
|
```
|
||||||
|
|||||||
@@ -7,7 +7,17 @@ See [example](https://safedep.io/malicious-npm-package-express-cookie-parser/)
|
|||||||
- Blocks malicious packages at install time
|
- Blocks malicious packages at install time
|
||||||
- No configuration required, just install and use
|
- No configuration required, just install and use
|
||||||
|
|
||||||
## TL;DR
|
## 🔥 PMG in Action
|
||||||
|
|
||||||
|
<img src="./docs/assets/pmg-intro.png" width="600" alt="pmg in action">
|
||||||
|
|
||||||
|
## 📦 TL;DR
|
||||||
|
|
||||||
|
Install `pmg`
|
||||||
|
|
||||||
|
```shell
|
||||||
|
brew install safedep/tap/pmg
|
||||||
|
```
|
||||||
|
|
||||||
Set up `pmg` to protect you development environment from malicious packages:
|
Set up `pmg` to protect you development environment from malicious packages:
|
||||||
|
|
||||||
@@ -19,16 +29,20 @@ source ~/.zshrc
|
|||||||
|
|
||||||
Continue using your favorite package manager as usual:
|
Continue using your favorite package manager as usual:
|
||||||
|
|
||||||
```
|
```shell
|
||||||
npm install <package-name>
|
npm install <package-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
pnpm add <package-name>
|
pnpm add <package-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📑 Table of Contents
|
## 📑 Table of Contents
|
||||||
- [Package Manager Guard (PMG)](#package-manager-guard-pmg)
|
- [Package Manager Guard (PMG)](#package-manager-guard-pmg)
|
||||||
- [TL;DR](#tldr)
|
- [🔥 PMG in Action](#-pmg-in-action)
|
||||||
|
- [📦 TL;DR](#-tldr)
|
||||||
- [📑 Table of Contents](#-table-of-contents)
|
- [📑 Table of Contents](#-table-of-contents)
|
||||||
- [Features](#features)
|
- [🔥 Features](#-features)
|
||||||
- [Supported Package Managers](#supported-package-managers)
|
- [Supported Package Managers](#supported-package-managers)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Binaries](#binaries)
|
- [Binaries](#binaries)
|
||||||
@@ -37,13 +51,10 @@ pnpm add <package-name>
|
|||||||
- [Silent Mode](#silent-mode)
|
- [Silent Mode](#silent-mode)
|
||||||
- [Verbose Mode](#verbose-mode)
|
- [Verbose Mode](#verbose-mode)
|
||||||
- [Debugging](#debugging)
|
- [Debugging](#debugging)
|
||||||
- [PMG in Action](#pmg-in-action)
|
- [🤝 Contributing](#-contributing)
|
||||||
- [Malicious Package Detection](#malicious-package-detection)
|
- [🚫 Limitations](#-limitations)
|
||||||
- [Bulk Package Analysis](#bulk-package-analysis)
|
|
||||||
- [Contributing](#contributing)
|
|
||||||
- [Limitations](#limitations)
|
|
||||||
|
|
||||||
## Features
|
## 🔥 Features
|
||||||
|
|
||||||
- 🚫 Malicious package identification using [SafeDep Cloud](https://docs.safedep.io/cloud/malware-analysis)
|
- 🚫 Malicious package identification using [SafeDep Cloud](https://docs.safedep.io/cloud/malware-analysis)
|
||||||
- 🌲 Deep dependency analysis and transitive dependency resolution
|
- 🌲 Deep dependency analysis and transitive dependency resolution
|
||||||
@@ -135,19 +146,11 @@ Store the debug logs in a file:
|
|||||||
pmg --debug --log /tmp/debug.json npm install <package-name>
|
pmg --debug --log /tmp/debug.json npm install <package-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
### PMG in Action
|
## 🤝 Contributing
|
||||||
|
|
||||||
#### Malicious Package Detection
|
|
||||||

|
|
||||||
|
|
||||||
#### Bulk Package Analysis
|
|
||||||

|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)
|
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||||
|
|
||||||
## Limitations
|
## 🚫 Limitations
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Approximate dependency version resolution</summary>
|
<summary>Approximate dependency version resolution</summary>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 212 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 151 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 293 KiB |
+4
-4
@@ -104,11 +104,11 @@ func printMaliciousPackagesList(malwarePackages []*analyzer.PackageVersionAnalys
|
|||||||
|
|
||||||
if verbosityLevel == VerbosityLevelVerbose {
|
if verbosityLevel == VerbosityLevelVerbose {
|
||||||
fmt.Println(Colors.Yellow(termWidthFormatText(mp.Summary, 80)))
|
fmt.Println(Colors.Yellow(termWidthFormatText(mp.Summary, 80)))
|
||||||
|
}
|
||||||
|
|
||||||
if mp.ReferenceURL != "" {
|
if mp.ReferenceURL != "" {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
fmt.Println(Colors.Yellow(fmt.Sprintf("Reference: %s", mp.ReferenceURL)))
|
fmt.Println(Colors.Yellow(fmt.Sprintf("Reference: %s", mp.ReferenceURL)))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user