The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
release: pin the Linux release key and document the apt repository
Claude1adad809e173
diff --git a/CLAUDE.md b/CLAUDE.mdindex a2ddec1b..cdb2eea6 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -373,10 +373,15 @@ Optional: `BEACON_LINUX_SIGNING_KEY` (ASCII-armored OpenPGP secret key) andLinux signing is trusted only through the fingerprints, one per line, in`cli/beacon/internal/endpoint/selfupdate/release-key.fingerprint`. Theself-updater embeds that file and the goreleaser before-hook stamps it into the-released `install.sh`, so pinning is a change to that file alone. Empty means-checksum-only, as before. Once set, `install.sh` and `beacon endpoint update---apply` on Linux refuse a package unless a `checksums.txt` signed by a pinned-key lists it. Publish the fingerprint in `docs/platforms/linux.mdx#release-signing`.+released `install.sh`, so pinning is a change to that file alone. It pins+`07BEA34ED6A411F4C066D98322F94195DCDC8F45` (Beacon Linux Release Signing, RSA 4096),+the key that has signed releases since v1.3.57 and the apt repository; that same key's+public half is `packaging/linux/apt/beacon-archive-keyring.asc`. `install.sh` and+`beacon endpoint update --apply` on Linux refuse a package unless a `checksums.txt`+signed by a pinned key lists it, so every release must be signed (a release without+`BEACON_LINUX_SIGNING_KEY` fails in the goreleaser job), and the installer refuses the+unsigned releases before v1.3.57. The fingerprint is published in+`docs/platforms/linux.mdx#release-signing`; change both together.To rotate, add the new fingerprint in a release still signed by the old key. Thensign `checksums.txt` with both keys and ship both in `beacon-release-key.gpg` (theGoReleaser `signs` entry and the `finalize` step sign with one key today, so extenddiff --git a/README.md b/README.mdindex c312bdff..fc964194 100644--- a/README.md+++ b/README.md@@ -135,7 +135,7 @@ grep " ${PKG}$" checksums.txt | sha256sum --check - && \sudo apt install "./${PKG}" # or: sudo dnf install "./${PKG}"```-`checksums.txt` is published with the release, so it catches a corrupted or swapped download but does not prove who built the release. To check that, verify the package's build-provenance attestation, which shows it was built by this repository's release workflow: `gh attestation verify "${PKG}" --repo asymptote-labs/agent-beacon`. You can also pin `VERSION` to a release you have reviewed instead of following `latest`. To install without root, use the tarball in user mode ([Linux install guide](https://docs.asymptotelabs.ai/platforms/linux#without-root-or-without-a-package-manager)).+`checksums.txt` on its own catches a corrupted download but does not prove who built the release. From 1.3.57 on, `checksums.txt.sig` signs it with Beacon's Linux release key (fingerprint `07BEA34ED6A411F4C066D98322F94195DCDC8F45`), which `install.sh` checks; the [Linux install guide](https://docs.asymptotelabs.ai/platforms/linux#release-signing) shows how to check it by hand and how to install from the signed apt repository instead. You can also verify the package's build-provenance attestation, which shows it was built by this repository's release workflow: `gh attestation verify "${PKG}" --repo asymptote-labs/agent-beacon`. You can also pin `VERSION` to a release you have reviewed instead of following `latest`. To install without root, use the tarball in user mode ([Linux install guide](https://docs.asymptotelabs.ai/platforms/linux#without-root-or-without-a-package-manager)).</details>diff --git a/cli/beacon/internal/endpoint/selfupdate/apply_test.go b/cli/beacon/internal/endpoint/selfupdate/apply_test.goindex 96fdaf83..00bece6b 100644--- a/cli/beacon/internal/endpoint/selfupdate/apply_test.go+++ b/cli/beacon/internal/endpoint/selfupdate/apply_test.go@@ -380,6 +380,7 @@ func TestVerifyGatekeeperFailsStaplerValidationFailure(t *testing.T) {}func TestApplyRestartsCollectorBeforeHealthCheck(t *testing.T) {+ withoutReleaseKeyPin(t) // covers the restart and rollback, not the signature checkartifact, sha := makeBeaconTarball(t, "9.9.9")// The production install path, not the extraction seam -- the stubbed runner below stands in// for the platform's installer. So the artifact has to be named like one this host installs.@@ -681,6 +682,7 @@ func TestSelectArtifactOnDarwinUsesTheArchKeyUnchanged(t *testing.T) {// them again. An update whose install fails never reaches that postinstall, so the rollback has to// bring them back itself, or forwarding stays off until the Mac reboots.func TestApplyRollbackRestoresScriptForwarders(t *testing.T) {+ withoutReleaseKeyPin(t) // covers the restart and rollback, not the signature checkartifact, sha := makeBeaconTarball(t, "9.9.9")srv := nativeManifestServer(t, "9.9.9", sha, artifact)defer srv.Close()diff --git a/cli/beacon/internal/endpoint/selfupdate/linuxsig_test.go b/cli/beacon/internal/endpoint/selfupdate/linuxsig_test.goindex 58ba5e55..9f45186d 100644--- a/cli/beacon/internal/endpoint/selfupdate/linuxsig_test.go+++ b/cli/beacon/internal/endpoint/selfupdate/linuxsig_test.go@@ -89,3 +89,78 @@ func TestVerifyReleaseSignature(t *testing.T) {t.Fatal("tampered checksums.txt accepted")}}++// withoutReleaseKeyPin clears the embedded pin for a test that exercises another part of Apply+// against a test server that serves no signed checksums.txt.+func withoutReleaseKeyPin(t *testing.T) {+ t.Helper()+ old := releaseKeyFingerprints+ releaseKeyFingerprints = nil+ t.Cleanup(func() { releaseKeyFingerprints = old })+}++// The pin is Beacon's release key, and the docs and the apt repository's committed key name the+// same one, so none of them can be changed alone.+func TestReleaseKeyPinMatchesPublishedKey(t *testing.T) {+ const want = "07BEA34ED6A411F4C066D98322F94195DCDC8F45"+ if len(releaseKeyFingerprints) != 1 || releaseKeyFingerprints[0] != want {+ t.Fatalf("release-key.fingerprint pins %v, want [%s]", releaseKeyFingerprints, want)+ }+ repo := filepath.Join("..", "..", "..", "..", "..")+ docs, err := os.ReadFile(filepath.Join(repo, "docs", "platforms", "linux.mdx"))+ if err != nil {+ t.Fatal(err)+ }+ if !strings.Contains(string(docs), want) {+ t.Errorf("docs/platforms/linux.mdx does not publish the pinned fingerprint %s", want)+ }+ if _, err := exec.LookPath("gpg"); err != nil {+ t.Skip("gpg is not installed; skipping the apt keyring check")+ }+ out, err := exec.Command("gpg", "--batch", "--homedir", t.TempDir(), "--with-colons", "--show-keys",+ filepath.Join(repo, "packaging", "linux", "apt", "beacon-archive-keyring.asc")).Output()+ if err != nil {+ t.Fatalf("gpg --show-keys: %v", err)+ }+ var primary []string+ lines := strings.Split(string(out), "\n")+ for i, line := range lines {+ if strings.HasPrefix(line, "pub:") && i+1 < len(lines) && strings.HasPrefix(lines[i+1], "fpr:") {+ primary = append(primary, strings.Split(lines[i+1], ":")[9])+ }+ }+ if len(primary) != 1 || primary[0] != want {+ t.Errorf("beacon-archive-keyring.asc holds %v, want [%s]", primary, want)+ }+}++// With the real pin, a Linux update refuses a release that has no signed checksums.txt and never+// runs the package installer.+func TestApplyRefusesUnsignedReleaseOnLinux(t *testing.T) {+ if runtime.GOOS != "linux" {+ t.Skip("release signatures are verified on Linux only")+ }+ artifact, sha := makeBeaconTarball(t, "9.9.9")+ srv := nativeManifestServer(t, "9.9.9", sha, artifact)+ defer srv.Close()++ a := NewApplier("0.0.1")+ a.ManifestURL = srv.URL + "/manifest.json"+ a.StageDir = t.TempDir()+ a.InstallPrefix = t.TempDir()+ a.LogPath = filepath.Join(t.TempDir(), "system.jsonl")+ var installed []string+ a.run = func(_ context.Context, name string, _ ...string) (string, error) {+ installed = append(installed, filepath.Base(name))+ return "", nil+ }+ _, err := a.Apply(context.Background())+ if err == nil || !strings.Contains(err.Error(), "verify release signature") {+ t.Fatalf("Apply error = %v, want a release signature failure", err)+ }+ for _, name := range installed {+ if name == "dpkg" || name == "rpm" {+ t.Fatalf("ran %s before the signature check passed", name)+ }+ }+}diff --git a/cli/beacon/internal/endpoint/selfupdate/release-key.fingerprint b/cli/beacon/internal/endpoint/selfupdate/release-key.fingerprintindex e69de29b..4d891346 100644--- a/cli/beacon/internal/endpoint/selfupdate/release-key.fingerprint+++ b/cli/beacon/internal/endpoint/selfupdate/release-key.fingerprint@@ -0,0 +1 @@+07BEA34ED6A411F4C066D98322F94195DCDC8F45diff --git a/docs/platforms/linux.mdx b/docs/platforms/linux.mdxindex 2b76d808..884660f9 100644--- a/docs/platforms/linux.mdx+++ b/docs/platforms/linux.mdx@@ -43,6 +43,25 @@ grep " ${PKG}$" checksums.txt | sha256sum --check - && sudo dnf install "./${PKAPT reads a local package as its unprivileged `_apt` user. If the `.deb` sits somewhere `_apt` cannot read, such as your home directory, the install still succeeds, but APT ends with `Download is performed unsandboxed as root` and `pkgAcquire::Run (13: Permission denied)`. That is a warning, not a failure, and there is nothing to repair; `beacon version` confirms the install. The installer and the Debian block above download into a readable directory under `/tmp` so the warning does not appear.</Note>+### From the apt repository (Debian, Ubuntu)++Beacon also publishes a signed apt repository at `https://apt.beacon.sh`, so `apt` installs the package and brings later releases in with your other updates. Download the repository key and check that it is Beacon's release key before you trust it. The second command must print `07BEA34ED6A411F4C066D98322F94195DCDC8F45` (see [Release signing](#release-signing)):++```bash title="Fetch and check the repository key"+curl -fsSL https://apt.beacon.sh/beacon-archive-keyring.gpg -o /tmp/beacon-archive-keyring.gpg+gpg --show-keys --with-colons /tmp/beacon-archive-keyring.gpg | awk -F: '$1 == "fpr" { print $10 }'+```++Then add the repository and install:++```bash title="Add the repository and install"+sudo install -m 0644 /tmp/beacon-archive-keyring.gpg /usr/share/keyrings/beacon-archive-keyring.gpg+echo "deb [signed-by=/usr/share/keyrings/beacon-archive-keyring.gpg] https://apt.beacon.sh stable main" | sudo tee /etc/apt/sources.list.d/beacon.list+sudo apt update && sudo apt install beacon+```++`apt` refuses the repository's index unless that key signed it, and checks every package against the index. The package is the same `.deb` the release publishes, so the install sets up the system service exactly as above, and `sudo apt upgrade` updates it. The repository starts at 1.3.57; for an older release, use the installer with `BEACON_VERSION` or the manual steps.+### Without root, or without a package managerIf you are not an administrator on the machine, or you would rather not touch system paths, use the tarball and install in user mode:@@ -267,20 +286,25 @@ sudo beacon endpoint update --checksudo beacon endpoint update --apply```-`--apply` downloads the release package for your platform, verifies its SHA-256, installs it with `dpkg` or `rpm`, restarts the collector, and rolls back if the new version fails its health check. Verification is checksum-over-HTTPS from GitHub Releases, the same trust root you used to download the package in the first place. macOS additionally verifies Apple notarization. On Linux, once a build pins the release key (see [Release signing](#release-signing)), the package must also be listed in a `checksums.txt` signed by that key, which needs `gpgv`. `beacon endpoint update` reports which verification it performed (`sha256`, `sha256+gpg` or `sha256+notarization`) rather than implying more.+`--apply` downloads the release package for your platform, verifies its SHA-256, installs it with `dpkg` or `rpm`, restarts the collector, and rolls back if the new version fails its health check. Verification is checksum-over-HTTPS from GitHub Releases, the same trust root you used to download the package in the first place. macOS additionally verifies Apple notarization. On Linux, builds after 1.3.57 pin the release key (see [Release signing](#release-signing)), so the package must also be listed in a `checksums.txt` signed by that key, which needs `gpgv`. `beacon endpoint update` reports which verification it performed (`sha256`, `sha256+gpg` or `sha256+notarization`) rather than implying more.## Release signing-Signing is wired into the release but not yet active: Beacon has no Linux release key yet, so current `.deb`, `.rpm` and `checksums.txt` files are unsigned, and the installer and `beacon endpoint update` check checksums only. This section applies once a release publishes the key. A signed release never becomes the latest release without its signature: GoReleaser signs `checksums.txt` and attaches the signature and the public key before it publishes the release, and when the macOS and Windows packages are added later, `checksums.txt` is signed again before the extended file replaces it.+Releases from 1.3.57 on are signed with Beacon's Linux release key:++```text title="Release key"+Beacon Linux Release Signing <[email protected]>+RSA 4096, fingerprint 07BE A34E D6A4 11F4 C066 D983 22F9 4195 DCDC 8F45+```-A signed release carries `checksums.txt.sig` (a detached OpenPGP signature over `checksums.txt`) and the public key as `beacon-release-key.asc` and `beacon-release-key.gpg`. The `.rpm` carries an RPM signature and the `.deb` a `_gpgorigin` signature member, both from the same key. Release key fingerprint: _not yet published_.+A signed release carries `checksums.txt.sig` (a detached OpenPGP signature over `checksums.txt`) and the public key as `beacon-release-key.asc` and `beacon-release-key.gpg`. The `.rpm` carries an RPM signature and the `.deb` a `_gpgorigin` signature member, both from the same key, and the same key signs the [apt repository](#from-the-apt-repository-debian-ubuntu). A signed release never becomes the latest release without its signature: GoReleaser signs `checksums.txt` and attaches the signature and the public key before it publishes the release, and when the macOS and Windows packages are added later, `checksums.txt` is signed again before the extended file replaces it.-The installer and the self-updater pin that fingerprint. They take the key from the release but trust it only if its fingerprint matches, and they refuse a package whose `checksums.txt` is unsigned, signed by another key, or does not list the package. To check a download yourself:+The installer and the self-updater of every release after 1.3.57 pin that fingerprint. They take the key from the release but trust it only if its fingerprint matches, and they refuse a package whose `checksums.txt` is unsigned, signed by another key, or does not list the package. Releases before 1.3.57 are unsigned, so the current installer refuses them: to install one with `BEACON_VERSION`, use that release's own `install.sh` (`https://github.com/asymptote-labs/agent-beacon/releases/download/v<version>/install.sh`) or the manual steps above. To check a download yourself:```bash title="Verify a signed release"(set -euo pipefail- FPR="<release key fingerprint>"+ FPR="07BEA34ED6A411F4C066D98322F94195DCDC8F45"H="$(mktemp -d)"curl -fsSLO "${BASE}/checksums.txt" -O "${BASE}/checksums.txt.sig" -O "${BASE}/beacon-release-key.gpg"# Keep only the pinned key: the file comes from the release, so it may hold others.