Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
security: enforce scope checks for AI approvals and config management
rcourtman8f92273e3326
diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.goindex b722b705f5..4cdbbd8066 100644--- a/internal/api/ai_handlers.go+++ b/internal/api/ai_handlers.go@@ -4763,6 +4763,11 @@ func (h *AISettingsHandler) HandleApproveCommand(w http.ResponseWriter, r *http.return}+ // SECURITY: Validating command execution scope+ if !ensureScope(w, r, config.ScopeAIExecute) {+ return+ }+// Extract ID from path: /api/ai/approvals/{id}/approvepath := strings.TrimPrefix(r.URL.Path, "/api/ai/approvals/")path = strings.TrimSuffix(path, "/approve")diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.goindex dff5e47253..e62b08191b 100644--- a/internal/api/config_handlers.go+++ b/internal/api/config_handlers.go@@ -3400,6 +3400,11 @@ func (h *ConfigHandlers) HandleExportConfig(w http.ResponseWriter, r *http.Reque// Limit request body to 8KB to prevent memory exhaustionr.Body = http.MaxBytesReader(w, r.Body, 8*1024)+ // SECURITY: Validating scope for config export+ if !ensureScope(w, r, config.ScopeSettingsRead) {+ return+ }+var req ExportConfigRequestif err := json.NewDecoder(r.Body).Decode(&req); err != nil {log.Error().Err(err).Msg("Failed to decode export request")@@ -3442,6 +3447,11 @@ func (h *ConfigHandlers) HandleImportConfig(w http.ResponseWriter, r *http.Reque// Limit request body to 1MB to prevent memory exhaustion (config imports can be large)r.Body = http.MaxBytesReader(w, r.Body, 1024*1024)+ // SECURITY: Validating scope for config import+ if !ensureScope(w, r, config.ScopeSettingsWrite) {+ return+ }+var req ImportConfigRequestif err := json.NewDecoder(r.Body).Decode(&req); err != nil {log.Error().Err(err).Msg("Failed to decode import request")