Skip to content

Commit e1665a8

Browse files
committed
Merge feature/security-scan: add security scan command (v1.6.2)
2 parents ba6d77c + c6d3089 commit e1665a8

15 files changed

Lines changed: 1177 additions & 30 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ pm run order-service
183183
- 🐳 **Docker support** - Detect Docker Compose projects, default commands (build, up, down, clean)
184184
- 🪝 **Pre-/post-command hooks** - Run custom scripts before or after any command with `pm hooks`
185185
- 🔤 **Shell autocompletion** - TAB completion for bash, zsh, fish, and PowerShell with `pm completions`
186+
- 🔐 **Security scan** - Detect misconfigurations (Dockerfile root, exposed secrets, insecure URLs) with `pm secure`, auto-fix with `--fix`
186187
- 🌐 **Multi-platform** - Works on Windows, Linux, and Mac
187188

188189
---
@@ -246,6 +247,8 @@ chmod +x scripts/install.sh && ./scripts/install.sh
246247
| `pm update` | Update to the latest version |
247248
| `pm doctor` | Diagnose environment (runtimes, paths, health scores) |
248249
| `pm doctor --score` | Show only health grades (A/B/C/D/F) per project |
250+
| `pm secure` | Scan projects for security misconfigurations |
251+
| `pm secure --fix` | Auto-fix .gitignore issues (add .env, *.pem, *.key entries) |
249252
| `pm help` | Show help |
250253
| `pm version` | Show version |
251254

@@ -455,9 +458,10 @@ Projects are saved in:
455458
- **CLI**`pm doctor`, `pm env`, `pm refresh`, `pm rename`, `pm update`, `pm commands add/remove`
456459
- **Runtimes** — Gradle, Maven, Node.js, .NET, Python, Rust, Go, pnpm, Bun, Yarn, Flutter, Docker
457460
- **Integrations** — Git status, interactive TTY, multi-platform installers, GitHub Actions
458-
- **Reliability** — Atomic writes, backup/recovery, directory validation, download integrity, 441 tests
461+
- **Security**`pm secure` scans for misconfigurations, `--fix` auto-remediates .gitignore issues
462+
- **Reliability** — Atomic writes, backup/recovery, directory validation, download integrity, 498 tests
459463

460-
> Latest release: **v1.6.1** (Doctor Health Score) — Full version history in [ROADMAP.md](ROADMAP.md)
464+
> Latest release: **v1.6.2** (Security Scan) — Full version history in [ROADMAP.md](ROADMAP.md)
461465
462466
### 💡 Future Ideas
463467
- [ ] `pm run-all` / `pm build-all` - Execute commands across all projects

ROADMAP.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,21 @@ Run custom scripts automatically before or after any command. Hooks are per-proj
201201

202202
---
203203

204-
## v1.6.2 — Security Scan
204+
## v1.6.2 — Security Scan
205205

206206
### `pm secure` command
207-
- Best practices security scan (filesystem patterns only, no secret management)
208-
- Checks:
209-
- Dockerfile runs as non-root user
210-
- `.env` files are in `.gitignore`
211-
- No hardcoded `http://` URLs in config files (should be `https://`)
212-
- Sensitive files (`.pem`, `.key`) are in `.gitignore`
213-
- Dependencies lockfile exists
214-
- `pm secure` — run all checks and show report
215-
- `pm secure --fix` — auto-fix what can be fixed (e.g., add entries to `.gitignore`)
207+
208+
| Feature | Status |
209+
|---------|--------|
210+
| Best practices security scan (filesystem patterns only, no secret management) | ✅ Done |
211+
| Check: Dockerfile runs as non-root user | ✅ Done |
212+
| Check: `.env` files are in `.gitignore` | ✅ Done |
213+
| Check: No hardcoded `http://` URLs in config files (should be `https://`) | ✅ Done |
214+
| Check: Sensitive files (`.pem`, `.key`) are in `.gitignore` | ✅ Done |
215+
| Check: Dependencies lockfile exists | ✅ Done |
216+
| `pm secure` — run all checks and show report | ✅ Done |
217+
| `pm secure --fix` — auto-fix what can be fixed (add entries to `.gitignore`) | ✅ Done |
218+
| Auto-fix creates `.gitignore` if not present | ✅ Done |
216219

217220
---
218221

User-Guide.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Shell Autocompletion](#-shell-autocompletion)
1717
- [Environment Variable Management](#-environment-variable-management)
1818
- [Diagnostics](#-diagnostics)
19+
- [Security Scan](#-security-scan)
1920
- [Help and Version](#-help-and-version)
2021
- [Environment Variables](#-environment-variables)
2122
- [What Are They?](#what-are-they)
@@ -691,6 +692,38 @@ Shows just the letter grade per project without details:
691692

692693
---
693694

695+
### 🔹 Security Scan
696+
697+
#### Scan all projects for security issues
698+
```bash
699+
pm secure
700+
```
701+
702+
Runs 5 filesystem-only security checks on each registered project:
703+
704+
| Check | Pass condition | Recommendation if failed |
705+
|-------|---------------|--------------------------|
706+
| Dockerfile non-root | No Dockerfile, or Dockerfile contains `USER` (not root) | Add a USER directive to avoid running as root |
707+
| Env protection | `.gitignore` contains `.env` patterns | Add .env to .gitignore to prevent leaking secrets |
708+
| HTTPS only | No `http://` URLs in config files (excluding localhost) | Replace http:// with https:// in config files |
709+
| Sensitive files | `.gitignore` contains `*.pem` and `*.key` patterns | Add *.pem and *.key to .gitignore to protect keys |
710+
| Lockfile | Dependency lockfile exists for project type | Commit your lockfile to prevent supply-chain attacks |
711+
712+
Result coloring: **5/5** = green, **3–4/5** = yellow, **0–2/5** = red
713+
714+
#### Auto-fix .gitignore issues
715+
```bash
716+
pm secure --fix
717+
```
718+
719+
Automatically adds missing entries to `.gitignore`:
720+
- `.env` and `.env.*` (environment files)
721+
- `*.pem`, `*.key`, `*.p12`, `*.pfx` (private keys and certificates)
722+
723+
Creates `.gitignore` if it doesn't exist. Does **not** duplicate entries that are already present.
724+
725+
---
726+
694727
### 🔹 Help and Version
695728

696729
#### View help
@@ -1638,6 +1671,10 @@ pm completions powershell # Generate PowerShell completion
16381671
pm doctor # Full report: runtimes + project health (A-F)
16391672
pm doctor --score # Compact: only health grades per project
16401673

1674+
# === SECURITY ===
1675+
pm secure # Scan all projects for security issues
1676+
pm secure --fix # Auto-fix .gitignore issues
1677+
16411678
# === UPDATES ===
16421679
pm update # Update to latest version
16431680

docs/es/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ pm run servicio-pedidos
183183
- 🐳 **Soporte Docker** - Detecta proyectos Docker Compose, comandos por defecto (build, up, down, clean)
184184
- 🪝 **Hooks pre-/post-comando** - Ejecuta scripts personalizados antes o después de cualquier comando con `pm hooks`
185185
- 🔤 **Autocompletado en shell** - Completado con TAB para bash, zsh, fish y PowerShell con `pm completions`
186+
- 🔐 **Escaneo de seguridad** - Detecta misconfiguraciones (Dockerfile root, secretos expuestos, URLs inseguras) con `pm secure`, auto-corrige con `--fix`
186187
- 🌐 **Multi-plataforma** - Funciona en Windows, Linux y Mac
187188

188189
---
@@ -246,6 +247,8 @@ chmod +x scripts/install.sh && ./scripts/install.sh
246247
| `pm update` | Actualizar a la última versión |
247248
| `pm doctor` | Diagnosticar entorno (runtimes, rutas, puntuación de salud) |
248249
| `pm doctor --score` | Mostrar solo calificaciones de salud (A/B/C/D/F) por proyecto |
250+
| `pm secure` | Escanear proyectos buscando misconfiguraciones de seguridad |
251+
| `pm secure --fix` | Auto-corregir problemas de .gitignore (añadir .env, *.pem, *.key) |
249252
| `pm help` | Mostrar ayuda |
250253
| `pm version` | Mostrar versión |
251254

@@ -455,9 +458,10 @@ Los proyectos se guardan en:
455458
- **CLI**`pm doctor`, `pm env`, `pm refresh`, `pm rename`, `pm update`, `pm commands add/remove`
456459
- **Runtimes** — Gradle, Maven, Node.js, .NET, Python, Rust, Go, pnpm, Bun, Yarn, Flutter, Docker
457460
- **Integraciones** — Estado Git, TTY interactivo, instaladores multi-plataforma, GitHub Actions
458-
- **Fiabilidad** — Escritura atómica, backup/recuperación, validación de directorio, integridad de descarga, 441 tests
461+
- **Seguridad**`pm secure` escanea misconfiguraciones, `--fix` auto-corrige problemas de .gitignore
462+
- **Fiabilidad** — Escritura atómica, backup/recuperación, validación de directorio, integridad de descarga, 498 tests
459463

460-
> Última release: **v1.6.1** (Puntuación de Salud del Doctor) — Historial completo en [ROADMAP.md](ROADMAP.md)
464+
> Última release: **v1.6.2** (Escaneo de Seguridad) — Historial completo en [ROADMAP.md](ROADMAP.md)
461465
462466
### 💡 Ideas Futuras
463467
- [ ] `pm run-all` / `pm build-all` - Ejecutar comandos en todos los proyectos

docs/es/ROADMAP.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,21 @@ Ejecuta scripts personalizados automáticamente antes o después de cualquier co
201201

202202
---
203203

204-
## v1.6.2 — Escaneo de Seguridad
204+
## v1.6.2 — Escaneo de Seguridad
205205

206206
### Comando `pm secure`
207-
- Escaneo de buenas prácticas de seguridad (solo patrones del sistema de archivos, sin gestión de secretos)
208-
- Verificaciones:
209-
- Dockerfile ejecuta como usuario no-root
210-
- Archivos `.env` están en `.gitignore`
211-
- No hay URLs `http://` hardcodeadas en archivos de configuración (deberían ser `https://`)
212-
- Archivos sensibles (`.pem`, `.key`) están en `.gitignore`
213-
- Existe lockfile de dependencias
214-
- `pm secure` — ejecutar todas las verificaciones y mostrar reporte
215-
- `pm secure --fix` — auto-corregir lo que se pueda (ej. añadir entradas a `.gitignore`)
207+
208+
| Funcionalidad | Estado |
209+
|---------------|--------|
210+
| Escaneo de buenas prácticas de seguridad (solo patrones del sistema de archivos) | ✅ Hecho |
211+
| Verificación: Dockerfile ejecuta como usuario no-root | ✅ Hecho |
212+
| Verificación: Archivos `.env` están en `.gitignore` | ✅ Hecho |
213+
| Verificación: No hay URLs `http://` hardcodeadas en config (deberían ser `https://`) | ✅ Hecho |
214+
| Verificación: Archivos sensibles (`.pem`, `.key`) están en `.gitignore` | ✅ Hecho |
215+
| Verificación: Existe lockfile de dependencias | ✅ Hecho |
216+
| `pm secure` — ejecutar todas las verificaciones y mostrar reporte | ✅ Hecho |
217+
| `pm secure --fix` — auto-corregir problemas de `.gitignore` | ✅ Hecho |
218+
| Auto-fix crea `.gitignore` si no existe | ✅ Hecho |
216219

217220
---
218221

docs/es/User-Guide.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Autocompletado en Shell](#-autocompletado-en-shell)
1717
- [Gestión de Variables de Entorno](#-gestión-de-variables-de-entorno)
1818
- [Diagnósticos](#-diagnósticos)
19+
- [Escaneo de Seguridad](#-escaneo-de-seguridad)
1920
- [Ayuda y Versión](#-ayuda-y-versión)
2021
- [Variables de Entorno](#-variables-de-entorno)
2122
- [¿Qué Son?](#qué-son)
@@ -691,6 +692,38 @@ Muestra solo la nota por proyecto sin detalles:
691692

692693
---
693694

695+
### 🔹 Escaneo de Seguridad
696+
697+
#### Escanear todos los proyectos
698+
```bash
699+
pm secure
700+
```
701+
702+
Ejecuta 5 verificaciones de seguridad basadas en el sistema de archivos en cada proyecto:
703+
704+
| Verificación | Condición para pasar | Recomendación si falla |
705+
|-------------|---------------------|----------------------|
706+
| Dockerfile no-root | No hay Dockerfile, o contiene directiva `USER` (no root) | Añade USER para no ejecutar como root |
707+
| Protección .env | `.gitignore` contiene patrones `.env` | Añade .env a .gitignore para evitar filtrar secretos |
708+
| Solo HTTPS | No hay URLs `http://` en archivos de configuración (excluyendo localhost) | Reemplaza http:// con https:// |
709+
| Archivos sensibles | `.gitignore` contiene `*.pem` y `*.key` | Añade *.pem y *.key a .gitignore |
710+
| Lockfile | Lockfile de dependencias existe para el tipo de proyecto | Commitea tu lockfile contra ataques de supply-chain |
711+
712+
Coloreado: **5/5** = verde, **3–4/5** = amarillo, **0–2/5** = rojo
713+
714+
#### Auto-corregir problemas de .gitignore
715+
```bash
716+
pm secure --fix
717+
```
718+
719+
Añade automáticamente entradas faltantes a `.gitignore`:
720+
- `.env` y `.env.*` (archivos de entorno)
721+
- `*.pem`, `*.key`, `*.p12`, `*.pfx` (claves privadas y certificados)
722+
723+
Crea `.gitignore` si no existe. **No** duplica entradas existentes.
724+
725+
---
726+
694727
### 🔹 Ayuda y Versión
695728

696729
#### Ver ayuda
@@ -1638,6 +1671,10 @@ pm completions powershell # Generar script para PowerSh
16381671
pm doctor # Reporte completo: runtimes + salud (A-F)
16391672
pm doctor --score # Compacto: solo calificaciones por proyecto
16401673

1674+
# === SEGURIDAD ===
1675+
pm secure # Escanear proyectos buscando problemas de seguridad
1676+
pm secure --fix # Auto-corregir problemas de .gitignore
1677+
16411678
# === ACTUALIZACIONES ===
16421679
pm update # Actualizar a última versión
16431680

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Identificación del proyecto -->
99
<groupId>pm</groupId>
1010
<artifactId>projectmanager</artifactId>
11-
<version>1.6.1</version>
11+
<version>1.6.2</version>
1212
<packaging>jar</packaging>
1313

1414
<name>ProjectManager</name>

scripts/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ProjectManager - Installation Script for Windows
22
# Works both from source (mvn clean package) and from GitHub Release download
33

4-
$jarName = "projectmanager-1.6.1.jar"
4+
$jarName = "projectmanager-1.6.2.jar"
55

66
Write-Host "=== ProjectManager Installer ===" -ForegroundColor Cyan
77
Write-Host ""

scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# ProjectManager - Installation Script for Linux/Mac
33
# Works both from source (mvn clean package) and from GitHub Release download
44

5-
JAR_NAME="projectmanager-1.6.1.jar"
5+
JAR_NAME="projectmanager-1.6.2.jar"
66

77
echo "=== ProjectManager Installer ==="
88
echo ""

0 commit comments

Comments
 (0)