rcourtman 9615e46d25 Register agent command channels under the identity Pulse resolves (#2550)
## Problem

An agent's command channel could be refused for good after a restart
whenever the ID it presented differed from the host ID Pulse resolved
for its reports. This applied to every install path.

- The first command-channel registration bound the install token to
whatever ID the agent presented, and a binding never moves.
- The agent registered before its first report, under a configured
`--agent-id`, or under an ID Pulse had forked for a cloned machine ID or
kept from an earlier enrollment.
- Pulse resolved its reports to another host ID and acknowledged that as
`agentId`, and the agent persisted it.
- The config gate judges the resolved ID, so it switched the operator's
commands off.
- The next restart registered under the persisted ID: "Agent token
mismatch: token is not bound to the registering agent", indefinitely.

This was the remaining gap called out in #2542.

## Why not move the binding at report ingest

The obvious fix is to rebind the token to the resolved ID when a report
arrives. It isn't safe. Identity resolution matches a report onto a
host's continuity record by machine ID without checking the token, and a
token-machine binding then keeps that resolution stable. A holder of one
host's token could send one report that resolves onto another host's
retained record, then a second claiming the bound ID, and move the
token's command identity across hosts. A forged report and a
legitimately stale one look identical, so this change moves no binding
from report contents.

## Fix

**Server (`internal/api/agent_ingest.go`)**
- Report acknowledgements name `commandAgentId`, the resolved host ID,
only when the token's binding already holds it, or when a registration
presenting it would take the first bind, backfill, legacy migration,
hostname rebind or one-time deploy repair it would get anyway.
- The credential must be one command admission takes (`agent:exec`, at
most one organization, legacy or no runtime role), and the host must be
held under the reporting token, so mock acks name nothing.
- The ID is judged for the hostname the report presents.
- Naming grants nothing that registration wouldn't. The config gate
takes the same decision.

**Agent (`internal/hostagent`)**
- The command channel stays staged until Pulse acknowledges a report,
then registers under the named identity.
- When Pulse names none (an older Pulse, or a token already bound to the
presented ID such as an existing `--agent-id` install), it registers
under the agent's own ID as before.
- Only a real ack negotiates the identity: `success` set, a host named,
and a report that presents this process's agent ID and hostname. An
unreadable or non-ack body, a replayed buffered report from an earlier
run, or an observer ack neither names nor releases the channel.
- A 403 (the token lacks report scope, so Pulse can never answer)
releases the channel under the agent's own ID, keeping today's behaviour
for exec-only tokens.
- A client Pulse has admitted is never rebuilt, because that would
reopen its receipt store and mark in-flight operations interrupted. A
client Pulse never admitted is retired and rebuilt under the named
identity, behind a compare-and-swap so it can't be admitted afterwards.
- A client a concurrent disable has already cleared can no longer take
the run slot.

## Tests

- **Agent (`internal/hostagent/command_client_test.go`):**
- registers under the acknowledged identity, and waits for an accepted
report;
- keeps its own ID when none is named, and keeps the acknowledged ID
through a later ack that names none and through a disable/enable;
  - ignores unreadable and non-ack bodies;
  - releases on 403;
- leaves an admitted running client in place, and moves a never-admitted
one;
  - ignores observer acks and replayed buffered reports;
  - lets no superseded client take the run slot;
  - CAS exclusivity, plus a real websocket handshake test.
- **Server:**
- `TestHostAgentCommandChannelBindsTheIdentityPulseAcknowledges`: end to
end through the router. A configured-ID install goes through report,
registration, restart, and the gate keeping commands on.
-
`TestContract_UnifiedAgentReportAckNamesCommandIdentityOnlyWhenTheBindingAdmitsIt`:
the field is present only when admitted, and absent for bound-elsewhere,
no-exec, collector and two-org tokens.
  - Security cases in `security_regression_test.go`:
    - an established binding never moves;
    - a hostname-bound deploy token backfills the resolved ID;
    - the deploy placeholder repair lands on the resolved ID;
- an agent reconfigured after #2547 recorded its ID is named that ID;
    - mock acks name nothing.
- **Fail without the fix:** the behavioural agent and server tests were
run against the previous `agent.go` and `agent_ingest.go` and fail
there, apart from the compatibility and invariant checks (own ID kept,
established binding never moves), which pass either way by design. The
tests for the newest guards use new seams, so the mutation checks below
cover them instead.
- **Mutation checks:** each guard was dropped in turn (real-ack check,
current-identity check, never-admitted retirement, handshake admission,
admitted-client protection, binding decision, role check, org check,
token-held check), and each mutation fails at least one test.
- **Locally:** the full `internal/hostagent` and `cmd/pulse-agent`
suites pass; the new agent tests pass under `-race`; the governance
guards and audits pass.

## Not in this change

- Tokens already bound to a diverged ID are not recovered automatically,
for the reason above. Re-running the install command issues a fresh
token, which binds the resolved identity.
- If Pulse later changes a host's resolved ID (a rename heal), it is
named only where the existing binding rules already allow that ID.
2026-10-06 01:12:54 +01:00
2026-10-05 21:53:41 +01:00
2026-03-18 16:06:30 +00:00
2026-10-05 21:53:41 +01:00
2026-03-18 16:06:30 +00:00
2025-10-11 23:29:47 +00:00
2026-03-18 16:06:30 +00:00
2026-10-05 21:53:41 +01:00

Pulse

Pulse logo

Real-time Proxmox, Docker and Kubernetes monitoring that finds what needs attention.

GitHub Stars GitHub Release Docker Pulls License

Live demo · Documentation · Releases · Discussions

Pulse is a self-hosted monitoring workspace for Proxmox, Docker, Kubernetes, TrueNAS, physical and virtual machines, and early-access VMware vSphere environments. It combines live infrastructure state, history, alerts, recovery visibility, and scheduled health checks without requiring a conventional enterprise monitoring stack.

Pulse Proxmox workspace

Why Pulse

  • It watches between visits. Alerts and Pulse Patrol find failed backups, capacity pressure, restart loops, unhealthy containers, clock drift, and other problems that dashboards cannot surface when nobody is looking.
  • It keeps each platform familiar. Proxmox, Docker, Kubernetes, TrueNAS, vSphere, and machines have dedicated views, backed by one shared resource model for search, alerts, history, and investigation.
  • It stays operator-controlled. Credentials are encrypted at rest, API tokens are scoped, agent commands are disabled by default, and governed fixes require the configured policy and approval path.

Platform coverage

Platform Coverage
Proxmox VE, PBS, and PMG Nodes, guests, storage, backups, replication, Ceph, mail gateways, and alerts
Docker and Podman Hosts, containers, Compose projects, Swarm services, health, images, and updates
Kubernetes Clusters, nodes, workloads, pods, services, storage, and events through the unified agent
TrueNAS SCALE and CORE Pools, datasets, disks, snapshots, replication tasks, apps, VMs, and alerts
Linux, Windows, and macOS machines Host health, filesystems, networking, temperatures, RAID, and availability through the unified agent
VMware vSphere Early-access inventory, hosts, clusters, VMs, datastores, networks, snapshots, and recovery context; validate against your own vCenter before production use

Platform pages keep storage and recovery information beside the infrastructure it belongs to. Alerts, Actions, and Patrol remain cross-platform views.

Patrol: monitoring that does rounds

Pulse Patrol runs scheduled checks across the current state and recent history of your infrastructure. Community installations can use a local model or their own AI provider for watch-only analysis. Pulse Pro adds investigation and policy-bound fixes with approval, verification, and an audit trail.

Pulse Patrol attention queue

Pulse also includes an interactive Assistant and an MCP adapter for external clients such as Claude Code and OpenCode. Both sit on top of the same scoped inventory, metrics, alert, storage, and governed-action contracts.

Quick start

Choose an exact version from the latest release and keep that version pinned during installation.

Docker

docker run -d \
  --name pulse \
  -p 7655:7655 \
  -v pulse_data:/data \
  -e PULSE_DEPLOYMENT_METHOD=docker_run \
  --restart unless-stopped \
  rcourtman/pulse:vX.Y.Z

Open http://<your-ip>:7655 and follow the bootstrap-token setup. Docker host monitoring is provided by the unified agent; the Pulse server container does not need the Docker socket.

Proxmox LXC, Linux, and Kubernetes

The installer is signed. Verify install.sh against the pinned pulse-installer key before running it:

export PULSE_VERSION=vX.Y.Z
curl -fsSLO "https://github.com/rcourtman/Pulse/releases/download/${PULSE_VERSION}/install.sh" &&
curl -fsSLO "https://github.com/rcourtman/Pulse/releases/download/${PULSE_VERSION}/install.sh.sshsig" &&
ssh-keygen -Y verify \
  -f <(printf '%s\n' 'pulse-installer namespaces="pulse-install" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZd/DaH+BldzOkq1A8KVTcFk73nAyrE8aJOyf7i00jm pulse-installer') \
  -I pulse-installer \
  -n pulse-install \
  -s install.sh.sshsig < install.sh &&
bash install.sh --version "${PULSE_VERSION}"

Paste the whole block: installation stops if either download or signature verification fails. Do not run the final command separately to bypass a failure.

The GitHub installer installs the Pulse server. Install and upgrade agents (including v5-to-v6 agent upgrades) with the per-host command generated under Settings → Infrastructure → Install on a host.

Do you need an agent?

Often not. Proxmox VE, PBS, and PMG are monitored through the Proxmox API with a read-only token, so nothing runs on the host and the generated setup script creates a privilege-separated monitoring user. Install the unified agent only where you want data the platform API cannot provide, such as host SMART health, temperatures, Docker hosts, or standalone machines.

The agent is operator-controlled by design. Command execution is off by default, the local listener binds to localhost, and generated systemd units ship hardened. On Linux, the installer's --least-privilege profile runs the service as a dedicated non-root user, with optional scoped sudo grants for the few collectors that need elevation. The agent security model documents exactly what the agent can and cannot do at each privilege level.

Important

GitHub release assets and rcourtman/pulse images are Community builds. Relay, Pro, and eligible legacy customers should use the private image or Linux archive provided by the Pulse download portal. Replacing a private Pro runtime with a public Community build removes its private runtime hooks.

Editions

  • Community — self-hosted monitoring, seven days of metric history, core SSO, update alerts, and Patrol with your own provider or local model.
  • Pro — Community plus Patrol investigation, governed fixes, ninety days of history, centralized agent profiles, RBAC, audit logging, and reporting.
  • MSP — for managed service providers: one Pulse Account running many client workspaces, each with an isolated Pulse runtime — separate dashboards, alerts, users, audit history, and reports. Free sixty-day two-client evaluation at Pulse for MSPs.

Relay is no longer sold. Existing Relay subscribers receive Pro features at their current price for as long as their subscription continues. Existing paired phones keep working until 31 March 2027. Relay connects the app, not the web UI. Use your own VPN or tunnel for remote web access. For phone alerts, add an ntfy, Gotify or Pushover destination and open Pulse in your phone's browser.

Core self-hosted monitoring is not gated by monitored-system or child-resource volume. See the runtime-aligned capability reference and current plans for details.

Documentation

Localized getting started guides: Deutsch · Español

Development

Pulse uses Go 1.26 and a SolidJS/TypeScript frontend. The managed development runtime starts the frontend at http://127.0.0.1:5173 and proxies API and WebSocket traffic to the backend on port 7655.

npm ci
npm --prefix frontend-modern ci
npm run dev

Useful checks:

go test ./...
npm --prefix frontend-modern test
npm --prefix frontend-modern run type-check
python3 scripts/check_public_docs.py

See CONTRIBUTING.md before investing in a code change. Pulse uses an issue-first contribution process and does not normally accept unsolicited pull requests.

Community and support

License

Everything in this repository is licensed under the MIT License. There is no dual licensing and no commercial or source-available code here.

Pulse Pro is a separate commercial product, built from private sources and distributed through pulserelay.pro. Its use is governed by the Terms of Service, which apply to that product only, not to anything in this repository.

S
Description
Monitoring for Proxmox, Docker, Kubernetes, TrueNAS, and vSphere that watches your infrastructure for you: smart alerts, AI patrols that catch silent failures, and verified fixes
Readme MIT 424 MiB
Languages
Go 60.8%
TypeScript 28.8%
Python 5.5%
JavaScript 2.8%
Shell 1.8%
Other 0.2%