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.

Authenticate Helm recovery from immutable release evidence

pulse-triage[bot]1a89bc8ff36e
diff --git a/.github/workflows/helm-pages.yml b/.github/workflows/helm-pages.yml
index aceec457f9..4b7ddc7dbe 100644
--- a/.github/workflows/helm-pages.yml
+++ b/.github/workflows/helm-pages.yml
@@ -42,7 +42,7 @@ jobs:
with:
persist-credentials: false
- - name: Require activated GitHub release and source run
+ - name: Require authenticated activated release packet
id: identity
env:
GH_TOKEN: ${{ github.token }}
@@ -63,46 +63,41 @@ jobs:
release_tag="v${VERSION}"
release_state="$(
gh api "repos/${{ github.repository }}/releases/tags/${release_tag}" \
- --jq '[.tag_name, .target_commitish, (.draft | tostring), (.published_at // "")] | @tsv'
+ --jq '[.tag_name, .target_commitish, (.draft | tostring), (.published_at // ""), .id] | @tsv'
)"
actual_tag="$(awk -F '\t' '{print $1}' <<<"${release_state}")"
actual_commit="$(awk -F '\t' '{print $2}' <<<"${release_state}")"
is_draft="$(awk -F '\t' '{print $3}' <<<"${release_state}")"
published_at="$(awk -F '\t' '{print $4}' <<<"${release_state}")"
+ release_id="$(awk -F '\t' '{print $5}' <<<"${release_state}")"
if [[ "${actual_tag}" != "${release_tag}" ]] || \
[[ "${actual_commit}" != "${TARGET_COMMITISH}" ]] || \
[[ "${is_draft}" != "false" ]] || \
- [[ -z "${published_at}" ]]; then
+ [[ -z "${published_at}" ]] || \
+ [[ ! "${release_id}" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::Helm Pages refuses to advertise inactive or mismatched release ${release_tag}."
exit 1
fi
marker="$(mktemp)"
+ trap 'rm -f "${marker}"' EXIT
curl -fsSL --retry 4 --retry-delay 2 --retry-all-errors \
-o "${marker}" \
"https://github.com/${{ github.repository }}/releases/download/${release_tag}/release-activation.json"
+ # Authenticate these exact bytes, the immutable packet and its
+ # hosted source provenance before consuming the marker. A live
+ # Actions source-run record is not a durable recovery boundary.
+ ./scripts/verify-github-release-integrity.sh \
+ "${release_tag}" "${GITHUB_REPOSITORY}" "${release_id}" \
+ "${TARGET_COMMITISH}" "${marker}"
jq -e \
--arg tag "${release_tag}" \
+ --arg release_id "${release_id}" \
--arg target_commitish "${TARGET_COMMITISH}" \
--arg source_release_run_id "${SOURCE_RELEASE_RUN_ID}" \
--arg helm_chart_digest "${CHART_DIGEST}" \
- '.schema_version == 1 and .tag == $tag and .target_commitish == $target_commitish and .source_release_run_id == $source_release_run_id and .helm_chart_digest == $helm_chart_digest' \
+ '.schema_version == 1 and .tag == $tag and .release_id == $release_id and .target_commitish == $target_commitish and .source_release_run_id == $source_release_run_id and .helm_chart_digest == $helm_chart_digest' \
"${marker}" >/dev/null
- rm -f "${marker}"
-
- source_run="$(
- gh api "repos/${{ github.repository }}/actions/runs/${SOURCE_RELEASE_RUN_ID}" \
- --jq '[.path, .event, .head_sha] | @tsv'
- )"
- run_path="$(awk -F '\t' '{print $1}' <<<"${source_run}")"
- run_event="$(awk -F '\t' '{print $2}' <<<"${source_run}")"
- run_sha="$(awk -F '\t' '{print $3}' <<<"${source_run}")"
- if [[ "${run_path}" != ".github/workflows/create-release.yml" ]] || \
- [[ "${run_event}" != "workflow_dispatch" ]] || \
- [[ "${run_sha}" != "${TARGET_COMMITISH}" ]]; then
- echo "::error::Source release run ${SOURCE_RELEASE_RUN_ID} does not own the activated ${release_tag} chart."
- exit 1
- fi
validated_version="${VERSION}"
python3 scripts/write_github_output.py version "${validated_version}"
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 27151d2f66..2ff77d67f5 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -1213,6 +1213,27 @@ the selection and budget cases run in `scripts/tests/test-ci-benchmarks.sh`.
### Public Helm exact-package receipt
+Helm Pages admission uses the immutable published packet, not the continued
+availability of its old Actions source-run record. The identity step authenticates
+the exact downloaded activation marker with `verify-github-release-integrity.sh`,
+bound to the observed release ID, tag and expected source SHA, before parsing it
+or writing outputs. It then requires that marker's release ID, source-run ID and
+chart digest to match the requested identity. The existing verifier still requires
+signed release/asset evidence and canonical hosted checksum provenance; subsequent
+OCI recovery still requires exact chart digest, canonical chart-publisher provenance
+and source SHA. No unverifiable packet may fall back to an Actions lookup, another
+credential, or unchecked chart metadata.
+
+The workflow previously depended on the source Actions record even though chart
+recovery already used durable OCI provenance. A current read of the stable source
+run returns 404; that establishes unavailability, not deletion or its cause.
+`HelmPagesIdentityTests` executes the identity shell and real packet verifier with
+offline CLI fixtures for unavailable source runs, legacy/portable provenance,
+tampered consumed marker bytes, verification refusals and mismatched identities.
+This is source repair proof, not a claim that the historical Helm HTTP404 has been
+attributed or that public Pages, reconciliation, demo credentials or a release
+have recovered.
+
The post-activation public Pages verification in `.github/workflows/helm-pages.yml`
must pull the requested chart version through the consumer repository and compare
its archive bytes with the package already recovered through OCI qualification.
diff --git a/scripts/release_control/helm_pages_retry_test.py b/scripts/release_control/helm_pages_retry_test.py
index 2625cf3fa2..798e50987e 100644
--- a/scripts/release_control/helm_pages_retry_test.py
+++ b/scripts/release_control/helm_pages_retry_test.py
@@ -6,6 +6,7 @@ import hashlib
import json
import os
from pathlib import Path
+import shutil
import subprocess
import tempfile
import textwrap
@@ -16,6 +17,173 @@ CHART = b"qualified chart fixture"
DIGEST = "sha256:" + hashlib.sha256(CHART).hexdigest()
+class HelmPagesIdentityTests(unittest.TestCase):
+ """Run the workflow identity step and its real packet verifier offline."""
+
+ def run_identity(self, *, release_updates=None, marker_updates=None,
+ tampered_marker=False, verification="pass",
+ portable=False, source_available=False, workflow=None):
+ workflow = workflow or (ROOT / ".github/workflows/helm-pages.yml").read_text()
+ step = workflow.split(" id: identity\n", 1)[1]
+ script = textwrap.dedent(step.split(" run: |\n", 1)[1].split(
+ " - name:", 1)[0]).replace("${{ github.repository }}", "rcourtman/Pulse")
+ script += '\nprintf "IDENTITY_BOUNDARY\\n"\n'
+ marker = {"schema_version": 1, "tag": "v6.5.0", "release_id": "123",
+ "target_commitish": "a" * 40, "source_release_run_id": "200",
+ "helm_chart_digest": DIGEST}
+ marker.update(marker_updates or {})
+ signed_marker = json.dumps(marker).encode()
+ downloaded_marker = signed_marker + (b"\n" if tampered_marker else b"")
+ release = {"id": 123, "tag_name": "v6.5.0", "target_commitish": "a" * 40,
+ "draft": False, "published_at": "2026-10-06T00:54:36Z",
+ "immutable": True, "assets": [{"name": "release-activation.json",
+ "state": "uploaded", "size": len(signed_marker),
+ "digest": "sha256:" + hashlib.sha256(signed_marker).hexdigest()}]}
+ if portable:
+ release["assets"].append({"name": "release-build-provenance.sigstore.json",
+ "state": "uploaded", "size": 30,
+ "digest": "sha256:" + "b" * 64})
+ release.update(release_updates or {})
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ (root / "scripts").mkdir()
+ for name in ("verify-github-release-integrity.sh", "require-safe-gh-attestation.sh",
+ "write_github_output.py"):
+ shutil.copy2(ROOT / "scripts" / name, root / "scripts" / name)
+ (root / "release.json").write_text(json.dumps(release))
+ (root / "downloaded-marker.json").write_bytes(downloaded_marker)
+ gh = root / "gh"
+ gh.write_text(textwrap.dedent('''\
+ #!/usr/bin/env python3
+ import hashlib, json, os, pathlib, subprocess, sys
+ args = sys.argv[1:]
+ with open("calls.jsonl", "a") as log:
+ log.write(json.dumps(args) + "\\n")
+ if args == ["version"]:
+ print("gh version 2.97.0 (test)")
+ elif args[0] == "api":
+ endpoint = next(a for a in args if a.startswith("repos/"))
+ if os.environ["VERIFICATION"] == "api":
+ print("gh: Not Found (HTTP 404)", file=sys.stderr)
+ sys.exit(1)
+ if "/actions/runs/" in endpoint:
+ if os.environ["SOURCE_AVAILABLE"] != "true":
+ print("gh: Not Found (HTTP 404)", file=sys.stderr)
+ sys.exit(1)
+ payload = {"path": ".github/workflows/create-release.yml",
+ "event": "workflow_dispatch", "head_sha": "a" * 40}
+ else:
+ assert endpoint == "repos/rcourtman/Pulse/releases/tags/v6.5.0", args
+ payload = json.loads(pathlib.Path("release.json").read_text())
+ if "--jq" in args:
+ result = subprocess.run(["jq", "-r", args[args.index("--jq") + 1]],
+ input=json.dumps(payload), text=True)
+ sys.exit(result.returncode)
+ print(json.dumps(payload))
+ elif args[:2] == ["release", "verify"]:
+ if os.environ["VERIFICATION"] == "release": sys.exit(1)
+ print('{"verified": true}')
+ elif args[:2] == ["release", "download"]:
+ dest = pathlib.Path(args[args.index("--dir") + 1])
+ assert "release-activation.json" not in args, "must verify consumed marker"
+ (dest / "checksums.txt").write_text("fixture checksum manifest\\n")
+ if "release-build-provenance.sigstore.json" in args:
+ (dest / "release-build-provenance.sigstore.json").write_text("fixture bundle")
+ elif args[:2] == ["release", "verify-asset"]:
+ asset = pathlib.Path(args[3])
+ if asset.name == "release-activation.json":
+ digest = hashlib.sha256(asset.read_bytes()).hexdigest()
+ pathlib.Path("consumed-marker.sha256").write_text(digest)
+ if digest != os.environ["SIGNED_MARKER_SHA256"]: sys.exit(1)
+ if os.environ["VERIFICATION"] == "asset": sys.exit(1)
+ print('{"verified": true}')
+ elif args[:2] == ["attestation", "verify"]:
+ assert "--deny-self-hosted-runners" in args, args
+ assert args[args.index("--source-digest") + 1] == "a" * 40, args
+ portable = os.environ["PORTABLE"] == "true"
+ signer = "build-release-candidate.yml" if portable else "create-release.yml"
+ assert args[args.index("--signer-workflow") + 1] == (
+ "github.com/rcourtman/Pulse/.github/workflows/" + signer), args
+ assert ("--bundle" in args) == portable, args
+ assert args[args.index("--predicate-type") + 1] == "https://slsa.dev/provenance/v1", args
+ if os.environ["VERIFICATION"] == "provenance": sys.exit(1)
+ else:
+ raise AssertionError(args)
+ '''))
+ curl = root / "curl"
+ curl.write_text(textwrap.dedent('''\
+ #!/usr/bin/env python3
+ import pathlib, sys
+ args = sys.argv[1:]
+ assert args[-1] == "https://github.com/rcourtman/Pulse/releases/download/v6.5.0/release-activation.json", args
+ pathlib.Path(args[args.index("-o") + 1]).write_bytes(
+ pathlib.Path("downloaded-marker.json").read_bytes())
+ '''))
+ gh.chmod(0o755)
+ curl.chmod(0o755)
+ output = root / "output"
+ env = {"PATH": f"{root}:{os.environ['PATH']}", "VERSION": "6.5.0",
+ "GITHUB_REPOSITORY": "rcourtman/Pulse", "GITHUB_OUTPUT": str(output),
+ "SOURCE_RELEASE_RUN_ID": "200", "TARGET_COMMITISH": "a" * 40,
+ "CHART_DIGEST": DIGEST, "PULSE_RELEASE_ATTESTATION_ATTEMPTS": "1",
+ "PULSE_RELEASE_ATTESTATION_RETRY_DELAY": "0", "VERIFICATION": verification,
+ "SOURCE_AVAILABLE": str(source_available).lower(), "PORTABLE": str(portable).lower(),
+ "SIGNED_MARKER_SHA256": hashlib.sha256(signed_marker).hexdigest()}
+ result = subprocess.run(["bash", "-c", script], cwd=root, env=env,
+ capture_output=True, text=True)
+ calls_file = root / "calls.jsonl"
+ calls = [json.loads(line) for line in calls_file.read_text().splitlines()] if calls_file.exists() else []
+ return result, calls, output.read_text() if output.exists() else ""
+
+ def test_authenticated_packet_does_not_require_live_source_run(self):
+ for portable in (False, True):
+ with self.subTest(portable=portable):
+ result, calls, output = self.run_identity(portable=portable)
+ self.assertEqual(result.returncode, 0, result.stderr)
+ self.assertIn("IDENTITY_BOUNDARY", result.stdout)
+ self.assertIn("v6.5.0", output)
+ self.assertFalse(any("/actions/runs/" in a for c in calls for a in c))
+ self.assertTrue(any(c[:2] == ["release", "verify-asset"] for c in calls))
+ self.assertTrue(any(c[:2] == ["attestation", "verify"] for c in calls))
+
+ def test_tampered_consumed_marker_cannot_reach_outputs(self):
+ result, _, output = self.run_identity(tampered_marker=True, source_available=True)
+ self.assertNotEqual(result.returncode, 0)
+ self.assertIn("activation asset verification failed", result.stderr)
+ self.assertNotIn("IDENTITY_BOUNDARY", result.stdout)
+ self.assertEqual(output, "")
+
+ def test_packet_or_provenance_refusal_cannot_reach_outputs(self):
+ for verification in ("api", "release", "asset", "provenance"):
+ with self.subTest(verification=verification):
+ result, calls, output = self.run_identity(verification=verification)
+ self.assertNotEqual(result.returncode, 0)
+ self.assertNotIn("IDENTITY_BOUNDARY", result.stdout)
+ self.assertEqual(output, "")
+ if verification == "api":
+ self.assertEqual(len(calls), 1, "an unavailable release must not seek a fallback")
+
+ def test_wrong_release_identity_cannot_reach_outputs(self):
+ for updates in ({"draft": True}, {"immutable": False}, {"published_at": ""},
+ {"tag_name": "v6.4.5"}, {"target_commitish": "b" * 40},
+ {"id": None}, {"id": 0}):
+ with self.subTest(updates=updates):
+ result, _, output = self.run_identity(release_updates=updates)
+ self.assertNotEqual(result.returncode, 0)
+ self.assertNotIn("IDENTITY_BOUNDARY", result.stdout)
+ self.assertEqual(output, "")
+
+ def test_authenticated_but_wrong_marker_identity_cannot_reach_outputs(self):
+ for updates in ({"schema_version": 2}, {"tag": "v6.4.5"}, {"release_id": "124"},
+ {"target_commitish": "b" * 40}, {"source_release_run_id": "201"},
+ {"helm_chart_digest": "sha256:" + "c" * 64}):
+ with self.subTest(updates=updates):
+ result, _, output = self.run_identity(marker_updates=updates)
+ self.assertNotEqual(result.returncode, 0)
+ self.assertNotIn("IDENTITY_BOUNDARY", result.stdout)
+ self.assertEqual(output, "")
+
+
class HelmPagesRetryTests(unittest.TestCase):
def run_publication(self, *, draft=False, digest=DIGEST, prerelease=False,
version="6.4.3", exists=True):
diff --git a/scripts/release_control/release_promotion_policy_test.py b/scripts/release_control/release_promotion_policy_test.py
index cf96cbf8cf..405a8bcd5d 100644
--- a/scripts/release_control/release_promotion_policy_test.py
+++ b/scripts/release_control/release_promotion_policy_test.py
@@ -3142,7 +3142,7 @@ class ReleasePromotionPolicyTest(unittest.TestCase):
self.assertNotIn("go build", preview_deploy)
self.assertNotIn("scp ", preview_deploy)
self.assertIn("validate_artifact_release_line.py", helm)
- self.assertIn(".github/workflows/create-release.yml", helm_pages)
+ self.assertIn("./scripts/verify-github-release-integrity.sh", helm_pages)
self.assertIn("release-activation.json", helm_pages)
self.assertNotIn('gh run download "${SOURCE_RELEASE_RUN_ID}"', helm_pages)
self.assertIn('"${GITHUB_REPOSITORY}" "${CHART_DIGEST}" "${CHART_PATH}"', helm_pages)
@@ -3164,7 +3164,9 @@ class ReleasePromotionPolicyTest(unittest.TestCase):
self.assertNotIn('gh run download "${SOURCE_RELEASE_RUN_ID}"', helm_pages)
self.assertIn('"${GITHUB_REPOSITORY}" "${CHART_DIGEST}" "${CHART_PATH}"', helm_pages)
self.assertIn("release-activation.json", helm_pages)
- self.assertIn(".github/workflows/create-release.yml", helm_pages)
+ self.assertIn('"${release_tag}" "${GITHUB_REPOSITORY}" "${release_id}"', helm_pages)
+ self.assertIn('"${TARGET_COMMITISH}" "${marker}"', helm_pages)
+ self.assertNotIn('actions/runs/${SOURCE_RELEASE_RUN_ID}', helm_pages)
self.assertNotIn('git pull --rebase origin "$REQUIRED_BRANCH"', helm_pages)
self.assertNotIn('git push origin HEAD:"$REQUIRED_BRANCH"', helm_pages)
self.assertNotIn("HELM_DOCS_VERSION", helm_pages)