fix(security): phase 1 critical fixes for public release
- Redact PostgreSQL DSN password from stdout/logs - Harden .dockerignore to exclude .ssh/, .claude/, *.db, *.local files - SSRF protection: block private/loopback/link-local IPs by default (UPTOP_ALLOW_PRIVATE_TARGETS=true to override for homelab use) - Fix email header injection via CRLF in monitor names - AES-256-GCM encryption for alert credentials at rest (UPTOP_ENCRYPTION_KEY env var, migrate-secrets subcommand) - TLS support for HTTP server (UPTOP_TLS_CERT/UPTOP_TLS_KEY) with HSTS header when TLS enabled
This commit is contained in:
@@ -3,14 +3,15 @@ package cluster
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"gitea.lerkolabs.com/lerko/uptop/internal/models"
|
||||
"gitea.lerkolabs.com/lerko/uptop/internal/monitor"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.lerkolabs.com/lerko/uptop/internal/models"
|
||||
"gitea.lerkolabs.com/lerko/uptop/internal/monitor"
|
||||
)
|
||||
|
||||
// --- Mock Store (minimal, for monitor.NewEngine) ---
|
||||
@@ -295,7 +296,7 @@ func TestProbeExecuteChecks(t *testing.T) {
|
||||
|
||||
strict := &http.Client{}
|
||||
insecure := &http.Client{}
|
||||
results := probeExecuteChecks(context.Background(), sites, strict, insecure)
|
||||
results := probeExecuteChecks(context.Background(), sites, strict, insecure, true)
|
||||
|
||||
if len(results) != 2 {
|
||||
t.Fatalf("expected 2 results, got %d", len(results))
|
||||
@@ -329,7 +330,7 @@ func TestProbeExecuteChecks_Concurrency(t *testing.T) {
|
||||
sites = append(sites, models.Site{ID: i + 1, Type: "http", URL: srv.URL})
|
||||
}
|
||||
|
||||
results := probeExecuteChecks(context.Background(), sites, &http.Client{}, &http.Client{})
|
||||
results := probeExecuteChecks(context.Background(), sites, &http.Client{}, &http.Client{}, true)
|
||||
if len(results) != 20 {
|
||||
t.Errorf("expected 20 results, got %d", len(results))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user