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.

Wait for stable rootless recovery evidence

rcourtman19f264701e79
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 259bb5860c..b928b83097 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -7341,6 +7341,9 @@ ambiguity refusal, authority isolation, and cleanup are recorded.
Receipt output uses a dedicated root-owned, mode-`0700` `/opt/pulse/result`
boundary instead of volatile `/run` state, so systemd user-manager teardown
cannot erase a passing result before the wrapper retains it.
+Recovery qualification must wait for the complete stable telemetry digest,
+including stats and secondary inventory, rather than accepting an earlier
+semantic-only report and racing the evidence assertion.
The wrapper must compile every Go artifact with mandatory VCS stamping so a
missing revision or unavailable clean-worktree proof fails before live evidence
can be emitted; the receipt and validator retain the exact artifact hashes and
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index c2643425b1..bac5d2f9af 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -265,6 +265,8 @@ wrapper injects artifacts into each stopped disposable container. The image
must also pre-create the separate root-owned, mode-`0700` `/opt/pulse/result`
output boundary; receipts are written there instead of volatile `/run` state so
systemd user-manager cleanup cannot erase completed qualification evidence.
+Direct recovery is complete only after the full stable telemetry digest is
+observed; the first semantic-only report cannot satisfy the qualification wait.
Rootless Docker uses its supported `slirp4netns` driver inside the outer
`--network none` container only; an unsupported `host` RootlessKit driver or
an outer default route invalidates the proof. The disposable host uses a
diff --git a/scripts/installtests/secure_runtime_rootless_qualification_test.go b/scripts/installtests/secure_runtime_rootless_qualification_test.go
index 157684de75..4003d7e9bd 100644
--- a/scripts/installtests/secure_runtime_rootless_qualification_test.go
+++ b/scripts/installtests/secure_runtime_rootless_qualification_test.go
@@ -307,7 +307,7 @@ func TestSecureRuntimeRootlessQualification(t *testing.T) {
recoveryStarted := time.Now().UTC()
rootlessQualStartRootless(t, daemon)
- recoveryReport := rootlessQualWaitDirect(t, fixture, recoveryStarted, runtimeKind, rootlessBaseline.SemanticDigest, 90*time.Second)
+ recoveryReport := rootlessQualWaitStableDirect(t, fixture, recoveryStarted, runtimeKind, rootlessBaseline.SemanticDigest, daemonRestartDigest, 90*time.Second)
recoveryDigest := rootlessQualDigestReport(recoveryReport.Report)
daemonRootlessAfterRecovery := rootlessQualDaemonRootless(t, daemon)
if !rootlessQualStableDigestEqual(recoveryDigest, daemonRestartDigest) || secureRuntimeCollectorMainPID(t) != collectorPIDAfter || rootlessQualDaemonID(t, daemon, true) != daemonIDBefore {
@@ -356,7 +356,7 @@ func TestSecureRuntimeRootlessQualification(t *testing.T) {
return ok && stream != previousUpdateStream && rootlessQualComplete(report) && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary && report.Host.Runtime == runtimeKind
})
rootlessQualStartRootless(t, daemon)
- pinReport := rootlessQualWaitDirect(t, fixture, postUpdateFallback.ReceivedAt, runtimeKind, rootlessBaseline.SemanticDigest, 90*time.Second)
+ pinReport := rootlessQualWaitStableDirect(t, fixture, postUpdateFallback.ReceivedAt, runtimeKind, rootlessBaseline.SemanticDigest, recoveryDigest, 90*time.Second)
pinDigest := rootlessQualDigestReport(pinReport.Report)
daemonRootlessAfterPinRecovery := rootlessQualDaemonRootless(t, daemon)
if !rootlessQualStableDigestEqual(pinDigest, recoveryDigest) || rootlessQualServicePin(t, runtimeKind) != daemon.rootlessSock {
@@ -725,11 +725,23 @@ func rootlessQualBaselineFromPSOutput(out string) rootlessQualBaseline {
func rootlessQualWaitDirect(t *testing.T, fixture *secureRuntimeLabFixture, after time.Time, runtimeKind, semanticDigest string, timeout time.Duration) secureRuntimeDockerReport {
t.Helper()
return rootlessQualWaitReport(t, fixture, after, timeout, func(report agentsdocker.Report) bool {
- return rootlessQualComplete(report) && report.Host.CollectionMode != agentsdocker.CollectionModeTypedHelperSummary &&
- report.Host.Runtime == runtimeKind && len(report.Containers) == 2 && rootlessQualSemanticDigest(report) == semanticDigest
+ return rootlessQualDirectReportMatches(report, runtimeKind, semanticDigest)
})
}
+func rootlessQualWaitStableDirect(t *testing.T, fixture *secureRuntimeLabFixture, after time.Time, runtimeKind, semanticDigest string, stableDigest rootlessQualReportDigest, timeout time.Duration) secureRuntimeDockerReport {
+ t.Helper()
+ return rootlessQualWaitReport(t, fixture, after, timeout, func(report agentsdocker.Report) bool {
+ return rootlessQualDirectReportMatches(report, runtimeKind, semanticDigest) &&
+ rootlessQualStableDigestEqual(rootlessQualDigestReport(report), stableDigest)
+ })
+}
+
+func rootlessQualDirectReportMatches(report agentsdocker.Report, runtimeKind, semanticDigest string) bool {
+ return rootlessQualComplete(report) && report.Host.CollectionMode != agentsdocker.CollectionModeTypedHelperSummary &&
+ report.Host.Runtime == runtimeKind && len(report.Containers) == 2 && rootlessQualSemanticDigest(report) == semanticDigest
+}
+
func rootlessQualWaitReport(t *testing.T, fixture *secureRuntimeLabFixture, after time.Time, timeout time.Duration, predicate func(agentsdocker.Report) bool) secureRuntimeDockerReport {
t.Helper()
deadline := time.Now().Add(timeout)
@@ -1418,6 +1430,38 @@ func TestRootlessQualificationBaselineUsesReportSemanticShape(t *testing.T) {
}
}
+func TestRootlessQualificationStableDirectMatchWaitsForFullTelemetry(t *testing.T) {
+ now := time.Now().UTC()
+ oomKilled := false
+ complete := true
+ full := agentsdocker.Report{
+ Host: agentsdocker.HostInfo{Runtime: "docker"},
+ InventoryComplete: &complete,
+ Containers: []agentsdocker.Container{
+ {Name: "pulse-rootless-running", Image: rootlessQualFixture, State: "running", Status: "Up", CreatedAt: now, StartedAt: &now, OOMKilled: &oomKilled, MemoryLimitBytes: 1024},
+ {Name: "pulse-rootless-exited", Image: rootlessQualFixture, State: "exited", Status: "Exited", CreatedAt: now, FinishedAt: &now, OOMKilled: &oomKilled},
+ },
+ Images: []agentsdocker.Image{{RepoTags: []string{rootlessQualFixture}}},
+ Networks: []agentsdocker.Network{{Name: "bridge"}},
+ }
+ semanticDigest := rootlessQualSemanticDigest(full)
+ stableDigest := rootlessQualDigestReport(full)
+ semanticOnly := full
+ semanticOnly.Containers = slices.Clone(full.Containers)
+ semanticOnly.Containers[0].MemoryLimitBytes = 0
+ semanticOnly.Images = nil
+ semanticOnly.Networks = nil
+ if !rootlessQualDirectReportMatches(semanticOnly, "docker", semanticDigest) {
+ t.Fatal("semantic-only direct report no longer matches the base recovery condition")
+ }
+ if rootlessQualStableDigestEqual(rootlessQualDigestReport(semanticOnly), stableDigest) {
+ t.Fatal("semantic-only direct report satisfied evidence-grade telemetry parity")
+ }
+ if !rootlessQualStableDigestEqual(rootlessQualDigestReport(full), stableDigest) {
+ t.Fatal("full direct report did not satisfy evidence-grade telemetry parity")
+ }
+}
+
func TestRootlessQualificationStopAcceptsCollectedTransientUnit(t *testing.T) {
tempDir := t.TempDir()
logPath := filepath.Join(tempDir, "systemctl.log")