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.

Add rootful Docker secure-runtime qualification

rcourtman5754d924d737
diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index 8c9c8eac79..b00dc58784 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -1975,7 +1975,7 @@ jobs:
dispatch="$(
jq -n \
--arg tag "${TAG}" \
- '{ref: "main", return_run_details: true, inputs: {tag: $tag}}' | \
+ '{ref: $tag, return_run_details: true, inputs: {tag: $tag}}' | \
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
diff --git a/.github/workflows/qualify-secure-runtime-release.yml b/.github/workflows/qualify-secure-runtime-release.yml
index 6c2305a729..93d348edcf 100644
--- a/.github/workflows/qualify-secure-runtime-release.yml
+++ b/.github/workflows/qualify-secure-runtime-release.yml
@@ -16,7 +16,7 @@ jobs:
qualify-secure-runtime-release:
name: Qualify Immutable RC on Disposable systemd
runs-on: ubuntu-24.04
- timeout-minutes: 35
+ timeout-minutes: 45
steps:
- name: Resolve immutable RC identity
id: release
@@ -62,6 +62,8 @@ jobs:
set -euo pipefail
git fetch --no-tags origin refs/heads/main:refs/remotes/origin/main
commit="$(git rev-parse "${TAG}^{commit}")"
+ test "${GITHUB_REF}" = "refs/tags/${TAG}"
+ test "${GITHUB_SHA}" = "${commit}"
test "$(git branch --show-current)" = ""
test -z "$(git status --short --untracked-files=all)"
git merge-base --is-ancestor "${commit}" origin/main
@@ -121,7 +123,7 @@ jobs:
go run ./scripts/release_update_key.go fingerprint \
--public-key "${PULSE_UPDATE_SIGNING_PUBLIC_KEY}"
)"
- python3 scripts/release_control/secure_runtime_attestation_v6.py \
+ python3 scripts/release_control/secure_runtime_attestation_v7.py \
--verify-release-packet-only \
--checkout "${GITHUB_WORKSPACE}" \
--commit "${QUALIFIED_COMMIT}" \
@@ -155,28 +157,52 @@ jobs:
go test -c \
-o "$RUNNER_TEMP/secure-runtime-harness/installtests-linux-amd64.test" \
./scripts/installtests
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
+ go build -trimpath \
+ -o "$RUNNER_TEMP/secure-runtime-harness/docker-fixture-linux-amd64" \
+ ./scripts/installtests/testdata/secure_runtime_docker_fixture.go
- name: Build disposable systemd host image
run: |
set -euo pipefail
context="$RUNNER_TEMP/secure-runtime-systemd-image"
- mkdir -p "${context}/empty"
+ mkdir -p "${context}"
+ tee "${context}/pulse-qualification-docker.service" >/dev/null <<'UNIT'
+ [Unit]
+ Description=Pulse secure-runtime qualification Docker daemon
+ After=network.target
+
+ [Service]
+ Type=notify
+ ExecStart=/usr/local/bin/dockerd --host=unix:///var/run/docker.sock --group=root --data-root=/var/lib/pulse-qualification-docker --exec-root=/run/pulse-qualification-docker --pidfile=/run/pulse-qualification-docker.pid --storage-driver=vfs --bridge=none --iptables=false --ip6tables=false --ip-forward=false --ip-masq=false --userland-proxy=false
+ ExecStartPost=/bin/chown root:root /var/run/docker.sock
+ ExecStartPost=/bin/chmod 0660 /var/run/docker.sock
+ Restart=on-failure
+ RestartSec=1
+
+ [Install]
+ WantedBy=multi-user.target
+ UNIT
tee "${context}/Dockerfile" >/dev/null <<'DOCKERFILE'
+ FROM docker:27.5.1-dind@sha256:f649ef046008ca7f926a2571c32b0ac22e5c59eb61b959617f9acc2a4c638cf5 AS dind
FROM ubuntu:24.04@sha256:33ceb71981b602c1a7443a53469e4dba065f7503eab3078a2d7a57a2ab987517
ENV container=docker
+ COPY --from=dind /usr/local/bin/ /usr/local/bin/
+ COPY pulse-qualification-docker.service /etc/systemd/system/pulse-qualification-docker.service
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates curl dbus systemd systemd-sysv util-linux && \
apt-get clean && \
- systemctl mask dev-hugepages.mount sys-fs-fuse-connections.mount systemd-remount-fs.service
+ systemctl mask dev-hugepages.mount sys-fs-fuse-connections.mount systemd-remount-fs.service docker.service docker.socket && \
+ systemctl enable pulse-qualification-docker.service
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
DOCKERFILE
docker build \
--tag pulse-secure-runtime-systemd:ubuntu-24.04 \
--file "${context}/Dockerfile" \
- "${context}/empty"
+ "${context}"
- - name: Run schema-v6 systemd qualification
+ - name: Run schema-v7 systemd and rootful Docker qualification
id: lab
env:
TAG: ${{ steps.release.outputs.tag }}
@@ -188,6 +214,7 @@ jobs:
--detach \
--name "${container}" \
--privileged \
+ --network none \
--cgroupns=host \
--tmpfs /run \
--tmpfs /run/lock \
@@ -208,7 +235,35 @@ jobs:
sleep 2
done
docker exec "${container}" sh -c \
- 'for command in curl id nsenter runuser systemctl; do command -v "$command" >/dev/null || exit 1; done'
+ 'for command in curl docker dockerd id nsenter runuser systemctl; do command -v "$command" >/dev/null || exit 1; done'
+ docker exec "${container}" systemctl start pulse-qualification-docker.service
+ for attempt in $(seq 1 60); do
+ if docker exec "${container}" docker info >/dev/null 2>&1; then
+ break
+ fi
+ if [[ "${attempt}" == 60 ]]; then
+ docker exec "${container}" systemctl status pulse-qualification-docker.service --no-pager || true
+ docker logs "${container}"
+ exit 1
+ fi
+ sleep 1
+ done
+ docker exec "${container}" sh -ceu '
+ test -S /var/run/docker.sock
+ test "$(stat -c %U:%G:%a /var/run/docker.sock)" = "root:root:660"
+ daemon_pid="$(systemctl show pulse-qualification-docker.service --property MainPID --value)"
+ test "${daemon_pid}" -gt 0
+ case "$(tr "\000" " " < "/proc/${daemon_pid}/cmdline")" in *tcp://*) exit 1;; esac
+ rootfs="$(mktemp -d)"
+ cp /harness/docker-fixture-linux-amd64 "${rootfs}/fixture"
+ chmod 0555 "${rootfs}/fixture"
+ tar -C "${rootfs}" -cf /tmp/pulse-secure-runtime-rootfs.tar .
+ docker import --change '\''ENTRYPOINT ["/fixture"]'\'' /tmp/pulse-secure-runtime-rootfs.tar pulse-secure-runtime-fixture:v7 >/dev/null
+ docker run --detach --name pulse-v7-running --network none pulse-secure-runtime-fixture:v7 >/dev/null
+ docker run --name pulse-v7-exited --network none pulse-secure-runtime-fixture:v7 --exit >/dev/null
+ test "$(docker inspect --format "{{.State.Status}}" pulse-v7-running)" = "running"
+ test "$(docker inspect --format "{{.State.Status}}" pulse-v7-exited)" = "exited"
+ '
docker exec "${container}" sh -c \
'printf "%s\n" "PULSE_SECURE_RUNTIME_SYSTEMD_LAB=disposable-v1" > /etc/pulse-secure-runtime-lab'
start_epoch="$(date +%s)"
@@ -225,11 +280,11 @@ jobs:
--env PULSE_SECURE_RUNTIME_HELPER=/release/pulse-agent-helper-linux-amd64 \
--env PULSE_SECURE_RUNTIME_RUNNER=/release/pulse-agent-runner-linux-amd64 \
--env PULSE_SECURE_RUNTIME_RECEIPT=/evidence/receipt.json \
- --env "PULSE_SECURE_RUNTIME_RECEIPT_RECORD_PATH=docs/release-control/v6/internal/records/secure-agent-runtime-systemd-receipt-v6-${TAG}.json" \
+ --env "PULSE_SECURE_RUNTIME_RECEIPT_RECORD_PATH=docs/release-control/v6/internal/records/secure-agent-runtime-systemd-receipt-v7-${TAG}.json" \
--env PULSE_SECURE_RUNTIME_TRANSCRIPT=/evidence/transcript.jsonl \
- --env "PULSE_SECURE_RUNTIME_TRANSCRIPT_RECORD_PATH=docs/release-control/v6/internal/records/secure-agent-runtime-systemd-transcript-v6-${TAG}.jsonl" \
+ --env "PULSE_SECURE_RUNTIME_TRANSCRIPT_RECORD_PATH=docs/release-control/v6/internal/records/secure-agent-runtime-systemd-transcript-v7-${TAG}.jsonl" \
"${container}" \
- sh -c 'cd /workspace/scripts/installtests && exec /harness/installtests-linux-amd64.test -test.run "^TestSecureRuntimeSystemdLab$" -test.count=1 -test.v'
+ sh -c 'cd /workspace/scripts/installtests && exec /harness/installtests-linux-amd64.test -test.run "^TestSecureRuntimeSystemdDockerV7Lab$" -test.count=1 -test.v'
elapsed="$(( $(date +%s) - start_epoch ))"
if [[ "${elapsed}" -lt 1 ]]; then elapsed=1; fi
echo "elapsed_seconds=${elapsed}" >> "$GITHUB_OUTPUT"
@@ -250,12 +305,12 @@ jobs:
go run ./scripts/release_update_key.go fingerprint \
--public-key "${PULSE_UPDATE_SIGNING_PUBLIC_KEY}"
)"
- python3 scripts/release_control/secure_runtime_attestation_v6.py \
+ python3 scripts/release_control/secure_runtime_attestation_v7.py \
--checkout "${GITHUB_WORKSPACE}" \
--commit "${QUALIFIED_COMMIT}" \
--main-ref origin/main \
--receipt "${evidence_dir}/receipt.json" \
- --receipt-record-path "docs/release-control/v6/internal/records/secure-agent-runtime-systemd-receipt-v6-${TAG}.json" \
+ --receipt-record-path "docs/release-control/v6/internal/records/secure-agent-runtime-systemd-receipt-v7-${TAG}.json" \
--transcript "${evidence_dir}/transcript.jsonl" \
--collector-v1 "${release_dir}/pulse-secure-runtime-collector-v1-linux-amd64" \
--collector-v2 "${release_dir}/pulse-secure-runtime-collector-v2-linux-amd64" \
diff --git a/.gitignore b/.gitignore
index 79d2efab0e..7bcbe1398a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -267,7 +267,10 @@ scripts/release_control/*
!scripts/release_control/secure_runtime_attestation_test.py
!scripts/release_control/secure_runtime_attestation_v6.py
!scripts/release_control/secure_runtime_attestation_v6_test.py
+!scripts/release_control/secure_runtime_attestation_v7.py
+!scripts/release_control/secure_runtime_attestation_v7_test.py
!scripts/release_control/secure_runtime_source_manifest_v6.json
+!scripts/release_control/secure_runtime_source_manifest_v7.json
!scripts/release_control/staged_commit_shape_guard.py
!scripts/release_control/staged_commit_shape_guard_test.py
!scripts/release_control/internal/
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 ee8a1ea2a4..bb3eec5191 100644
--- a/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md
+++ b/docs/release-control/v6/internal/AGENT_PRIVILEGE_BOUNDARY_PLAN.md
@@ -169,6 +169,19 @@ plus the host-canary helper-network-namespace exercise, and binds those claims t
`secure_runtime_source_manifest_v6.json`. It does not reinterpret schema-v4 or
schema-v5 evidence.
+Schema v7 is a separate twenty-three-scenario contract and leaves every prior
+receipt schema immutable. It adds live rootful Docker summary-inventory
+migration, helper restart continuity, and helper-loss/recovery scenarios. The
+release workflow creates its daemon inside the disposable systemd host, seeds
+an offline source-bound fixture image, exposes only the root-owned Unix socket,
+and never mounts the hosted runner's Docker socket. V7 narrows only the
+rootful-Docker summary-inventory residual; Podman, rootless-runtime parity,
+container metrics, image-update checks, typed container actions, appliance
+coverage, and external review remain open. No schema-v7 receipt exists until
+an exact immutable prerelease packet successfully completes that workflow, so
+this contract does not change the product default or upgrade the current v6
+evidence classification.
+
A fresh Ubuntu 24.04.4/systemd 255 arm64 run at committed main
`22fd662fb794f63efb9d3ca2158de73c4e07e1b8` passed all twenty schema-v6
scenarios in 248.13 seconds. The 437-source manifest matched the qualified
@@ -193,7 +206,7 @@ and transcript. It remains self-attested fixture evidence rather than trusted
RC compilation provenance or an external review, and it makes no default
change.
-Schema-v6 release-candidate classification does not trust a local ref or Go
+Schema-v6 and schema-v7 release-candidate classification does not trust a local ref or Go
VCS stamp. Pulse release tags are workflow-created annotated tags rather than
signed tags, so tag presence alone is not authority. RC classification
requires the exact canonical remote tag object and peeled commit, the immutable
@@ -212,7 +225,7 @@ builds and attests the six Linux amd64 subjects without signing secrets. Hosted
candidate assembly requires its current collector, helper, and runner to match
the ordinary release payload byte for byte, then publishes the three predecessor
collectors, compiler provenance, and build contract through the normal signed
-release packet. A published prerelease automatically runs the twenty-scenario
+release packet. A published prerelease automatically runs the twenty-three-scenario schema-v7
lab on a disposable systemd host. Before any candidate byte can reach that
privileged container, the workflow copies all six binaries, four collector
signatures, checksum and provenance sidecars, and the build contract into a
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 2713271dfa..469fbb7981 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -95,6 +95,15 @@ an omitted privileged read into an authoritative empty inventory. The next
complete helper report replaces inventory and clears only the recovered helper
operation. Incomplete status reports are current-state evidence and are not
buffered for later replay after recovery.
+
+The schema-v7 release qualification contract exercises this Docker boundary on
+a live nested rootful daemon. It correlates a non-empty legacy inventory with
+the summary-only typed-helper inventory, proves the collector loses direct
+socket authority, replaces the helper process without changing the canonical
+summary, and observes incomplete/degraded then complete/running reports across
+forced helper loss and recovery. This is a bounded Docker summary-inventory
+claim only; it grants no qualification to unsupported metrics, update checks,
+container actions, Podman, rootless runtimes, or appliance-specific behavior.
An absent Proxmox inventory is a failure only when Proxmox mode is configured
or the unprivileged collector can discover the local `pct` binary. Ordinary
Linux hosts without that provider remain healthy rather than reporting a
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 4665f171b9..a907eae9a6 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -255,11 +255,19 @@ contract through the normal SBOM, checksum, Ed25519, SSH-signature, immutable
manifest, and assembly-provenance path. The update signing private key remains
absent from compilation and is used only by hosted candidate assembly.
Published prerelease packets automatically enter the separate disposable
-Ubuntu/systemd qualification workflow. That workflow consumes the immutable
-release assets and four release signatures, runs the canonical twenty-scenario
-schema-v6 lab, and applies the release-candidate attester against the exact
+Ubuntu/systemd qualification workflow. The release workflow dispatches that
+qualification from the exact annotated RC tag, and the child fails unless its
+workflow execution ref and SHA equal the peeled tag commit. That workflow consumes the immutable
+release assets and four release signatures, runs the canonical twenty-three-scenario
+schema-v7 lab, and applies the release-candidate attester against the exact
GitHub release ID, tag, source commit, checksums, compiler provenance, assembly
-provenance, and update-key fingerprint. Its retained receipt remains explicit
+provenance, and update-key fingerprint. The v7 host starts a rootful Docker
+daemon inside the disposable systemd container without mounting the hosted
+runner socket or exposing a TCP listener. It imports an offline, source-bound
+fixture image and proves legacy inventory, summary-only typed-helper parity,
+helper restart continuity, degraded status-only reporting during helper loss,
+and complete recovery while the collector remains unable to open the rootful
+socket. Its retained receipt remains explicit
self-attestation rather than external security review, and successful packet
production or execution does not change the safe profile from opt-in.
This packaging proof does not establish live platform qualification: helper
@@ -416,6 +424,9 @@ release-latency optimization.
65. `scripts/release_control/validate_artifact_release_line.py`
65a. `scripts/release_control/secure_runtime_attestation_v6.py`
65b. `scripts/release_control/secure_runtime_source_manifest_v6.json`
+65c. `scripts/release_control/secure_runtime_attestation_v7.py`
+65d. `scripts/release_control/secure_runtime_source_manifest_v7.json`
+65e. `scripts/installtests/testdata/secure_runtime_docker_fixture.go`
66. `scripts/release_ldflags.sh`
66a. `scripts/release_update_key.go`
67. `scripts/run_cloud_public_signup_smoke.sh`
@@ -787,7 +798,7 @@ artifact-selection behaviour.
## Extension Points
1. Add or change deployment-type detection, update planning, or apply behavior through `internal/updates/`
-2. Add or change release-build metadata injection, Docker build-context allowlists, release artifact assembly, hosted secure-runtime qualification compilation and attestation, governed promotion metadata resolution, artifact release-line validation, post-install live-runtime claim proof, the canonical version file, operator-facing release packet content, model-selected visual release-note capture, prerelease feedback intake wording, historical published-release integrity backfill, release asset validation status publication, download endpoint checksum/signature header proof, end-to-end install.sh smoke against staged or published release assets, or the canonical in-repo v6 upgrade guide through `scripts/build-release.sh`, `scripts/build-release-binaries.sh`, `scripts/build-secure-runtime-qualification.sh`, `scripts/release_build_targets.sh`, `scripts/run-release-backend-tests.sh`, `scripts/shard_go_tests.py`, `scripts/release_asset_common.sh`, `scripts/backfill-release-assets.sh`, `scripts/release_ldflags.sh`, `scripts/release_update_key.go`, `scripts/check-workflow-dispatch-inputs.py`, `scripts/capture-release-note-visuals.sh`, `scripts/release-preflight-worker.sh`, `scripts/run-release-preflight.sh`, `scripts/verify-github-release-integrity.sh`, `scripts/verify-release-container-images.sh`, `scripts/release_control/secure_runtime_attestation_v6.py`, `scripts/release_control/secure_runtime_source_manifest_v6.json`, `scripts/release_control/verify_release_container_images_test.py`, `scripts/release_control/capture_release_note_visuals.mjs`, `scripts/release_control/release_note_visuals.py`, `scripts/release_control/live_runtime_proof.py`, `scripts/release_control/live_runtime_proof_test.py`, `scripts/release_control/mobile_release_gate.py`, `scripts/release_control/render_release_body.py`, `scripts/release_control/resolve_release_promotion.py`, `scripts/release_control/validate_artifact_release_line.py`, `scripts/release_control/record_rc_to_ga_rehearsal.py`, `scripts/release_control/internal/record_rc_to_ga_rehearsal.py`, `scripts/release_control/release_promotion_policy_support.py`, `pulse-enterprise:scripts/build-pro-binaries.sh`, `pulse-enterprise:scripts/build-pro-release.sh`, `pulse-enterprise:scripts/validate-pro-release-line.sh`, `.dockerignore`, `Dockerfile`, `.github/ISSUE_TEMPLATE/v6_rc_feedback.yml`, `docs/RELEASE_NOTES.md`, `docs/releases/`, `docs/UPGRADE_v6.md`, `docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md`, `docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md`, `docs/release-control/v6/internal/RC_TO_GA_REHEARSAL_TEMPLATE.md`, `scripts/validate-release.sh`, `scripts/validate-published-release.sh`, the operator dispatch helpers `scripts/trigger-release.sh` and `scripts/trigger-release-dry-run.sh`, and the governed release workflows `.github/workflows/backfill-release-assets.yml`, `.github/workflows/build-release-candidate.yml`, `.github/workflows/compile-release-payload.yml`, `.github/workflows/create-release.yml`, `.github/workflows/deploy-demo-server.yml`, `.github/workflows/helm-pages.yml`, `.github/workflows/install-sh-smoke.yml`, `.github/workflows/promote-floating-tags.yml`, `.github/workflows/promote-private-pro-runtime.yml`, `.github/workflows/publish-docker.yml`, `.github/workflows/publish-helm-chart.yml`, `.github/workflows/qualify-secure-runtime-release.yml`, `.github/workflows/recover-release-activation.yml`, `.github/workflows/release-convergence.yml`, `.github/workflows/release-dry-run.yml`, `.github/workflows/retry-release-convergence.yml`, `.github/workflows/update-demo-server.yml`, `.github/workflows/validate-release-assets.yml`, and `pulse-enterprise:.github/workflows/build-pro-release.yml`
+2. Add or change release-build metadata injection, Docker build-context allowlists, release artifact assembly, hosted secure-runtime qualification compilation and attestation, governed promotion metadata resolution, artifact release-line validation, post-install live-runtime claim proof, the canonical version file, operator-facing release packet content, model-selected visual release-note capture, prerelease feedback intake wording, historical published-release integrity backfill, release asset validation status publication, download endpoint checksum/signature header proof, end-to-end install.sh smoke against staged or published release assets, or the canonical in-repo v6 upgrade guide through `scripts/build-release.sh`, `scripts/build-release-binaries.sh`, `scripts/build-secure-runtime-qualification.sh`, `scripts/release_build_targets.sh`, `scripts/run-release-backend-tests.sh`, `scripts/shard_go_tests.py`, `scripts/release_asset_common.sh`, `scripts/backfill-release-assets.sh`, `scripts/release_ldflags.sh`, `scripts/release_update_key.go`, `scripts/check-workflow-dispatch-inputs.py`, `scripts/capture-release-note-visuals.sh`, `scripts/release-preflight-worker.sh`, `scripts/run-release-preflight.sh`, `scripts/verify-github-release-integrity.sh`, `scripts/verify-release-container-images.sh`, `scripts/release_control/secure_runtime_attestation_v6.py`, `scripts/release_control/secure_runtime_source_manifest_v6.json`, `scripts/release_control/secure_runtime_attestation_v7.py`, `scripts/release_control/secure_runtime_source_manifest_v7.json`, `scripts/release_control/verify_release_container_images_test.py`, `scripts/release_control/capture_release_note_visuals.mjs`, `scripts/release_control/release_note_visuals.py`, `scripts/release_control/live_runtime_proof.py`, `scripts/release_control/live_runtime_proof_test.py`, `scripts/release_control/mobile_release_gate.py`, `scripts/release_control/render_release_body.py`, `scripts/release_control/resolve_release_promotion.py`, `scripts/release_control/validate_artifact_release_line.py`, `scripts/release_control/record_rc_to_ga_rehearsal.py`, `scripts/release_control/internal/record_rc_to_ga_rehearsal.py`, `scripts/release_control/release_promotion_policy_support.py`, `pulse-enterprise:scripts/build-pro-binaries.sh`, `pulse-enterprise:scripts/build-pro-release.sh`, `pulse-enterprise:scripts/validate-pro-release-line.sh`, `.dockerignore`, `Dockerfile`, `.github/ISSUE_TEMPLATE/v6_rc_feedback.yml`, `docs/RELEASE_NOTES.md`, `docs/releases/`, `docs/UPGRADE_v6.md`, `docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md`, `docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md`, `docs/release-control/v6/internal/RC_TO_GA_REHEARSAL_TEMPLATE.md`, `scripts/validate-release.sh`, `scripts/validate-published-release.sh`, the operator dispatch helpers `scripts/trigger-release.sh` and `scripts/trigger-release-dry-run.sh`, and the governed release workflows `.github/workflows/backfill-release-assets.yml`, `.github/workflows/build-release-candidate.yml`, `.github/workflows/compile-release-payload.yml`, `.github/workflows/create-release.yml`, `.github/workflows/deploy-demo-server.yml`, `.github/workflows/helm-pages.yml`, `.github/workflows/install-sh-smoke.yml`, `.github/workflows/promote-floating-tags.yml`, `.github/workflows/promote-private-pro-runtime.yml`, `.github/workflows/publish-docker.yml`, `.github/workflows/publish-helm-chart.yml`, `.github/workflows/qualify-secure-runtime-release.yml`, `.github/workflows/recover-release-activation.yml`, `.github/workflows/release-convergence.yml`, `.github/workflows/release-dry-run.yml`, `.github/workflows/retry-release-convergence.yml`, `.github/workflows/update-demo-server.yml`, `.github/workflows/validate-release-assets.yml`, and `pulse-enterprise:.github/workflows/build-pro-release.yml`
The governed release-build surface also includes
`scripts/prepare-release-container-context.sh` for exact-candidate container
assembly.
@@ -859,7 +870,7 @@ artifact-selection behaviour.
Post-publication secure-runtime qualification must authenticate before it
executes. `.github/workflows/qualify-secure-runtime-release.yml` may download
caller-owned release assets only into a non-executable holding directory.
- `scripts/release_control/secure_runtime_attestation_v6.py` must copy the six
+ `scripts/release_control/secure_runtime_attestation_v7.py` must copy the six
binaries, four collector signatures, checksum manifest, assembly and
compiler provenance, and build contract into one private snapshot, verify
the immutable release/tag/source identity, hosted compiler chain, canonical
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 063972f2fc..5def821685 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -4458,6 +4458,7 @@
"scripts/install-mcp.sh",
"scripts/install.ps1",
"scripts/install.sh",
+ "scripts/installtests/testdata/secure_runtime_docker_fixture.go",
"scripts/lib/hot-dev-auth.sh",
"scripts/lib/hot-dev-runtime.sh",
"scripts/prepare-release-container-context.sh",
@@ -4473,7 +4474,9 @@
"scripts/release_control/render_release_body.py",
"scripts/release_control/resolve_release_promotion.py",
"scripts/release_control/secure_runtime_attestation_v6.py",
+ "scripts/release_control/secure_runtime_attestation_v7.py",
"scripts/release_control/secure_runtime_source_manifest_v6.json",
+ "scripts/release_control/secure_runtime_source_manifest_v7.json",
"scripts/release_control/validate_artifact_release_line.py",
"scripts/release_ldflags.sh",
"scripts/release_update_key.go",
@@ -4689,11 +4692,14 @@
"scripts/build-release-binaries.sh",
"scripts/build-release.sh",
"scripts/build-secure-runtime-qualification.sh",
+ "scripts/installtests/testdata/secure_runtime_docker_fixture.go",
"scripts/prepare-release-container-context.sh",
"scripts/release_asset_common.sh",
"scripts/release_build_targets.sh",
"scripts/release_control/secure_runtime_attestation_v6.py",
+ "scripts/release_control/secure_runtime_attestation_v7.py",
"scripts/release_control/secure_runtime_source_manifest_v6.json",
+ "scripts/release_control/secure_runtime_source_manifest_v7.json",
"scripts/release_ldflags.sh",
"scripts/release_update_key.go",
"scripts/validate-release.sh"
@@ -4706,7 +4712,8 @@
"scripts/installtests/build_release_assets_test.go",
"scripts/installtests/release_ldflags_test.go",
"scripts/installtests/safe_profile_migration_test.go",
- "scripts/release_control/secure_runtime_attestation_v6_test.py"
+ "scripts/release_control/secure_runtime_attestation_v6_test.py",
+ "scripts/release_control/secure_runtime_attestation_v7_test.py"
]
},
{
diff --git a/scripts/installtests/build_release_assets_test.go b/scripts/installtests/build_release_assets_test.go
index aa26c13699..017e91a309 100644
--- a/scripts/installtests/build_release_assets_test.go
+++ b/scripts/installtests/build_release_assets_test.go
@@ -2648,7 +2648,7 @@ func TestSecureRuntimeQualificationPacketIsHostedAndReleaseBound(t *testing.T) {
"release/pulse-secure-runtime-collector-v1-linux-amd64",
"release/pulse-secure-runtime-collector-v3-linux-amd64",
"qualify-secure-runtime-release.yml/dispatches",
- `{ref: "main", return_run_details: true, inputs: {tag: $tag}}`,
+ `{ref: $tag, return_run_details: true, inputs: {tag: $tag}}`,
"Secure-runtime qualification dispatch did not return an exact workflow run.",
"Immutable RC publication did not retain an exact secure-runtime qualification run identity.",
} {
@@ -2671,22 +2671,42 @@ func TestSecureRuntimeQualificationPacketIsHostedAndReleaseBound(t *testing.T) {
}
for _, required := range []string{
".immutable == true",
+ `test "${GITHUB_REF}" = "refs/tags/${TAG}"`,
+ `test "${GITHUB_SHA}" = "${commit}"`,
"ca-certificates curl dbus systemd systemd-sysv util-linux",
- `for command in curl id nsenter runuser systemctl`,
+ `docker:27.5.1-dind@sha256:f649ef046008ca7f926a2571c32b0ac22e5c59eb61b959617f9acc2a4c638cf5`,
+ `for command in curl docker dockerd id nsenter runuser systemctl`,
+ `--host=unix:///var/run/docker.sock`,
+ `--storage-driver=vfs`,
+ `--bridge=none`,
+ `--iptables=false`,
+ `--network none`,
+ `pulse-secure-runtime-fixture:v7`,
"--verify-release-packet-only",
"--verified-packet-dir",
"$RUNNER_TEMP/secure-runtime-verified:/release:ro",
"$RUNNER_TEMP/secure-runtime-harness:/harness:ro",
"PULSE_SECURE_RUNTIME_SYSTEMD_LAB=disposable-v1",
- "^TestSecureRuntimeSystemdLab$",
+ "^TestSecureRuntimeSystemdDockerV7Lab$",
"--release-candidate-tag",
"--collector-v4-signature",
- "secure_runtime_attestation_v6.py",
+ "secure_runtime_attestation_v7.py",
+ "secure-agent-runtime-systemd-receipt-v7-",
+ "secure-agent-runtime-systemd-transcript-v7-",
} {
if !strings.Contains(qualificationWorkflow, required) {
t.Fatalf("post-publication secure-runtime qualification missing %q", required)
}
}
+ for _, forbidden := range []string{
+ `/var/run/docker.sock:/var/run/docker.sock`,
+ `--host=tcp://`,
+ `docker pull`,
+ } {
+ if strings.Contains(qualificationWorkflow, forbidden) {
+ t.Fatalf("post-publication secure-runtime qualification contains forbidden Docker boundary %q", forbidden)
+ }
+ }
}
func TestReleaseAssetCommonRunsUpdateKeyThroughModulePath(t *testing.T) {
diff --git a/scripts/installtests/secure_runtime_systemd_lab_test.go b/scripts/installtests/secure_runtime_systemd_lab_test.go
index e65406df22..1d73cc1d39 100644
--- a/scripts/installtests/secure_runtime_systemd_lab_test.go
+++ b/scripts/installtests/secure_runtime_systemd_lab_test.go
@@ -81,23 +81,26 @@ import (
"github.com/rcourtman/pulse-go-rewrite/internal/actionrunner"
"github.com/rcourtman/pulse-go-rewrite/internal/agentexec"
"github.com/rcourtman/pulse-go-rewrite/internal/operationreceipt"
+ agentsdocker "github.com/rcourtman/pulse-go-rewrite/pkg/agents/docker"
+ agentshost "github.com/rcourtman/pulse-go-rewrite/pkg/agents/host"
)
const (
- secureRuntimeLabOptIn = "PULSE_SECURE_RUNTIME_SYSTEMD_LAB"
- secureRuntimeLabMarkerPath = "/etc/pulse-secure-runtime-lab"
- secureRuntimeLabMarkerValue = "PULSE_SECURE_RUNTIME_SYSTEMD_LAB=disposable-v1"
- secureRuntimeLabToken = "8fa728ed4cbfa7466947e747627b51e2464ed3f69966ed6394e36a82d85d7d31"
- secureRuntimeLabAgentID = "secure-runtime-systemd-lab"
- secureRuntimeLabHostname = "pulse-secure-runtime-lab"
- secureRuntimeLabOrgID = "secure-runtime-lab-org"
- secureRuntimeRunnerSecretV1 = "3c896fe99e29384a293def92f23c1709fbf429773e0a20ac5d930f2aab62f839"
- secureRuntimeRunnerSecretV2 = "d7f6f2550788213e0595f276b62b1df290f7e018ba74c03068c4afbe6efd7601"
- secureRuntimeRunnerBindingV1 = "secure-runtime-runner-binding-v1"
- secureRuntimeRunnerBindingV2 = "secure-runtime-runner-binding-v2"
- secureRuntimeUpdateStatePath = "/var/lib/pulse-agent-helper/update-activation.json"
- secureRuntimeUpdateHandoff = "/var/lib/pulse-agent/.pulse-agent-update-pending.json"
- secureRuntimeUpdateLKGPath = "/usr/local/bin/pulse-agent.last-known-good"
+ secureRuntimeLabOptIn = "PULSE_SECURE_RUNTIME_SYSTEMD_LAB"
+ secureRuntimeLabMarkerPath = "/etc/pulse-secure-runtime-lab"
+ secureRuntimeLabMarkerValue = "PULSE_SECURE_RUNTIME_SYSTEMD_LAB=disposable-v1"
+ secureRuntimeLabToken = "8fa728ed4cbfa7466947e747627b51e2464ed3f69966ed6394e36a82d85d7d31"
+ secureRuntimeLabAgentID = "secure-runtime-systemd-lab"
+ secureRuntimeLabHostname = "pulse-secure-runtime-lab"
+ secureRuntimeLabOrgID = "secure-runtime-lab-org"
+ secureRuntimeRunnerSecretV1 = "3c896fe99e29384a293def92f23c1709fbf429773e0a20ac5d930f2aab62f839"
+ secureRuntimeRunnerSecretV2 = "d7f6f2550788213e0595f276b62b1df290f7e018ba74c03068c4afbe6efd7601"
+ secureRuntimeRunnerBindingV1 = "secure-runtime-runner-binding-v1"
+ secureRuntimeRunnerBindingV2 = "secure-runtime-runner-binding-v2"
+ secureRuntimeUpdateStatePath = "/var/lib/pulse-agent-helper/update-activation.json"
+ secureRuntimeUpdateHandoff = "/var/lib/pulse-agent/.pulse-agent-update-pending.json"
+ secureRuntimeUpdateLKGPath = "/usr/local/bin/pulse-agent.last-known-good"
+ secureRuntimeDockerFixtureImage = "pulse-secure-runtime-fixture:v7"
)
var secureRuntimeInstalledPaths = []string{
@@ -142,10 +145,30 @@ var secureRuntimeScenarioClaims = map[string][]string{
"helper_protocol_healthy",
"collector_authority_reduction_observed",
},
+ "rootful_docker_summary_migration": {
+ "legacy_rootful_inventory_observed",
+ "collector_rootful_socket_authority_removed",
+ "typed_helper_summary_inventory_observed",
+ "summary_inventory_parity_observed",
+ "summary_only_boundary_observed",
+ },
"explicit_safe_profile_rollback": {"explicit_rollback_preserved_reduced_authority"},
"automatic_failure_rollback": {"failed_activation_restored_prior_runtime"},
"ordinary_update_non_migration": {"ordinary_update_preserved_selected_profile"},
"final_safe_profile_apply": {"collector_reporting_continued_after_migration"},
+ "rootful_docker_summary_restart": {
+ "typed_helper_summary_survived_helper_restart",
+ "summary_inventory_parity_observed",
+ "new_report_sequence_accepted_after_restart",
+ "collector_remained_non_root",
+ },
+ "rootful_docker_helper_loss_recovery": {
+ "helper_loss_emitted_status_only_report",
+ "helper_health_degradation_visible",
+ "helper_recovery_restored_complete_inventory",
+ "report_order_remained_monotonic",
+ "collector_rootful_socket_fallback_denied",
+ },
"helper_update_authoritative_commit": {
"signed_helper_activation_observed",
"activated_process_digest_bound",
@@ -191,6 +214,11 @@ type secureRuntimeLabReport struct {
CommandsEnabled bool
}
+type secureRuntimeDockerReport struct {
+ ReceivedAt time.Time
+ Report agentsdocker.Report
+}
+
type secureRuntimeLabFixture struct {
mu sync.Mutex
collector []byte
@@ -200,6 +228,7 @@ type secureRuntimeLabFixture struct {
serverVersion string
reports []secureRuntimeLabReport
reportAttempts []secureRuntimeLabReport
+ dockerReports []secureRuntimeDockerReport
rejectedVersions map[string]bool
lastSeen time.Time
freezeLastSeen bool
@@ -340,6 +369,52 @@ func (f *secureRuntimeLabFixture) attemptSnapshot() []secureRuntimeLabReport {
return append([]secureRuntimeLabReport(nil), f.reportAttempts...)
}
+func (f *secureRuntimeLabFixture) dockerSnapshot() []secureRuntimeDockerReport {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ return append([]secureRuntimeDockerReport(nil), f.dockerReports...)
+}
+
+func (f *secureRuntimeLabFixture) handleDockerReport(w http.ResponseWriter, r *http.Request) {
+ if r.Method != http.MethodPost {
+ http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
+ return
+ }
+ if !f.authorized(r) {
+ http.Error(w, "unauthorized", http.StatusUnauthorized)
+ return
+ }
+ var reader io.Reader = http.MaxBytesReader(w, r.Body, 8<<20)
+ if strings.EqualFold(strings.TrimSpace(r.Header.Get("Content-Encoding")), "gzip") {
+ compressed, err := gzip.NewReader(reader)
+ if err != nil {
+ http.Error(w, "invalid gzip report", http.StatusBadRequest)
+ return
+ }
+ defer compressed.Close()
+ reader = io.LimitReader(compressed, 8<<20)
+ }
+ var report agentsdocker.Report
+ decoder := json.NewDecoder(reader)
+ if err := decoder.Decode(&report); err != nil {
+ http.Error(w, "invalid docker report", http.StatusBadRequest)
+ return
+ }
+ var trailing any
+ if err := decoder.Decode(&trailing); !errors.Is(err, io.EOF) {
+ http.Error(w, "docker report contains trailing data", http.StatusBadRequest)
+ return
+ }
+ if report.Agent.ID == "" || report.Host.Hostname == "" {
+ http.Error(w, "incomplete docker report", http.StatusBadRequest)
+ return
+ }
+ f.mu.Lock()
+ f.dockerReports = append(f.dockerReports, secureRuntimeDockerReport{ReceivedAt: time.Now().UTC(), Report: report})
+ f.mu.Unlock()
+ writeSecureRuntimeJSON(w, http.StatusOK, map[string]any{"success": true})
+}
+
func (f *secureRuntimeLabFixture) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch {
case r.URL.Path == "/api/version" || r.URL.Path == "/api/agent/version":
@@ -364,11 +439,7 @@ func (f *secureRuntimeLabFixture) ServeHTTP(w http.ResponseWriter, r *http.Reque
case r.URL.Path == "/api/agents/agent/report":
f.handleReport(w, r)
case r.URL.Path == "/api/agents/docker/report":
- if !f.authorized(r) {
- http.Error(w, "unauthorized", http.StatusUnauthorized)
- return
- }
- writeSecureRuntimeJSON(w, http.StatusOK, map[string]any{"success": true})
+ f.handleDockerReport(w, r)
case r.URL.Path == "/api/agents/agent/lookup":
f.handleLookup(w, r)
case strings.HasPrefix(r.URL.Path, "/api/agents/agent/") && strings.HasSuffix(r.URL.Path, "/config"):
@@ -830,6 +901,8 @@ type secureRuntimeLabReceipt struct {
HelperProtocolHealthy bool `json:"helper_protocol_healthy"`
StateIdentityPreserved bool `json:"state_identity_preserved"`
DockerDegraded bool `json:"docker_degraded"`
+ RootfulContainerRuntime string `json:"rootful_container_runtime,omitempty"`
+ RootfulContainerSummaryQualified bool `json:"rootful_container_summary_qualified,omitempty"`
ActionRunnerQualified bool `json:"action_runner_qualified"`
ActionMutationVerified bool `json:"action_mutation_verified"`
CollectorAuthorityReductionRequestObserved bool `json:"collector_authority_reduction_request_observed"`
@@ -959,10 +1032,12 @@ func TestSecureRuntimeReceiptCompletionEnclosesFinalTranscriptEvent(t *testing.T
}
func TestSecureRuntimeSourceManifestCoversTransitiveProviders(t *testing.T) {
- _, hashes := secureRuntimeLoadSourceBoundary(t, runtime.GOARCH)
+ _, hashes := secureRuntimeLoadSourceBoundary(t, runtime.GOARCH, 7)
for _, required := range []string{
"internal/agenthelper/providers.go",
"internal/agenthelper/container_inventory.go",
+ "internal/config/docker_report_order.go",
+ "internal/dockeragent/helper_inventory.go",
"internal/agenttls/config.go",
"internal/hostagent/action_runner_client.go",
"internal/hostagent/action_runner_health_persistence_unix.go",
@@ -975,6 +1050,9 @@ func TestSecureRuntimeSourceManifestCoversTransitiveProviders(t *testing.T) {
"pkg/securityutil/httpurl.go",
"scripts/release_control/secure_runtime_attestation.py",
"scripts/release_control/secure_runtime_attestation_v6.py",
+ "scripts/release_control/secure_runtime_attestation_v7.py",
+ "scripts/release_control/secure_runtime_source_manifest_v7.json",
+ "scripts/installtests/testdata/secure_runtime_docker_fixture.go",
".github/workflows/build-release-candidate.yml",
".github/workflows/compile-release-payload.yml",
".github/workflows/create-release.yml",
@@ -1035,8 +1113,13 @@ func TestSecureRuntimeFixturePromotesPendingRunner(t *testing.T) {
Registered bool `json:"registered"`
Activated bool `json:"activated"`
}
- if err := json.Unmarshal(secureRuntimeReadFile(t, healthPath), &health); err != nil {
- t.Fatalf("decode fixture action-runner health: %v", err)
+ deadline := time.Now().Add(5 * time.Second)
+ for time.Now().Before(deadline) {
+ raw, err := os.ReadFile(healthPath)
+ if err == nil && json.Unmarshal(raw, &health) == nil && health.Registered && health.Activated {
+ break
+ }
+ time.Sleep(25 * time.Millisecond)
}
if !health.Registered || !health.Activated {
t.Fatalf("fixture action-runner health = %+v", health)
@@ -1103,10 +1186,73 @@ func TestSecureRuntimeFixtureSelfRevokeUsesBodylessNoContentResponse(t *testing.
}
}
+func TestSecureRuntimeFixtureCapturesBoundedGzipDockerReport(t *testing.T) {
+ fixture := newSecureRuntimeLabFixture(nil, "", nil, nil, "fixture")
+ defer fixture.actionServer.Shutdown()
+ complete := true
+ report := agentsdocker.Report{
+ Agent: agentsdocker.AgentInfo{ID: secureRuntimeLabAgentID},
+ Host: agentsdocker.HostInfo{Hostname: secureRuntimeLabHostname, Runtime: "docker"},
+ InventoryComplete: &complete,
+ Containers: []agentsdocker.Container{{
+ ID: "container-b", Name: "fixture", Image: "pulse-secure-runtime-fixture:v7",
+ CreatedAt: time.Unix(1_700_000_000, 0).UTC(), State: "running", Status: "Up",
+ }},
+ }
+ var body bytes.Buffer
+ compressed := gzip.NewWriter(&body)
+ if err := json.NewEncoder(compressed).Encode(report); err != nil {
+ t.Fatalf("encode Docker report: %v", err)
+ }
+ if err := compressed.Close(); err != nil {
+ t.Fatalf("close Docker report gzip stream: %v", err)
+ }
+ request := httptest.NewRequest(http.MethodPost, "/api/agents/docker/report", &body)
+ request.Header.Set("X-API-Token", secureRuntimeLabToken)
+ request.Header.Set("Content-Encoding", "gzip")
+ recorder := httptest.NewRecorder()
+ fixture.ServeHTTP(recorder, request)
+ if recorder.Code != http.StatusOK {
+ t.Fatalf("Docker report response = %d %q", recorder.Code, recorder.Body.String())
+ }
+ captured := fixture.dockerSnapshot()
+ if len(captured) != 1 || captured[0].Report.Containers[0].ID != "container-b" {
+ t.Fatalf("captured Docker reports = %+v", captured)
+ }
+}
+
+func TestSecureRuntimeDockerInventoryDigestIsOrderIndependent(t *testing.T) {
+ created := time.Unix(1_700_000_000, 0).UTC()
+ first := agentsdocker.Report{Containers: []agentsdocker.Container{
+ {ID: "b", Name: "second", Image: "fixture:v7", State: "running", Status: "volatile", CreatedAt: created},
+ {ID: "a", Name: "first", Image: "fixture:v7", State: "exited", Status: "old", CreatedAt: created},
+ }}
+ second := agentsdocker.Report{Containers: []agentsdocker.Container{
+ {ID: "a", Name: "first", Image: "fixture:v7", State: "exited", Status: "new", CreatedAt: created},
+ {ID: "b", Name: "second", Image: "fixture:v7", State: "running", Status: "changed", CreatedAt: created},
+ }}
+ firstDigest, firstCount := secureRuntimeDockerInventoryDigest(first)
+ secondDigest, secondCount := secureRuntimeDockerInventoryDigest(second)
+ if firstCount != 2 || secondCount != 2 || firstDigest != secondDigest {
+ t.Fatalf("canonical Docker inventory digest changed with order/status: first=%d/%s second=%d/%s", firstCount, firstDigest, secondCount, secondDigest)
+ }
+}
+
func TestSecureRuntimeSystemdLab(t *testing.T) {
+ runSecureRuntimeSystemdLab(t, 6)
+}
+
+func TestSecureRuntimeSystemdDockerV7Lab(t *testing.T) {
+ runSecureRuntimeSystemdLab(t, 7)
+}
+
+func runSecureRuntimeSystemdLab(t *testing.T, schemaVersion int) {
if os.Getenv(secureRuntimeLabOptIn) != "1" {
t.Skip("set PULSE_SECURE_RUNTIME_SYSTEMD_LAB=1 only inside a disposable systemd VM")
}
+ if schemaVersion != 6 && schemaVersion != 7 {
+ t.Fatalf("unsupported secure-runtime schema version %d", schemaVersion)
+ }
secureRuntimeRequireDisposableHost(t)
collectorV1 := secureRuntimeReadArtifact(t, "PULSE_SECURE_RUNTIME_COLLECTOR_V1")
@@ -1141,9 +1287,9 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
t.Fatalf("PULSE_SECURE_RUNTIME_RECEIPT_RECORD_PATH must be a canonical repository-relative path: %q", recordPath)
}
startedAt := time.Now().UTC()
- sourceManifest, sourceHashes := secureRuntimeLoadSourceBoundary(t, runtime.GOARCH)
+ sourceManifest, sourceHashes := secureRuntimeLoadSourceBoundary(t, runtime.GOARCH, schemaVersion)
receipt := secureRuntimeLabReceipt{
- SchemaVersion: 6,
+ SchemaVersion: schemaVersion,
RecordPath: recordPath,
StartedAt: startedAt.Format(time.RFC3339Nano),
SourceManifest: sourceManifest,
@@ -1185,9 +1331,13 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
initialArgs := []string{"--enable-commands", "--command-authority", "command-capable"}
dockerInitiallyAvailable := secureRuntimeRootfulDockerAvailable()
+ if schemaVersion == 7 && !dockerInitiallyAvailable {
+ t.Fatal("schema-v7 qualification requires a live rootful Docker daemon")
+ }
if dockerInitiallyAvailable {
initialArgs = append(initialArgs, "--enable-docker")
}
+ dockerInstallStartedAt := time.Now().UTC()
secureRuntimeRunInstaller(t, installerPath, server.URL, initialArgs...)
secureRuntimeWaitForReports(t, fixture, 1, 45*time.Second)
secureRuntimeAssertRootCommandProfile(t)
@@ -1195,6 +1345,17 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
if dockerInitiallyAvailable && !dockerInitiallyEnabled {
t.Fatal("rootful Docker was available but the requested legacy profile did not enable Docker monitoring")
}
+ var v7LegacyDocker secureRuntimeDockerReport
+ if schemaVersion == 7 {
+ v7LegacyDocker = secureRuntimeDockerReportAfter(t, fixture, dockerInstallStartedAt, 60*time.Second, func(report agentsdocker.Report) bool {
+ return secureRuntimeDockerComplete(report) && report.Host.CollectionMode == "" && len(report.Containers) > 0
+ })
+ secureRuntimeAssertExpectedDockerFixtures(t, v7LegacyDocker.Report)
+ _, count := secureRuntimeDockerInventoryDigest(v7LegacyDocker.Report)
+ if count == 0 {
+ t.Fatal("schema-v7 legacy Docker baseline contained no deterministic fixture containers")
+ }
+ }
pass("legacy_root_command_capable_install", fmt.Sprintf("root collector installed; docker_enabled=%t", dockerInitiallyEnabled), map[string]any{"collector_process_uid": 0, "commands_enabled": true})
beforeInspect := secureRuntimeStableSnapshot(t)
@@ -1244,6 +1405,7 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
legacyBaseline := secureRuntimeStableSnapshot(t)
reportsBeforeApply, preApplyLastSeen, _, _ := fixture.snapshot()
fixture.setCollector(collectorV2, collectorV2Signature)
+ safeApplyStartedAt := time.Now().UTC()
applyOutput := secureRuntimeRunInstaller(t, installerPath, server.URL, "--safe-profile-apply")
secureRuntimeWaitForReports(t, fixture, len(reportsBeforeApply)+1, 45*time.Second)
_, postApplyLastSeen, _, _ := fixture.snapshot()
@@ -1263,6 +1425,39 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
}
pass("safe_profile_apply", "fresh server lastSeen, least-privilege identity, typed helper health", map[string]any{"collector_service_user": "pulse-agent", "collector_authority": "monitoring-only", "helper_status": "ok"})
+ var v7MigratedDocker secureRuntimeDockerReport
+ if schemaVersion == 7 {
+ v7MigratedDocker = secureRuntimeDockerReportAfter(t, fixture, safeApplyStartedAt, 60*time.Second, func(report agentsdocker.Report) bool {
+ return secureRuntimeDockerComplete(report) && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary
+ })
+ secureRuntimeAssertDockerSummaryOnly(t, v7MigratedDocker.Report)
+ secureRuntimeAssertExpectedDockerFixtures(t, v7MigratedDocker.Report)
+ secureRuntimeAssertCollectorDockerSocketDenied(t)
+ groups := strings.Fields(secureRuntimeCommand(t, 10*time.Second, "id", "-nG", "pulse-agent"))
+ for _, group := range groups {
+ if group == "docker" {
+ t.Fatal("safe-profile collector retained docker-group authority")
+ }
+ }
+ legacyDigest, legacyCount := secureRuntimeDockerInventoryDigest(v7LegacyDocker.Report)
+ migratedDigest, migratedCount := secureRuntimeDockerInventoryDigest(v7MigratedDocker.Report)
+ if legacyCount == 0 || migratedCount != legacyCount || migratedDigest != legacyDigest {
+ t.Fatalf("typed-helper Docker migration inventory mismatch: legacy=%d/%s migrated=%d/%s", legacyCount, legacyDigest, migratedCount, migratedDigest)
+ }
+ pass("rootful_docker_summary_migration", "rootful Docker inventory moved from the root collector to the summary-only typed helper without granting socket authority", map[string]any{
+ "runtime": "docker", "collection_mode": agentsdocker.CollectionModeTypedHelperSummary,
+ "legacy_collection_mode": "",
+ "inventory_complete": true, "collector_in_docker_group": false,
+ "collector_rootful_socket_access": false, "secondary_inventories_empty": true,
+ "container_actions_available": false, "update_checks_available": false,
+ "fixture_container_names": []string{"pulse-v7-exited", "pulse-v7-running"},
+ "fixture_image": secureRuntimeDockerFixtureImage,
+ "fixture_states": map[string]string{"pulse-v7-exited": "exited", "pulse-v7-running": "running"},
+ "legacy_container_count": legacyCount, "migrated_container_count": migratedCount,
+ "legacy_inventory_sha256": legacyDigest, "migrated_inventory_sha256": migratedDigest,
+ })
+ }
+
reportsBeforeRollback, _, _, _ := fixture.snapshot()
secureRuntimeRunInstaller(t, installerPath, server.URL, "--safe-profile-rollback")
secureRuntimeWaitForReports(t, fixture, len(reportsBeforeRollback)+1, 45*time.Second)
@@ -1293,6 +1488,7 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
fixture.setServerVersion(collectorV2Version)
reportsBeforeFinalApply, preFinalLastSeen, _, _ := fixture.snapshot()
+ finalApplyStartedAt := time.Now().UTC()
secureRuntimeRunInstaller(t, installerPath, server.URL, "--safe-profile-apply")
secureRuntimeWaitForReports(t, fixture, len(reportsBeforeFinalApply)+1, 45*time.Second)
_, finalLastSeen, authFailures, requestFailures := fixture.snapshot()
@@ -1308,6 +1504,78 @@ func TestSecureRuntimeSystemdLab(t *testing.T) {
secureRuntimeWaitForReports(t, fixture, len(reportsBeforeContinuity)+1, 20*time.Second)
pass("final_safe_profile_apply", "collector continued reporting after committed migration", map[string]any{"collector_service_user": "pulse-agent", "continuity_report_observed": true})
+ if schemaVersion == 7 {
+ finalDocker := secureRuntimeDockerReportAfter(t, fixture, finalApplyStartedAt, 60*time.Second, func(report agentsdocker.Report) bool {
+ return report.Timestamp.After(finalApplyStartedAt) && secureRuntimeDockerComplete(report) && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary
+ })
+ secureRuntimeAssertDockerSummaryOnly(t, finalDocker.Report)
+ finalDigest, finalCount := secureRuntimeDockerInventoryDigest(finalDocker.Report)
+ migrationDigest, migrationCount := secureRuntimeDockerInventoryDigest(v7MigratedDocker.Report)
+ if finalCount != migrationCount || finalDigest != migrationDigest {
+ t.Fatalf("final Docker summary differs from migration baseline: migration=%d/%s final=%d/%s", migrationCount, migrationDigest, finalCount, finalDigest)
+ }
+ helperPIDBefore := strings.TrimSpace(secureRuntimeCommand(t, 10*time.Second, "systemctl", "show", "pulse-agent-helper.service", "--property", "MainPID", "--value"))
+ secureRuntimeCommand(t, 20*time.Second, "systemctl", "restart", "pulse-agent-helper.service")
+ restartCompletedAt := time.Now().UTC()
+ helperPIDAfter := strings.TrimSpace(secureRuntimeCommand(t, 10*time.Second, "systemctl", "show", "pulse-agent-helper.service", "--property", "MainPID", "--value"))
+ if helperPIDBefore == "" || helperPIDBefore == "0" || helperPIDAfter == "" || helperPIDAfter == "0" || helperPIDBefore == helperPIDAfter {
+ t.Fatalf("helper restart did not replace the service process: before=%q after=%q", helperPIDBefore, helperPIDAfter)
+ }
+ restartedDocker := secureRuntimeDockerReportAfter(t, fixture, restartCompletedAt, 60*time.Second, func(report agentsdocker.Report) bool {
+ return report.Timestamp.After(restartCompletedAt) && secureRuntimeDockerComplete(report) && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary
+ })
+ secureRuntimeAssertDockerSummaryOnly(t, restartedDocker.Report)
+ restartDigest, restartCount := secureRuntimeDockerInventoryDigest(restartedDocker.Report)
+ beforeStream, beforeSequence, beforeOK := agentshost.ParseReportSequenceID(finalDocker.Report.SequenceID)
+ afterStream, afterSequence, afterOK := agentshost.ParseReportSequenceID(restartedDocker.Report.SequenceID)
+ if restartCount != finalCount || restartDigest != finalDigest || !beforeOK || !afterOK || beforeStream != afterStream || afterSequence <= beforeSequence {
+ t.Fatalf("helper restart Docker continuity failed: before=%d/%s/%s after=%d/%s/%s", finalCount, finalDigest, finalDocker.Report.SequenceID, restartCount, restartDigest, restartedDocker.Report.SequenceID)
+ }
+ secureRuntimeAssertCollectorDockerSocketDenied(t)
+ pass("rootful_docker_summary_restart", "typed-helper Docker summary survived an actual helper process restart on the same collector report stream", map[string]any{
+ "runtime": "docker", "collection_mode": agentsdocker.CollectionModeTypedHelperSummary,
+ "inventory_complete": true, "collector_rootful_socket_access": false,
+ "pre_restart_helper_pid": helperPIDBefore, "post_restart_helper_pid": helperPIDAfter,
+ "pre_restart_inventory_sha256": finalDigest, "post_restart_inventory_sha256": restartDigest,
+ "pre_restart_container_count": finalCount, "post_restart_container_count": restartCount,
+ "report_stream_id": afterStream, "pre_restart_sequence": beforeSequence, "post_restart_sequence": afterSequence,
+ })
+
+ secureRuntimeCommand(t, 20*time.Second, "systemctl", "stop", "pulse-agent-helper.socket", "pulse-agent-helper.service")
+ lossStartedAt := time.Now().UTC()
+ lossDocker := secureRuntimeDockerReportAfter(t, fixture, lossStartedAt, 75*time.Second, func(report agentsdocker.Report) bool {
+ return report.Timestamp.After(lossStartedAt) && report.InventoryComplete != nil && !*report.InventoryComplete && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary && secureRuntimeDockerHelperModuleState(report) == "degraded"
+ })
+ secureRuntimeAssertCollectorDockerSocketDenied(t)
+ if len(lossDocker.Report.Containers) != 0 {
+ t.Fatal("helper-loss status report carried an authoritative replacement container inventory")
+ }
+ secureRuntimeCommand(t, 20*time.Second, "systemctl", "start", "pulse-agent-helper.socket")
+ secureRuntimeAssertHelperProtocol(t)
+ recoveryStartedAt := time.Now().UTC()
+ recoveredDocker := secureRuntimeDockerReportAfter(t, fixture, recoveryStartedAt, 75*time.Second, func(report agentsdocker.Report) bool {
+ return report.Timestamp.After(recoveryStartedAt) && secureRuntimeDockerComplete(report) && report.Host.CollectionMode == agentsdocker.CollectionModeTypedHelperSummary && secureRuntimeDockerHelperModuleState(report) == "running"
+ })
+ secureRuntimeAssertDockerSummaryOnly(t, recoveredDocker.Report)
+ recoveredDigest, recoveredCount := secureRuntimeDockerInventoryDigest(recoveredDocker.Report)
+ lossStream, lossSequence, lossOK := agentshost.ParseReportSequenceID(lossDocker.Report.SequenceID)
+ recoveryStream, recoverySequence, recoveryOK := agentshost.ParseReportSequenceID(recoveredDocker.Report.SequenceID)
+ if recoveredCount != restartCount || recoveredDigest != restartDigest || !lossOK || !recoveryOK || lossStream != recoveryStream || recoverySequence <= lossSequence {
+ t.Fatalf("helper-loss Docker recovery failed: loss=%s recovery=%s inventory=%d/%s want=%d/%s", lossDocker.Report.SequenceID, recoveredDocker.Report.SequenceID, recoveredCount, recoveredDigest, restartCount, restartDigest)
+ }
+ pass("rootful_docker_helper_loss_recovery", "helper loss emitted a degraded status-only report without rootful fallback and recovery restored the complete summary", map[string]any{
+ "runtime": "docker", "collection_mode": agentsdocker.CollectionModeTypedHelperSummary,
+ "loss_inventory_complete": false, "loss_module_state": "degraded",
+ "loss_container_count": len(lossDocker.Report.Containers), "collector_rootful_socket_access_during_loss": false,
+ "recovery_inventory_complete": true, "recovery_module_state": "running",
+ "pre_loss_inventory_sha256": restartDigest, "recovered_inventory_sha256": recoveredDigest,
+ "pre_loss_container_count": restartCount, "recovered_container_count": recoveredCount,
+ "report_stream_id": recoveryStream, "loss_sequence": lossSequence, "recovery_sequence": recoverySequence,
+ })
+ receipt.RootfulContainerRuntime = "docker"
+ receipt.RootfulContainerSummaryQualified = true
+ }
+
helperServiceRejection := secureRuntimeExerciseUnitOverrideDetection(t,
"pulse-agent-helper.service", "Service", "PrivateNetwork=false", false)
pass("helper_service_override_rejection", "effective helper service validation rejected an existing systemd drop-in", map[string]any{
@@ -1796,19 +2064,19 @@ func secureRuntimeHash(data []byte) string {
return hex.EncodeToString(sum[:])
}
-func secureRuntimeLoadSourceBoundary(t *testing.T, targetArch string) (secureRuntimeSourceManifestBinding, map[string]string) {
+func secureRuntimeLoadSourceBoundary(t *testing.T, targetArch string, schemaVersion int) (secureRuntimeSourceManifestBinding, map[string]string) {
t.Helper()
repoRoot, err := filepath.Abs(repoFile())
if err != nil {
t.Fatalf("resolve repository root: %v", err)
}
- manifestRelative := "scripts/release_control/secure_runtime_source_manifest_v6.json"
+ manifestRelative := fmt.Sprintf("scripts/release_control/secure_runtime_source_manifest_v%d.json", schemaVersion)
manifestRaw := secureRuntimeReadFile(t, filepath.Join(repoRoot, filepath.FromSlash(manifestRelative)))
var manifest secureRuntimeSourceManifest
if err := json.Unmarshal(manifestRaw, &manifest); err != nil {
t.Fatalf("decode secure-runtime source manifest: %v", err)
}
- if manifest.SchemaVersion != 1 || manifest.ManifestID != "secure-runtime-linux-v6" || manifest.TargetOS != "linux" {
+ if manifest.SchemaVersion != 1 || manifest.ManifestID != fmt.Sprintf("secure-runtime-linux-v%d", schemaVersion) || manifest.TargetOS != "linux" {
t.Fatalf("unsupported secure-runtime source manifest: %+v", manifest)
}
sourceHashes := make(map[string]string)
@@ -2632,6 +2900,115 @@ func secureRuntimeRootfulDockerAvailable() bool {
return err == nil && response.StatusCode == http.StatusOK && strings.TrimSpace(string(body)) == "OK"
}
+type secureRuntimeDockerContainerSummary struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Image string `json:"image"`
+ State string `json:"state"`
+ CreatedAt string `json:"created_at"`
+}
+
+func secureRuntimeDockerInventoryDigest(report agentsdocker.Report) (string, int) {
+ containers := make([]secureRuntimeDockerContainerSummary, 0, len(report.Containers))
+ for _, container := range report.Containers {
+ containers = append(containers, secureRuntimeDockerContainerSummary{
+ ID: container.ID, Name: container.Name, Image: container.Image, State: container.State,
+ CreatedAt: container.CreatedAt.UTC().Format(time.RFC3339Nano),
+ })
+ }
+ sort.Slice(containers, func(i, j int) bool {
+ if containers[i].ID != containers[j].ID {
+ return containers[i].ID < containers[j].ID
+ }
+ return containers[i].Name < containers[j].Name
+ })
+ raw, err := json.Marshal(containers)
+ if err != nil {
+ panic(err)
+ }
+ return secureRuntimeHash(raw), len(containers)
+}
+
+func secureRuntimeAssertExpectedDockerFixtures(t *testing.T, report agentsdocker.Report) {
+ t.Helper()
+ expected := map[string]string{
+ "pulse-v7-exited": "exited",
+ "pulse-v7-running": "running",
+ }
+ if len(report.Containers) != len(expected) {
+ t.Fatalf("Docker fixture inventory count = %d, want %d", len(report.Containers), len(expected))
+ }
+ for _, container := range report.Containers {
+ wantState, ok := expected[container.Name]
+ if !ok {
+ t.Fatalf("Docker fixture inventory contains unexpected container %q", container.Name)
+ }
+ if container.ID == "" || container.Image != secureRuntimeDockerFixtureImage || container.State != wantState || container.CreatedAt.IsZero() {
+ t.Fatalf("Docker fixture container %q identity = id:%q image:%q state:%q created:%s", container.Name, container.ID, container.Image, container.State, container.CreatedAt)
+ }
+ delete(expected, container.Name)
+ }
+ if len(expected) != 0 {
+ t.Fatalf("Docker fixture inventory omitted containers: %v", expected)
+ }
+}
+
+func secureRuntimeDockerReportAfter(t *testing.T, fixture *secureRuntimeLabFixture, after time.Time, timeout time.Duration, predicate func(agentsdocker.Report) bool) secureRuntimeDockerReport {
+ t.Helper()
+ deadline := time.Now().Add(timeout)
+ for time.Now().Before(deadline) {
+ for _, candidate := range fixture.dockerSnapshot() {
+ if candidate.ReceivedAt.After(after) && predicate(candidate.Report) {
+ return candidate
+ }
+ }
+ time.Sleep(100 * time.Millisecond)
+ }
+ t.Fatalf("timed out waiting for qualifying Docker report after %s", after.Format(time.RFC3339Nano))
+ return secureRuntimeDockerReport{}
+}
+
+func secureRuntimeDockerComplete(report agentsdocker.Report) bool {
+ return report.InventoryComplete == nil || *report.InventoryComplete
+}
+
+func secureRuntimeDockerHelperModuleState(report agentsdocker.Report) string {
+ for _, module := range report.Agent.Modules {
+ if module.Name == agentshost.ModuleNameTypedPrivilegeHelper {
+ return module.State
+ }
+ }
+ return ""
+}
+
+func secureRuntimeAssertDockerSummaryOnly(t *testing.T, report agentsdocker.Report) {
+ t.Helper()
+ if report.InventoryComplete == nil || !*report.InventoryComplete {
+ t.Fatal("typed-helper Docker summary did not declare complete inventory")
+ }
+ if report.Host.Runtime != "docker" || report.Host.CollectionMode != agentsdocker.CollectionModeTypedHelperSummary {
+ t.Fatalf("typed-helper Docker collection posture = runtime:%q mode:%q", report.Host.Runtime, report.Host.CollectionMode)
+ }
+ if len(report.Images) != 0 || len(report.Volumes) != 0 || len(report.Networks) != 0 || len(report.Services) != 0 || len(report.Tasks) != 0 || len(report.Nodes) != 0 || len(report.Secrets) != 0 || len(report.Configs) != 0 || report.StorageUsage != nil {
+ t.Fatal("typed-helper Docker summary fabricated unsupported secondary inventories")
+ }
+ for _, container := range report.Containers {
+ if container.ImageDigest != "" || container.Health != "" || len(container.HealthcheckTargets) != 0 || container.CPUPercent != 0 || container.MemoryUsageBytes != 0 || container.MemoryLimitBytes != 0 || container.MemoryPercent != 0 || container.UptimeSeconds != 0 || container.RestartCount != 0 || container.ExitCode != 0 || container.OOMKilled != nil || container.StartedAt != nil || container.FinishedAt != nil || len(container.Ports) != 0 || len(container.Labels) != 0 || len(container.Env) != 0 || len(container.Networks) != 0 || container.NetworkRXBytes != 0 || container.NetworkTXBytes != 0 || container.WritableLayerBytes != 0 || container.RootFilesystemBytes != 0 || container.BlockIO != nil || len(container.Mounts) != 0 || container.Podman != nil || container.UpdateStatus != nil {
+ t.Fatalf("typed-helper Docker container %q escaped the summary-only boundary: %+v", container.ID, container)
+ }
+ }
+}
+
+func secureRuntimeAssertCollectorDockerSocketDenied(t *testing.T) {
+ t.Helper()
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
+ command := exec.CommandContext(ctx, "runuser", "-u", "pulse-agent", "--", "curl", "-fsS", "--max-time", "2", "--unix-socket", "/var/run/docker.sock", "http://docker/_ping")
+ if output, err := command.CombinedOutput(); err == nil {
+ t.Fatalf("unprivileged collector unexpectedly reached the rootful Docker socket: %s", strings.TrimSpace(string(output)))
+ }
+}
+
func secureRuntimeCollectorOwnedRootlessAvailable(t *testing.T) bool {
t.Helper()
uidText, err := exec.Command("id", "-u", "pulse-agent").Output()
diff --git a/scripts/installtests/testdata/secure_runtime_docker_fixture.go b/scripts/installtests/testdata/secure_runtime_docker_fixture.go
new file mode 100644
index 0000000000..33ac715c5b
--- /dev/null
+++ b/scripts/installtests/testdata/secure_runtime_docker_fixture.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "flag"
+ "os"
+ "os/signal"
+ "syscall"
+)
+
+func main() {
+ exit := flag.Bool("exit", false, "exit immediately")
+ flag.Parse()
+ if *exit {
+ return
+ }
+ stop := make(chan os.Signal, 1)
+ signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
+ <-stop
+}
diff --git a/scripts/release_control/secure_runtime_attestation_v7.py b/scripts/release_control/secure_runtime_attestation_v7.py
new file mode 100644
index 0000000000..967aef5635
--- /dev/null
+++ b/scripts/release_control/secure_runtime_attestation_v7.py
@@ -0,0 +1,256 @@
+#!/usr/bin/env python3
+"""Verify schema-v7 secure-runtime systemd and rootful-Docker evidence."""
+
+from __future__ import annotations
+
+import contextlib
+import json
+import sys
+from pathlib import Path
+from typing import Any, Iterator, Sequence
+
+import secure_runtime_attestation as v5
+import secure_runtime_attestation_v6 as v6
+
+
+RECEIPT_SCHEMA_VERSION = 7
+ATTESTATION_SCHEMA_VERSION = 7
+SOURCE_MANIFEST_PATH = "scripts/release_control/secure_runtime_source_manifest_v7.json"
+SOURCE_MANIFEST_SCHEMA_VERSION = 1
+SOURCE_MANIFEST_ID = "secure-runtime-linux-v7"
+ATTESTATION_TOOL_PATH = "scripts/release_control/secure_runtime_attestation_v7.py"
+
+REQUIRED_SCENARIOS = (
+ "legacy_root_command_capable_install",
+ "read_only_inspect",
+ "drop_in_fail_closed_rehearsal",
+ "safe_profile_apply",
+ "rootful_docker_summary_migration",
+ "explicit_safe_profile_rollback",
+ "automatic_failure_rollback",
+ "ordinary_update_non_migration",
+ "final_safe_profile_apply",
+ "rootful_docker_summary_restart",
+ "rootful_docker_helper_loss_recovery",
+ "helper_service_override_rejection",
+ "helper_resource_limit_override_rejection",
+ "helper_socket_override_rejection",
+ "helper_network_namespace_isolation",
+ "helper_update_authoritative_commit",
+ "helper_update_watchdog_rollback",
+ "helper_update_interrupted_recovery",
+ "separate_action_runner_install",
+ "action_runner_override_rejection",
+ "typed_action_receipt",
+ "action_runner_credential_rotation",
+ "action_runner_self_revoke",
+)
+
+SCENARIO_REQUIRED_CLAIMS = {
+ **v6.SCENARIO_REQUIRED_CLAIMS,
+ "rootful_docker_summary_migration": {
+ "legacy_rootful_inventory_observed",
+ "collector_rootful_socket_authority_removed",
+ "typed_helper_summary_inventory_observed",
+ "summary_inventory_parity_observed",
+ "summary_only_boundary_observed",
+ },
+ "rootful_docker_summary_restart": {
+ "typed_helper_summary_survived_helper_restart",
+ "summary_inventory_parity_observed",
+ "new_report_sequence_accepted_after_restart",
+ "collector_remained_non_root",
+ },
+ "rootful_docker_helper_loss_recovery": {
+ "helper_loss_emitted_status_only_report",
+ "helper_health_degradation_visible",
+ "helper_recovery_restored_complete_inventory",
+ "report_order_remained_monotonic",
+ "collector_rootful_socket_fallback_denied",
+ },
+}
+
+SCENARIO_REQUIRED_OBSERVATIONS = {
+ **v6.SCENARIO_REQUIRED_OBSERVATIONS,
+ "rootful_docker_summary_migration": {
+ "runtime": "docker",
+ "legacy_collection_mode": "",
+ "collection_mode": "typed-helper-summary",
+ "inventory_complete": True,
+ "collector_in_docker_group": False,
+ "collector_rootful_socket_access": False,
+ "secondary_inventories_empty": True,
+ "container_actions_available": False,
+ "update_checks_available": False,
+ "fixture_container_names": ["pulse-v7-exited", "pulse-v7-running"],
+ "fixture_image": "pulse-secure-runtime-fixture:v7",
+ "fixture_states": {
+ "pulse-v7-exited": "exited",
+ "pulse-v7-running": "running",
+ },
+ "legacy_container_count": 2,
+ "migrated_container_count": 2,
+ },
+ "rootful_docker_summary_restart": {
+ "runtime": "docker",
+ "collection_mode": "typed-helper-summary",
+ "inventory_complete": True,
+ "collector_rootful_socket_access": False,
+ },
+ "rootful_docker_helper_loss_recovery": {
+ "runtime": "docker",
+ "collection_mode": "typed-helper-summary",
+ "loss_inventory_complete": False,
+ "loss_module_state": "degraded",
+ "loss_container_count": 0,
+ "collector_rootful_socket_access_during_loss": False,
+ "recovery_inventory_complete": True,
+ "recovery_module_state": "running",
+ },
+}
+
+_V6_CREATE_ATTESTATION = v6.create_attestation
+
+
+def v7_contract() -> Iterator[None]:
+ replacements = {
+ "RECEIPT_SCHEMA_VERSION": RECEIPT_SCHEMA_VERSION,
+ "ATTESTATION_SCHEMA_VERSION": ATTESTATION_SCHEMA_VERSION,
+ "SOURCE_MANIFEST_PATH": SOURCE_MANIFEST_PATH,
+ "SOURCE_MANIFEST_SCHEMA_VERSION": SOURCE_MANIFEST_SCHEMA_VERSION,
+ "SOURCE_MANIFEST_ID": SOURCE_MANIFEST_ID,
+ "ATTESTATION_TOOL_PATH": ATTESTATION_TOOL_PATH,
+ "REQUIRED_SCENARIOS": REQUIRED_SCENARIOS,
+ "SCENARIO_REQUIRED_CLAIMS": SCENARIO_REQUIRED_CLAIMS,
+ "SCENARIO_REQUIRED_OBSERVATIONS": SCENARIO_REQUIRED_OBSERVATIONS,
+ "__file__": __file__,
+ "create_attestation": create_attestation,
+ }
+ previous = {name: getattr(v6, name) for name in replacements}
+ try:
+ for name, value in replacements.items():
+ setattr(v6, name, value)
+ yield
+ finally:
+ for name, value in previous.items():
+ setattr(v6, name, value)
+
+
+def _scenario_observations(receipt: dict[str, Any], name: str) -> dict[str, Any]:
+ scenarios = receipt.get("scenarios")
+ if not isinstance(scenarios, list):
+ raise v5.AttestationError("receipt scenarios must be a list")
+ for scenario in scenarios:
+ if isinstance(scenario, dict) and scenario.get("name") == name:
+ evidence = scenario.get("evidence")
+ observations = evidence.get("observations") if isinstance(evidence, dict) else None
+ if isinstance(observations, dict):
+ return observations
+ raise v5.AttestationError(f"scenario {name} has no typed observations")
+
+
+def _positive_int(value: Any, label: str) -> int:
+ if not isinstance(value, int) or isinstance(value, bool) or value <= 0:
+ raise v5.AttestationError(f"{label} must be a positive integer")
+ return value
+
+
+def _sha256(value: Any, label: str) -> str:
+ if not isinstance(value, str) or not v5.SHA256_RE.fullmatch(value):
+ raise v5.AttestationError(f"{label} must be a SHA-256 digest")
+ return value
+
+
+def verify_rootful_docker_observations(receipt: dict[str, Any]) -> None:
+ if receipt.get("rootful_container_runtime") != "docker":
+ raise v5.AttestationError("schema-v7 receipt does not bind the qualified rootful runtime")
+ if receipt.get("rootful_container_summary_qualified") is not True:
+ raise v5.AttestationError("schema-v7 receipt does not qualify rootful Docker summary inventory")
+
+ migration = _scenario_observations(receipt, "rootful_docker_summary_migration")
+ legacy_count = _positive_int(migration.get("legacy_container_count"), "legacy Docker container count")
+ migrated_count = _positive_int(migration.get("migrated_container_count"), "migrated Docker container count")
+ legacy_digest = _sha256(migration.get("legacy_inventory_sha256"), "legacy Docker inventory")
+ migrated_digest = _sha256(migration.get("migrated_inventory_sha256"), "migrated Docker inventory")
+ if legacy_count != migrated_count or legacy_digest != migrated_digest:
+ raise v5.AttestationError("rootful Docker migration did not preserve the canonical summary inventory")
+
+ restart = _scenario_observations(receipt, "rootful_docker_summary_restart")
+ pre_restart_count = _positive_int(restart.get("pre_restart_container_count"), "pre-restart Docker container count")
+ post_restart_count = _positive_int(restart.get("post_restart_container_count"), "post-restart Docker container count")
+ pre_restart_digest = _sha256(restart.get("pre_restart_inventory_sha256"), "pre-restart Docker inventory")
+ post_restart_digest = _sha256(restart.get("post_restart_inventory_sha256"), "post-restart Docker inventory")
+ pre_pid = restart.get("pre_restart_helper_pid")
+ post_pid = restart.get("post_restart_helper_pid")
+ if not isinstance(pre_pid, str) or not pre_pid.isdigit() or int(pre_pid) <= 0:
+ raise v5.AttestationError("pre-restart helper PID is invalid")
+ if not isinstance(post_pid, str) or not post_pid.isdigit() or int(post_pid) <= 0 or post_pid == pre_pid:
+ raise v5.AttestationError("helper restart did not prove a changed process identity")
+ stream = restart.get("report_stream_id")
+ if not isinstance(stream, str) or not stream:
+ raise v5.AttestationError("helper restart report stream identity is invalid")
+ pre_sequence = _positive_int(restart.get("pre_restart_sequence"), "pre-restart report sequence")
+ post_sequence = _positive_int(restart.get("post_restart_sequence"), "post-restart report sequence")
+ if (
+ pre_restart_count != migrated_count
+ or post_restart_count != migrated_count
+ or pre_restart_digest != migrated_digest
+ or post_restart_digest != migrated_digest
+ or post_sequence <= pre_sequence
+ ):
+ raise v5.AttestationError("rootful Docker summary did not survive the helper restart")
+
+ recovery = _scenario_observations(receipt, "rootful_docker_helper_loss_recovery")
+ pre_loss_count = _positive_int(recovery.get("pre_loss_container_count"), "pre-loss Docker container count")
+ recovered_count = _positive_int(recovery.get("recovered_container_count"), "recovered Docker container count")
+ pre_loss_digest = _sha256(recovery.get("pre_loss_inventory_sha256"), "pre-loss Docker inventory")
+ recovered_digest = _sha256(recovery.get("recovered_inventory_sha256"), "recovered Docker inventory")
+ loss_sequence = _positive_int(recovery.get("loss_sequence"), "helper-loss report sequence")
+ recovery_sequence = _positive_int(recovery.get("recovery_sequence"), "helper-recovery report sequence")
+ if recovery.get("report_stream_id") != stream:
+ raise v5.AttestationError("helper loss/recovery changed the Docker report stream")
+ if (
+ pre_loss_count != migrated_count
+ or recovered_count != migrated_count
+ or pre_loss_digest != migrated_digest
+ or recovered_digest != migrated_digest
+ or recovery_sequence <= loss_sequence
+ or loss_sequence <= post_sequence
+ ):
+ raise v5.AttestationError("rootful Docker helper loss/recovery evidence is not causally monotonic")
+
+
+def load_attested_receipt(path: Path, attestation: dict[str, Any]) -> dict[str, Any]:
+ try:
+ raw = path.read_bytes()
+ except OSError as exc:
+ raise v5.AttestationError(f"unable to load schema-v7 receipt {path}: {exc}") from exc
+ binding = attestation.get("receipt")
+ if not isinstance(binding, dict) or v5.sha256_bytes(raw) != binding.get("sha256"):
+ raise v5.AttestationError("schema-v7 Docker validation receipt bytes differ from the attested receipt")
+ try:
+ receipt = json.loads(raw)
+ except json.JSONDecodeError as exc:
+ raise v5.AttestationError(f"unable to decode schema-v7 receipt {path}: {exc}") from exc
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != RECEIPT_SCHEMA_VERSION:
+ raise v5.AttestationError("rootful Docker validation requires the attested schema-v7 receipt")
+ v5.reject_sensitive_keys(receipt)
+ return receipt
+
+
+def create_attestation(**kwargs: Any) -> dict[str, Any]:
+ with v7_contract():
+ result = _V6_CREATE_ATTESTATION(**kwargs)
+ receipt = load_attested_receipt(Path(kwargs["receipt_path"]), result)
+ verify_rootful_docker_observations(receipt)
+ return result
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ with v7_contract():
+ return v6.main(sys.argv[1:] if argv is None else argv)
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/scripts/release_control/secure_runtime_attestation_v7_test.py b/scripts/release_control/secure_runtime_attestation_v7_test.py
new file mode 100644
index 0000000000..d72613aa42
--- /dev/null
+++ b/scripts/release_control/secure_runtime_attestation_v7_test.py
@@ -0,0 +1,117 @@
+#!/usr/bin/env python3
+"""Focused schema-v7 secure-runtime attestation contract tests."""
+
+from __future__ import annotations
+
+import copy
+import json
+import tempfile
+import unittest
+from pathlib import Path
+from unittest import mock
+
+import secure_runtime_attestation as v5
+import secure_runtime_attestation_v6 as v6
+import secure_runtime_attestation_v7 as v7
+
+
+DIGEST = "1" * 64
+
+
+def valid_receipt() -> dict:
+ observations = {
+ "rootful_docker_summary_migration": {
+ "legacy_container_count": 2,
+ "migrated_container_count": 2,
+ "legacy_inventory_sha256": DIGEST,
+ "migrated_inventory_sha256": DIGEST,
+ },
+ "rootful_docker_summary_restart": {
+ "pre_restart_container_count": 2,
+ "post_restart_container_count": 2,
+ "pre_restart_inventory_sha256": DIGEST,
+ "post_restart_inventory_sha256": DIGEST,
+ "pre_restart_helper_pid": "100",
+ "post_restart_helper_pid": "101",
+ "report_stream_id": "docker-stream",
+ "pre_restart_sequence": 4,
+ "post_restart_sequence": 5,
+ },
+ "rootful_docker_helper_loss_recovery": {
+ "pre_loss_container_count": 2,
+ "recovered_container_count": 2,
+ "pre_loss_inventory_sha256": DIGEST,
+ "recovered_inventory_sha256": DIGEST,
+ "report_stream_id": "docker-stream",
+ "loss_sequence": 6,
+ "recovery_sequence": 7,
+ },
+ }
+ return {
+ "rootful_container_runtime": "docker",
+ "rootful_container_summary_qualified": True,
+ "scenarios": [
+ {"name": name, "evidence": {"observations": value}}
+ for name, value in observations.items()
+ ],
+ }
+
+
+class SecureRuntimeAttestationV7Test(unittest.TestCase):
+ def test_v7_extends_without_mutating_v6(self) -> None:
+ self.assertEqual(v6.RECEIPT_SCHEMA_VERSION, 6)
+ self.assertEqual(len(v6.REQUIRED_SCENARIOS), 20)
+ self.assertEqual(v7.RECEIPT_SCHEMA_VERSION, 7)
+ self.assertEqual(len(v7.REQUIRED_SCENARIOS), 23)
+ self.assertEqual(
+ v7.REQUIRED_SCENARIOS[4:5],
+ ("rootful_docker_summary_migration",),
+ )
+ self.assertEqual(
+ v7.REQUIRED_SCENARIOS[9:11],
+ ("rootful_docker_summary_restart", "rootful_docker_helper_loss_recovery"),
+ )
+
+ def test_correlated_rootful_docker_observations_pass(self) -> None:
+ v7.verify_rootful_docker_observations(valid_receipt())
+
+ def test_correlated_rootful_docker_observations_fail_closed(self) -> None:
+ cases = {
+ "zero inventory": ("rootful_docker_summary_migration", "legacy_container_count", 0),
+ "migration digest mismatch": ("rootful_docker_summary_migration", "migrated_inventory_sha256", "2" * 64),
+ "unchanged helper pid": ("rootful_docker_summary_restart", "post_restart_helper_pid", "100"),
+ "restart sequence regression": ("rootful_docker_summary_restart", "post_restart_sequence", 4),
+ "recovery stream changed": ("rootful_docker_helper_loss_recovery", "report_stream_id", "other-stream"),
+ "recovery sequence regression": ("rootful_docker_helper_loss_recovery", "recovery_sequence", 6),
+ "recovery digest mismatch": ("rootful_docker_helper_loss_recovery", "recovered_inventory_sha256", "2" * 64),
+ }
+ for label, (scenario, key, value) in cases.items():
+ with self.subTest(label=label):
+ receipt = copy.deepcopy(valid_receipt())
+ for item in receipt["scenarios"]:
+ if item["name"] == scenario:
+ item["evidence"]["observations"][key] = value
+ with self.assertRaises(v5.AttestationError):
+ v7.verify_rootful_docker_observations(receipt)
+
+ def test_context_restores_v6_contract(self) -> None:
+ with v7.v7_contract():
+ self.assertEqual(v6.RECEIPT_SCHEMA_VERSION, 7)
+ self.assertEqual(v6.ATTESTATION_TOOL_PATH, v7.ATTESTATION_TOOL_PATH)
+ self.assertEqual(v6.RECEIPT_SCHEMA_VERSION, 6)
+ self.assertEqual(v6.ATTESTATION_TOOL_PATH, "scripts/release_control/secure_runtime_attestation_v6.py")
+
+ def test_create_attestation_rejects_receipt_swapped_after_base_validation(self) -> None:
+ receipt = valid_receipt()
+ receipt["schema_version"] = 7
+ with tempfile.TemporaryDirectory() as directory:
+ path = Path(directory) / "receipt.json"
+ path.write_text(json.dumps(receipt), encoding="utf-8")
+ base_result = {"receipt": {"sha256": "0" * 64}}
+ with mock.patch.object(v7, "_V6_CREATE_ATTESTATION", return_value=base_result):
+ with self.assertRaises(v5.AttestationError):
+ v7.create_attestation(receipt_path=path)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/release_control/secure_runtime_source_manifest_v7.json b/scripts/release_control/secure_runtime_source_manifest_v7.json
new file mode 100644
index 0000000000..cd04dddf80
--- /dev/null
+++ b/scripts/release_control/secure_runtime_source_manifest_v7.json
@@ -0,0 +1,82 @@
+{
+ "schema_version": 1,
+ "manifest_id": "secure-runtime-linux-v7",
+ "target_os": "linux",
+ "description": "Production source boundary for the secure collector, typed helper, action runner, rootful Docker summary inventory, signed update trust and build inputs, control-plane admission, and schema-v7 qualification harness.",
+ "exact_paths": [
+ ".github/workflows/build-release-candidate.yml",
+ ".github/workflows/compile-release-payload.yml",
+ ".github/workflows/create-release.yml",
+ ".github/workflows/qualify-secure-runtime-release.yml",
+ "VERSION",
+ "go.mod",
+ "go.sum",
+ "internal/models/converters.go",
+ "internal/models/models.go",
+ "internal/models/models_frontend.go",
+ "internal/monitoring/monitor.go",
+ "internal/monitoring/monitor_agents.go",
+ "internal/unifiedresources/adapters.go",
+ "internal/unifiedresources/types.go",
+ "internal/unifiedresources/views.go",
+ "pkg/agents/docker/report.go",
+ "scripts/install.sh",
+ "scripts/install.ps1",
+ "scripts/install-container-agent.sh",
+ "scripts/install-docker.sh",
+ "scripts/install-mcp.sh",
+ "scripts/install-mcp.ps1",
+ "scripts/installtests/secure_runtime_systemd_lab_test.go",
+ "scripts/installtests/testdata/secure_runtime_docker_fixture.go",
+ "scripts/backfill-release-assets.sh",
+ "scripts/build-release-binaries.sh",
+ "scripts/build-release.sh",
+ "scripts/build-secure-runtime-qualification.sh",
+ "scripts/check-github-release-immutability.sh",
+ "scripts/package-helm-chart.sh",
+ "scripts/prepare-release-container-context.sh",
+ "scripts/pulse-auto-update.sh",
+ "scripts/release_asset_common.sh",
+ "scripts/release_build_targets.sh",
+ "scripts/release_candidate_manifest.py",
+ "scripts/release_control/secure_runtime_attestation.py",
+ "scripts/release_control/secure_runtime_attestation_v6.py",
+ "scripts/release_control/secure_runtime_attestation_v7.py",
+ "scripts/release_control/secure_runtime_source_manifest_v7.json",
+ "scripts/release_ldflags.sh",
+ "scripts/release_update_key.go",
+ "scripts/render_installers.go",
+ "scripts/require-safe-gh-attestation.sh",
+ "scripts/validate-published-release.sh",
+ "scripts/validate-release.sh",
+ "scripts/verify-github-release-integrity.sh"
+ ],
+ "recursive_roots": [
+ "cmd/pulse-agent",
+ "cmd/pulse-agent-helper",
+ "cmd/pulse-agent-runner",
+ "internal/actionrunner",
+ "internal/agentexec",
+ "internal/agenthelper",
+ "internal/agenttls",
+ "internal/agentupdate",
+ "internal/api",
+ "internal/collectorlifecycle",
+ "internal/config",
+ "internal/dockeragent",
+ "internal/hostagent",
+ "internal/operationreceipt",
+ "internal/securityutil",
+ "internal/updatesignature",
+ "pkg/auth",
+ "pkg/securityutil",
+ "pkg/tlsutil"
+ ],
+ "include_suffixes": [
+ ".go",
+ ".tmpl"
+ ],
+ "exclude_suffixes": [
+ "_test.go"
+ ]
+}