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
Teach route checks and contracts about RequireOrgAdmin
rcourtman78301b91ed21
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 33fec096ad..dfa66ebc1b 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -4430,6 +4430,12 @@ install tokens it generates stay bound to that organization; nothing about tokenscope, agent registration or reporting identity changes. See the api-contractscontract, rule 35, for the capability rule.+Since 17 October 2026 these agent routes (install command, setup script URL,+agent link, unlink, uninstall, configuration, Docker and Kubernetes management,+agent profiles and fleet diagnostics) declare that authority explicitly with+`RequireOrgAdmin`. `RequireAdmin` now admits instance administrators only, so+an agent route that does not opt in is closed to organization owners.+### Auto-register preserves the operator's stored TLS choiceRe-registering an existing Proxmox node through the canonical auto-registerdiff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.mdindex be8c8c3e86..5007376842 100644--- a/docs/release-control/v6/internal/subsystems/security-privacy.md+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md@@ -467,7 +467,7 @@ administrator or settings-scope checks, expose queue contents to new callers, orchange tenant selection. Missing owners fail with 503 rather than dereferencingnil.-The authenticated security-status currentUsername is the validated caller principal, not an administrator configuration disclosure. Public responses omit it. An organisation-scoped local session may receive its own identity while authUsername and instance-settings capabilities remain withheld; clients must not interpret identity availability as privilege. A manager of that organisation additionally receives the org-bound infrastructureRead, availabilityRead and reportingRead capabilities, because their routes already admit org managers through ensureAdminSession and read only that organisation's state; this never extends to authentication, SSO, users, roles, audit, relay, system, diagnostics or billing surfaces.+The authenticated security-status currentUsername is the validated caller principal, not an administrator configuration disclosure. Public responses omit it. An organisation-scoped local session may receive its own identity while authUsername and instance-settings capabilities remain withheld; clients must not interpret identity availability as privilege. A manager of that organisation additionally receives the org-bound infrastructureRead and availabilityRead capabilities, because their routes admit org managers through RequireOrgAdmin / ensureOrgAdminSession and read only that organisation's state; this never extends to reporting, authentication, SSO, API tokens, users, roles, audit, relay, system, updates, logs, diagnostics or billing surfaces, whose routes use ensureAdminSession and admit instance administrators only.API token scope copy must match runtime authority. `ai:chat` covers Assistantconversation, model selection, sessions, and knowledge reads only. Knowledge@@ -3360,3 +3360,18 @@ request context. This synchronizes publication without changing authentication,authorization, tenant selection or disclosure. The concurrent initializationregression in `internal/api/contract_test.go` and the existing`TestMultiTenant_TenantIsolation` race test verify that boundary.++### Instance administration refuses organization owners (17 October 2026)++`ensureAdminSession`, the session check behind `RequireAdmin` and the settings+scope helpers, admits only instance administrators: the configured admin or an+instance RBAC admin grant, whichever organization the request names. It used+to admit any manager of the request's organization, which on a multi-tenant+install let an organization owner rotate the instance administrator's API+token and receive its secret, widen token scopes, change SSO providers and+system settings, apply updates and restart the service. Routes that act only on+the request organization opt in through `RequireOrgAdmin`,+`ensureOrgAdminSession` or `ensureOrgSettingsWriteScope`; every other route fails+closed. `internal/api/org_admin_session_authority_test.go` holds the session+matrix and `TestSettingsWriteScopeSplitsInstanceAndOrgManagerSession` the+settings scope split.diff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex df121982a5..2142b3c46d 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -22514,8 +22514,8 @@ func TestContract_AgentFleetDiagnosticsEndpointSurfacesStableShape(t *testing.T)routerSrc := string(router)if !strings.Contains(routerSrc, `"/api/agents/diagnostics"`) ||- !strings.Contains(routerSrc, `RequireAdmin(r.config, RequireScope(config.ScopeSettingsRead, r.handleAgentFleetDiagnostics))`) {- t.Error("agent fleet diagnostics route must remain admin settings:read only")+ !strings.Contains(routerSrc, `RequireOrgAdmin(r.config, RequireScope(config.ScopeSettingsRead, r.handleAgentFleetDiagnostics))`) {+ t.Error("agent fleet diagnostics route must remain org admin settings:read only")}if !strings.Contains(handlerSrc, "GetAgentFleetDiagnosticsForTarget(serverVersion, agentUpdateTargetVersion, now)") ||!strings.Contains(handlerSrc, "applyAgentFleetActionRunnerState(&diagnostics") {diff --git a/internal/api/route_inventory_test.go b/internal/api/route_inventory_test.goindex 5e68ce00f0..7ef02f4ccb 100644--- a/internal/api/route_inventory_test.go+++ b/internal/api/route_inventory_test.go@@ -251,7 +251,7 @@ func isProtectedHandler(expr ast.Expr) bool {func isAuthWrapper(name string) bool {switch name {- case "RequireAuth", "RequireAdmin", "RequirePermission", "RequireOrgOwnerOrPlatformAdmin", "RequirePlatformAdmin":+ case "RequireAuth", "RequireAdmin", "RequireOrgAdmin", "RequirePermission", "RequireOrgOwnerOrPlatformAdmin", "RequirePlatformAdmin":return truedefault:return falsediff --git a/scripts/tests/test_api_reference_routes.py b/scripts/tests/test_api_reference_routes.pyindex 34a80ebf8c..e838f38bf3 100644--- a/scripts/tests/test_api_reference_routes.py+++ b/scripts/tests/test_api_reference_routes.py@@ -78,7 +78,7 @@ ROUTE_ANCHORS = [# Every profile route is wrapped once, for all methods, including GET.("Token callers also need `settings:write` on every profile route, including GET requests","internal/api/router_routes_registration.go",- 'r.mux.Handle("/api/admin/profiles/", RequireAdmin(r.config, RequireScope(config.ScopeSettingsWrite,'),+ 'r.mux.Handle("/api/admin/profiles/", RequireOrgAdmin(r.config, RequireScope(config.ScopeSettingsWrite,'),# Everything other than GET or HEAD on the /api/resources/ prefix needs the write scope.("`POST /api/resources/{id}/link` (`monitoring:write`)","internal/api/router_routes_monitoring.go",@@ -95,7 +95,7 @@ ROUTE_ANCHORS = ["!tokenHasInstanceWideAuthority(callerToken)"),("`POST /api/agents/agent/uninstall` (`agent:report` token, or an admin session)","internal/api/router_routes_registration.go",- "RequireAdmin(r.config, RequireScope(config.ScopeAgentReport, r.unifiedAgentHandlers.HandleUninstall))"),+ "RequireOrgAdmin(r.config, RequireScope(config.ScopeAgentReport, r.unifiedAgentHandlers.HandleUninstall))"),("API-token callers also need the `ai:execute` scope for AI narration.","internal/api/metrics_reporting_handlers.go","if !reportCallerMayUseAI(ctx) {\n\t\treturn nil, nil, h.resolveExistingFindings(ctx)"),