Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

Prove production action runner credential lifecycle

Richard Courtmand9e9bf3679ab
diff --git a/docs/AGENT_SECURITY.md b/docs/AGENT_SECURITY.md
index f07a360072..bb61037f42 100644
--- a/docs/AGENT_SECURITY.md
+++ b/docs/AGENT_SECURITY.md
@@ -201,7 +201,7 @@ or generic command path.
| Proxmox node-local LXC filesystem telemetry | `proxmox.lxc_filesystems` through the no-network helper using fixed bounded `pct` operations | Implemented, unqualified on a representative PVE node. Helper failure omits/degrades this snapshot only | Does not yet justify Proxmox host-agent parity or a default change | `agent-lifecycle`: record live running/stopped LXC, mount, timeout, output-bound, and helper-loss behavior on supported PVE versions |
| Rootful Docker or Podman inventory | No direct collector access to a root-equivalent daemon socket | **Unavailable in the safe profile.** Migration disables the provider visibly. A closed helper `container.inventory` operation exists, but collector integration and live parity are not qualified | Rootful container parity is an explicit default blocker; the legacy/root profile is not safe-profile evidence | `agent-lifecycle`: either integrate and qualify bounded helper inventory or retain the explicit degradation permanently |
| Collector-owned rootless Docker or Podman | Direct access only to one usable runtime socket owned by the `pulse-agent` UID | Implemented, unqualified live. Ambiguous, root-owned, unreadable, unwritable, or unavailable sockets disable container monitoring | Does not yet justify container-runtime parity or a default change | `deployment-installability`: record fresh install, migration, restart, socket-loss, ambiguity, and telemetry parity on both rootless Docker and rootless Podman |
-| Separate runner package update and package-cache cleanup | Root-owned `pulse-agent-runner`, host-bound action credential, typed request, postcondition, and durable receipt | The schema-v4 committed-main systemd receipt records a real verified apt-cache mutation, stale-fingerprint refusal, replay, nonce-bound readiness, exact credential rotation, and self-revocation | Qualified only for those exercised fixture paths; the receipt does not prove the production Router/TLS/durable-persistence credential lifecycle, failed activation rollback, every runner operation, or an exact release candidate | `agent-lifecycle` and `api-contracts`: reproduce through the production Router over HTTPS from the RC, including failed activation/rollback and representative package-update success/failure/cancellation evidence |
+| Separate runner package update and package-cache cleanup | Root-owned `pulse-agent-runner`, host-bound action credential, typed request, postcondition, and durable receipt | The schema-v4 committed-main systemd receipt records a real verified apt-cache mutation, stale-fingerprint refusal, replay, nonce-bound readiness, exact credential rotation, and self-revocation. A separate production Router regression exercises HTTPS issuance, WSS admission, encrypted token persistence, failed-rotation rollback, exact socket invalidation, two server restarts, old-secret rejection, and durable self-revoke | Qualified for the exercised systemd fixture paths and focused production Router lifecycle. Neither proof covers local runner activation failure after credential preparation, every runner operation, or an exact release candidate | `agent-lifecycle` and `api-contracts`: reproduce the combined systemd and production Router path from the RC, including failed local activation/rollback and representative package-update success/failure/cancellation evidence |
| Separate runner Proxmox guest and container lifecycle/update actions | Root-owned runner with closed typed protocols; never the monitoring collector | Implemented, unqualified on representative PVE and container-runtime targets | No live-provider action-parity claim and no default change | `agent-lifecycle`: record target-bound success, stale-state refusal, cancellation, reconnect/replay, and independent postconditions on disposable real targets |
| Appliance, non-systemd, Windows, and macOS host-agent profiles | Platform API where sufficient; otherwise an explicitly named legacy/full-trust profile | **Unavailable for safe-profile apply.** The installer fails closed instead of silently installing a root-equivalent profile | Excluded from the Linux safe-profile claim | `deployment-installability`: land a platform-specific service, filesystem, update, helper, migration, rollback, and live-proof contract before marking that platform supported |
@@ -218,8 +218,10 @@ SHA-256 digests
`a48e855fdd2dcbc0cf91717dfaed22f942320c9661dd9b9e8f8f8e97f45d654b`.
This remains artifact-bound operator self-attestation, not an independently
authenticated external assessment or production Router/TLS/durable-store
-exercise. The existing v3 record remains historical. The safe profile
-therefore remains opt-in.
+exercise. A separate focused regression now covers the real Router's HTTPS,
+WSS, encrypted persistence, restart, rotation, exact session closure, and
+self-revoke lifecycle at code level. The existing v3 record remains historical.
+The safe profile therefore remains opt-in.
Monitoring never implies remediation. On the supported Linux systemd profile,
an operator may separately enroll the typed action runner:
diff --git a/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md b/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md
index 88e3a232d7..8476be819a 100644
--- a/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md
+++ b/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md
@@ -145,8 +145,15 @@ and
`internal/records/secure-agent-runtime-committed-main-attestation-v4-2026-08-30.json`.
This remains artifact-bound, secret-free, self-attested systemd fixture
evidence rather than an independently authenticated assessment or proof of the
-production Router/TLS/durable-store credential lifecycle. The repository still
-needs a fresh exact committed release-candidate run,
+production Router/TLS/durable-store credential lifecycle. The focused
+`TestActionRunnerRotationProductionRouterTLSPersistenceRestart` regression now
+exercises the real Router over HTTPS and WSS with encrypted token persistence:
+failed rotation persistence leaves the active secret and socket intact;
+replacement admission closes the exact predecessor socket; successful
+activation durably replaces its secret; restart rejects the predecessor; and
+self-revoke survives a second restart. That code-level transport proof is not
+part of the systemd receipt or an exact release-candidate exercise. The
+repository still needs a fresh exact committed release-candidate run,
representative Proxmox, SMART, Docker and rootless Podman telemetry/action
parity, appliance profiles, and the external security review. Until those
proofs are recorded, the safe profile remains opt-in and provider degradation
diff --git a/docs/release-control/v6/internal/records/secure-agent-runtime-qualification-foundation-2026-08-30.md b/docs/release-control/v6/internal/records/secure-agent-runtime-qualification-foundation-2026-08-30.md
index 35c31bdacc..99f184d05e 100644
--- a/docs/release-control/v6/internal/records/secure-agent-runtime-qualification-foundation-2026-08-30.md
+++ b/docs/release-control/v6/internal/records/secure-agent-runtime-qualification-foundation-2026-08-30.md
@@ -163,10 +163,18 @@ retroactively upgrade schema v3.
Focused regressions cover current code-level semantics. The schema-v4 guarded
systemd evidence covers only its exact qualified commit and explicitly
exercised fixture paths. It does not prove helper-backed update activation,
-watchdog or interrupted-recovery behavior, nor the production Router over TLS
-with durable credential persistence. It is not a substitute for exact
+watchdog or interrupted-recovery behavior, and its credential fixture is not
+the production Router. Separately,
+`TestActionRunnerRotationProductionRouterTLSPersistenceRestart` now proves the
+real Router's HTTPS/WSS credential lifecycle with encrypted durable
+persistence: failed rotation persistence preserves the active credential and
+session, replacement admission closes the exact predecessor socket, activation
+durably revokes the old secret, restart rejects it, and self-revoke remains
+effective after a second restart. That focused code-level transport proof is
+not embedded in this receipt and is not a substitute for exact
release-candidate reproduction, representative provider/appliance
-qualification, or external review. The canonical support and residual matrix is published in
+qualification, or external review. The canonical support and residual matrix
+is published in
`docs/AGENT_SECURITY.md`; unqualified rows remain explicit blockers rather than
being inferred from the generic Linux result.
diff --git a/frontend-modern/public/docs/AGENT_SECURITY.md b/frontend-modern/public/docs/AGENT_SECURITY.md
index f07a360072..bb61037f42 100644
--- a/frontend-modern/public/docs/AGENT_SECURITY.md
+++ b/frontend-modern/public/docs/AGENT_SECURITY.md
@@ -201,7 +201,7 @@ or generic command path.
| Proxmox node-local LXC filesystem telemetry | `proxmox.lxc_filesystems` through the no-network helper using fixed bounded `pct` operations | Implemented, unqualified on a representative PVE node. Helper failure omits/degrades this snapshot only | Does not yet justify Proxmox host-agent parity or a default change | `agent-lifecycle`: record live running/stopped LXC, mount, timeout, output-bound, and helper-loss behavior on supported PVE versions |
| Rootful Docker or Podman inventory | No direct collector access to a root-equivalent daemon socket | **Unavailable in the safe profile.** Migration disables the provider visibly. A closed helper `container.inventory` operation exists, but collector integration and live parity are not qualified | Rootful container parity is an explicit default blocker; the legacy/root profile is not safe-profile evidence | `agent-lifecycle`: either integrate and qualify bounded helper inventory or retain the explicit degradation permanently |
| Collector-owned rootless Docker or Podman | Direct access only to one usable runtime socket owned by the `pulse-agent` UID | Implemented, unqualified live. Ambiguous, root-owned, unreadable, unwritable, or unavailable sockets disable container monitoring | Does not yet justify container-runtime parity or a default change | `deployment-installability`: record fresh install, migration, restart, socket-loss, ambiguity, and telemetry parity on both rootless Docker and rootless Podman |
-| Separate runner package update and package-cache cleanup | Root-owned `pulse-agent-runner`, host-bound action credential, typed request, postcondition, and durable receipt | The schema-v4 committed-main systemd receipt records a real verified apt-cache mutation, stale-fingerprint refusal, replay, nonce-bound readiness, exact credential rotation, and self-revocation | Qualified only for those exercised fixture paths; the receipt does not prove the production Router/TLS/durable-persistence credential lifecycle, failed activation rollback, every runner operation, or an exact release candidate | `agent-lifecycle` and `api-contracts`: reproduce through the production Router over HTTPS from the RC, including failed activation/rollback and representative package-update success/failure/cancellation evidence |
+| Separate runner package update and package-cache cleanup | Root-owned `pulse-agent-runner`, host-bound action credential, typed request, postcondition, and durable receipt | The schema-v4 committed-main systemd receipt records a real verified apt-cache mutation, stale-fingerprint refusal, replay, nonce-bound readiness, exact credential rotation, and self-revocation. A separate production Router regression exercises HTTPS issuance, WSS admission, encrypted token persistence, failed-rotation rollback, exact socket invalidation, two server restarts, old-secret rejection, and durable self-revoke | Qualified for the exercised systemd fixture paths and focused production Router lifecycle. Neither proof covers local runner activation failure after credential preparation, every runner operation, or an exact release candidate | `agent-lifecycle` and `api-contracts`: reproduce the combined systemd and production Router path from the RC, including failed local activation/rollback and representative package-update success/failure/cancellation evidence |
| Separate runner Proxmox guest and container lifecycle/update actions | Root-owned runner with closed typed protocols; never the monitoring collector | Implemented, unqualified on representative PVE and container-runtime targets | No live-provider action-parity claim and no default change | `agent-lifecycle`: record target-bound success, stale-state refusal, cancellation, reconnect/replay, and independent postconditions on disposable real targets |
| Appliance, non-systemd, Windows, and macOS host-agent profiles | Platform API where sufficient; otherwise an explicitly named legacy/full-trust profile | **Unavailable for safe-profile apply.** The installer fails closed instead of silently installing a root-equivalent profile | Excluded from the Linux safe-profile claim | `deployment-installability`: land a platform-specific service, filesystem, update, helper, migration, rollback, and live-proof contract before marking that platform supported |
@@ -218,8 +218,10 @@ SHA-256 digests
`a48e855fdd2dcbc0cf91717dfaed22f942320c9661dd9b9e8f8f8e97f45d654b`.
This remains artifact-bound operator self-attestation, not an independently
authenticated external assessment or production Router/TLS/durable-store
-exercise. The existing v3 record remains historical. The safe profile
-therefore remains opt-in.
+exercise. A separate focused regression now covers the real Router's HTTPS,
+WSS, encrypted persistence, restart, rotation, exact session closure, and
+self-revoke lifecycle at code level. The existing v3 record remains historical.
+The safe profile therefore remains opt-in.
Monitoring never implies remediation. On the supported Linux systemd profile,
an operator may separately enroll the typed action runner:
diff --git a/internal/api/action_runner_credentials_test.go b/internal/api/action_runner_credentials_test.go
index 5dcaf641b3..8cef40e2d2 100644
--- a/internal/api/action_runner_credentials_test.go
+++ b/internal/api/action_runner_credentials_test.go
@@ -499,6 +499,31 @@ func TestActionRunnerRotationProductionRouterTLSPersistenceRestart(t *testing.T)
t.Fatalf("activation status = %d, body=%s", response.StatusCode, payload)
}
}
+ selfRevoke := func(server *httptest.Server, credential actionRunnerCredentialResponse) {
+ t.Helper()
+ body, _ := json.Marshal(actionRunnerCredentialSelfRevokeRequest{AgentID: credential.AgentID, Hostname: credential.Hostname})
+ req, _ := http.NewRequest(http.MethodDelete, server.URL+"/api/agents/action-runner/credential", bytes.NewReader(body))
+ req.Header.Set("Authorization", "Bearer "+credential.Token)
+ req.Header.Set("Content-Type", "application/json")
+ response, err := server.Client().Do(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer response.Body.Close()
+ if response.StatusCode != http.StatusNoContent {
+ payload, _ := io.ReadAll(response.Body)
+ t.Fatalf("self-revoke status = %d, body=%s", response.StatusCode, payload)
+ }
+ }
+ requireSocketClosed := func(conn *websocket.Conn, label string) {
+ t.Helper()
+ if err := conn.SetReadDeadline(time.Now().Add(2 * time.Second)); err != nil {
+ t.Fatalf("set %s socket deadline: %v", label, err)
+ }
+ if _, _, err := conn.ReadMessage(); err == nil {
+ t.Fatalf("%s socket remained readable after exact credential invalidation", label)
+ }
+ }
cfg := &config.Config{DataPath: dataPath, ConfigPath: dataPath, AuthUser: "admin", AuthPass: hashedPassword, AllowedOrigins: "*", EnvOverrides: map[string]bool{}}
router, monitor, server := newRuntime(cfg)
@@ -517,6 +542,44 @@ func TestActionRunnerRotationProductionRouterTLSPersistenceRestart(t *testing.T)
t.Fatal("first credential did not become active")
}
+ router.persistence.SetFileSystem(actionRunnerFailingPersistenceFS{})
+ failureBody, _ := json.Marshal(actionRunnerCredentialRequest{AgentID: hostID, Hostname: "host-1.local"})
+ failureRequest, _ := http.NewRequest(http.MethodPost, server.URL+"/api/agents/action-runner/credential", bytes.NewReader(failureBody))
+ failureRequest.SetBasicAuth("admin", "production-router-test-password")
+ failureRequest.Header.Set("Content-Type", "application/json")
+ failureResponse, err := server.Client().Do(failureRequest)
+ if err != nil {
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatal(err)
+ }
+ failurePayload, readErr := io.ReadAll(failureResponse.Body)
+ failureResponse.Body.Close()
+ if readErr != nil {
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatal(readErr)
+ }
+ if failureResponse.StatusCode != http.StatusInternalServerError || bytes.Contains(failurePayload, []byte(`"token"`)) {
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatalf("failed rotation response = status %d body %q", failureResponse.StatusCode, failurePayload)
+ }
+ persistedAfterFailure, err := config.NewConfigPersistence(dataPath).LoadAPITokens()
+ if err != nil {
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatal(err)
+ }
+ if len(cfg.APITokens) != 1 || cfg.APITokens[0].ID != first.TokenID ||
+ len(persistedAfterFailure) != 1 || persistedAfterFailure[0].ID != first.TokenID ||
+ !router.agentExecServer.IsAgentConnectedForOrganization("default", hostID) {
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatalf("failed HTTPS rotation changed durable credential or live session: %#v", persistedAfterFailure)
+ }
+ router.persistence = config.NewConfigPersistence(dataPath)
+
second := issue(server, hostID)
if _, ok := cfg.ValidateAPIToken(first.Token); !ok {
firstConn.Close()
@@ -530,6 +593,7 @@ func TestActionRunnerRotationProductionRouterTLSPersistenceRestart(t *testing.T)
shutdown(router, monitor, server)
t.Fatalf("prepared second registration = %#v", registered)
}
+ requireSocketClosed(firstConn, "superseded runner")
activate(server, second)
if _, ok := cfg.ValidateAPIToken(first.Token); ok {
secondConn.Close()
@@ -537,28 +601,55 @@ func TestActionRunnerRotationProductionRouterTLSPersistenceRestart(t *testing.T)
shutdown(router, monitor, server)
t.Fatal("activation retained first secret")
}
- secondConn.Close()
- firstConn.Close()
- shutdown(router, monitor, server)
-
persisted, err := config.NewConfigPersistence(dataPath).LoadAPITokens()
if err != nil {
+ secondConn.Close()
+ firstConn.Close()
+ shutdown(router, monitor, server)
t.Fatal(err)
}
if len(persisted) != 1 || persisted[0].ID != second.TokenID || persisted[0].ExpiresAt != nil {
- t.Fatalf("persisted activated inventory = %#v", persisted)
+ secondConn.Close()
+ firstConn.Close()
+ shutdown(router, monitor, server)
+ t.Fatalf("durably committed rotation inventory = %#v", persisted)
}
+ secondConn.Close()
+ shutdown(router, monitor, server)
+
restartedConfig := &config.Config{DataPath: dataPath, ConfigPath: dataPath, AuthUser: "admin", AuthPass: hashedPassword, AllowedOrigins: "*", EnvOverrides: map[string]bool{}, APITokens: persisted}
restartedRouter, restartedMonitor, restartedServer := newRuntime(restartedConfig)
- defer shutdown(restartedRouter, restartedMonitor, restartedServer)
oldConn, oldRegistration := dial(restartedServer, first)
oldConn.Close()
if oldRegistration.Success {
t.Fatal("durably revoked predecessor registered after server restart")
}
newConn, newRegistration := dial(restartedServer, second)
- defer newConn.Close()
if !newRegistration.Success || !restartedRouter.agentExecServer.IsAgentConnectedForOrganization("default", hostID) {
+ newConn.Close()
+ shutdown(restartedRouter, restartedMonitor, restartedServer)
t.Fatalf("durably activated replacement after restart = %#v", newRegistration)
}
+
+ selfRevoke(restartedServer, second)
+ requireSocketClosed(newConn, "self-revoked runner")
+ persisted, err = config.NewConfigPersistence(dataPath).LoadAPITokens()
+ if err != nil {
+ shutdown(restartedRouter, restartedMonitor, restartedServer)
+ t.Fatal(err)
+ }
+ if len(persisted) != 0 {
+ shutdown(restartedRouter, restartedMonitor, restartedServer)
+ t.Fatalf("self-revoked credential remained durable: %#v", persisted)
+ }
+ shutdown(restartedRouter, restartedMonitor, restartedServer)
+
+ finalConfig := &config.Config{DataPath: dataPath, ConfigPath: dataPath, AuthUser: "admin", AuthPass: hashedPassword, AllowedOrigins: "*", EnvOverrides: map[string]bool{}, APITokens: persisted}
+ finalRouter, finalMonitor, finalServer := newRuntime(finalConfig)
+ defer shutdown(finalRouter, finalMonitor, finalServer)
+ revokedConn, revokedRegistration := dial(finalServer, second)
+ revokedConn.Close()
+ if revokedRegistration.Success {
+ t.Fatal("durably self-revoked replacement registered after second server restart")
+ }
}