Gateway key compromise
Use this when one of the agent gateway keys may have leaked. For example, failed_auth_burst fires, unknown certificates appear, or a gateway host or node is reported compromised.
There are three keys. Find out which one leaked before you act, because the response is different for each:
| Key | Where | What a holder can do |
|---|---|---|
Agent CA key PUSHLEFT_AGENT_CA_KEY_FILE | gateway host, 0600 | Mint client certificates the TLS layer accepts. These certificates do not authenticate on their own: the gateway also requires the fingerprint to be an unrevoked fleet_node_certificates row (threat model). If the same CA also signed the gateway server certificate, the holder can impersonate the gateway to agents from a network position. The holder can then send them typed jobs. |
Gateway server key PUSHLEFT_AGENT_GATEWAY_KEY | gateway host | Impersonate the gateway (and the enrollment listener) to agents, given a network position. |
One node’s agent key /var/lib/pushleft/pki/agent.key | that node | Act as that node: lease its targeted jobs and report results, until the certificate is revoked or expires (24 h by default). |
Symptoms
failed_auth_burst, or unknown fingerprints in the gateway log (401).- Certificates in the gateway’s journal that no known enrollment or renewal explains.
- The alert
agent_certificate_not_rotating. - A host compromise report for the gateway host or a node.
Before you start
- Get a shell on the gateway host and an operator host with
pushleft-controller. SetDATABASE_URLto thepushleft_controllerrole. - Open an incident ticket (security incident). Record every step in it.
Diagnosis
-
List every certificate issued in the last 7 days, on the gateway host. Each line names the node and the fingerprint.
journalctl -u pushleft-agent-gateway --since "7 days ago" | grep -E 'agent enrolled|agent certificate renewed|telemetry certificate issued' -
List every result a suspect node reported, across all organizations:
DATABASE_URL="$OPS_URL" pushleft-controller fleet audit-search --node <node> --since <rfc3339> -
Search the gateway’s journal for
enrollrequests. Enrollment refusals do not reach the database.
Actions
One node’s agent key
-
Revoke the node’s certificates. This takes effect on the node’s next request:
pushleft-controller fleet revoke-node-certificates <node> --reason "<ticket and reason>"The command refuses an unknown node, and a node with no unrevoked certificate. It writes an audit row (
operator_cli_action). -
Drain the node:
pushleft-controller fleet drain <node> -
Replace the node:
pushleft-controller fleet replace <node>replacecovers Hetzner Cloud and Proxmox nodes. For a Robot host, reinstall it and enroll it as a new node withfleet enroll-host(Robot hosts), then admit it.Renewal needs a valid certificate, so a revoked node cannot recover by itself. There is no re-enroll command for an existing node (gap). Replacement is the supported path.
-
Ask users to redeploy (
pl up) so their work lands on healthy nodes. The workloads keep running on the old host until then. Allocations are not moved (node drain), andfleet decommissionrefuses while any remain.
Gateway server key (agent CA intact)
-
Issue a new server certificate from the CA that agents trust (
PUSHLEFT_AGENT_CAon nodes). Agents pin the CA, not the key, so nodes need no change. -
Install the new files at
PUSHLEFT_AGENT_GATEWAY_CERT/_KEY, owned bypushleft, mode 0600. -
Restart the gateway. Agents reconnect within 5 s.
systemctl restart pushleft-agent-gateway -
If you cannot rule out traffic interception, treat every node as suspect. Do the agent-key steps for each node.
Agent CA key
-
Stop new certificates from being recorded. Unset
PUSHLEFT_AGENT_CA_KEY_FILEandPUSHLEFT_AGENT_ENROLL_BINDin/etc/pushleft/agent-gateway.env. -
Restart the gateway:
systemctl restart pushleft-agent-gatewayEnrollment and renewal now return 503. Existing certificates keep working until they expire (24 h by default).
-
Check recent certificates with diagnosis step 1. Revoke any that you cannot explain (one node’s agent key, step 1).
-
Turn issuance back on with the leaked key still in place. Set
PUSHLEFT_AGENT_CA_KEY_FILEandPUSHLEFT_AGENT_CA_CERT_FILEagain, separate fromPUSHLEFT_AGENT_CLIENT_CA. -
Start the rotation. The new CA issues, and the gateway trusts the old and new CA (CA rotation):
pushleft-controller fleet ca rotate --begin -
Wait until every node has renewed. The default check runs every 600 s, and certificates from the old CA are due at once.
-
Complete the rotation. The API refuses it while a node is still on the old CA.
pushleft-controller fleet ca rotate --complete--completerevokes every old-CA agent certificate, signs the gateway server certificate again with the new CA, and deletes the old key. -
Treat results reported during the exposure as suspect (diagnosis step 2), if the compromised CA signed the gateway server certificate. Agents could have talked to an impostor.
--completemoves the server certificate to the new CA, and agents trust only the bundle their last renewal delivered. -
Keep the CA key on the gateway host only, mode 0600. An HSM/KMS signer is the planned upgrade (gap).
The old CA is trusted for the overlap only, and the attacker’s minted certificates still need a database row to authenticate. If you cannot accept even that window, keep issuance off and replace nodes (fleet replace, or fleet enroll-host for Robot hosts).
Check it worked
- The old fingerprints get 401 on
POST /v1/agent/lease. pushleft-controller fleet listshows only intended nodes heartbeating.
Do not
- Do not delete certificate rows. Revocation is
revoked_at, and the rows are evidence. - Do not reuse a node ID or hand-edit
fleet_nodes.statusback toprovisioningto force a re-enrollment. The enrollment secret flow, and its single-use guarantee, live infleet provisionandfleet enroll-host. - Do not disable mTLS or client-CA checking to keep the fleet running.