pushleft
Deploy your first app
Manual contents
Handbook
HandbookPushleftArchitecture
Operate
Install the control planeYour own serversFleetOperations and alertsAuthenticationAccess gateDomains and DNSUsage and budgetsScheduled jobsAbuse controlsAI provider proxyCustomer mailErrors and performanceLogs and metricsRetentionObject storageContainer registryGit server
Develop
The .pl.yaml manifestOnboard with an AI agentThe pl up demoBuild executorSource ingestionAgent gatewayManaged databasesSecurity findingsTunnels and shellsDev workspacesPrivate hostnamesMesh coordinatorsDesign baseline
Runbooks
Control-plane host failoverControl-plane PostgreSQL failoverControl-plane PostgreSQL restoreCustom domains and certificatesGateway key compromiseIngress host failureNode busyNode disk fullNode drain and replacementNode lostRegistry outageHetzner Robot hostsSecret rotationSecurity incidentStaging fleet on ProxmoxStaging build cacheStuck deploymentVault/OpenBao backup and recovery
More
CI pipelines
Manual · docs/runbooks/gateway-ca-compromise.md

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:

KeyWhereWhat a holder can do
Agent CA key PUSHLEFT_AGENT_CA_KEY_FILEgateway host, 0600Mint 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_KEYgateway hostImpersonate the gateway (and the enrollment listener) to agents, given a network position.
One node’s agent key /var/lib/pushleft/pki/agent.keythat nodeAct 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. Set DATABASE_URL to the pushleft_controller role.
  • Open an incident ticket (security incident). Record every step in it.

Diagnosis

  1. 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'
  2. List every result a suspect node reported, across all organizations:

    DATABASE_URL="$OPS_URL" pushleft-controller fleet audit-search --node <node> --since <rfc3339>
  3. Search the gateway’s journal for enroll requests. Enrollment refusals do not reach the database.

Actions

One node’s agent key

  1. 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).

  2. Drain the node:

    pushleft-controller fleet drain <node>
  3. Replace the node:

    pushleft-controller fleet replace <node>

    replace covers Hetzner Cloud and Proxmox nodes. For a Robot host, reinstall it and enroll it as a new node with fleet 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.

  4. 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), and fleet decommission refuses while any remain.

Gateway server key (agent CA intact)

  1. Issue a new server certificate from the CA that agents trust (PUSHLEFT_AGENT_CA on nodes). Agents pin the CA, not the key, so nodes need no change.

  2. Install the new files at PUSHLEFT_AGENT_GATEWAY_CERT/_KEY, owned by pushleft, mode 0600.

  3. Restart the gateway. Agents reconnect within 5 s.

    systemctl restart pushleft-agent-gateway
  4. If you cannot rule out traffic interception, treat every node as suspect. Do the agent-key steps for each node.

Agent CA key

  1. Stop new certificates from being recorded. Unset PUSHLEFT_AGENT_CA_KEY_FILE and PUSHLEFT_AGENT_ENROLL_BIND in /etc/pushleft/agent-gateway.env.

  2. Restart the gateway:

    systemctl restart pushleft-agent-gateway

    Enrollment and renewal now return 503. Existing certificates keep working until they expire (24 h by default).

  3. Check recent certificates with diagnosis step 1. Revoke any that you cannot explain (one node’s agent key, step 1).

  4. Turn issuance back on with the leaked key still in place. Set PUSHLEFT_AGENT_CA_KEY_FILE and PUSHLEFT_AGENT_CA_CERT_FILE again, separate from PUSHLEFT_AGENT_CLIENT_CA.

  5. Start the rotation. The new CA issues, and the gateway trusts the old and new CA (CA rotation):

    pushleft-controller fleet ca rotate --begin
  6. Wait until every node has renewed. The default check runs every 600 s, and certificates from the old CA are due at once.

  7. Complete the rotation. The API refuses it while a node is still on the old CA.

    pushleft-controller fleet ca rotate --complete

    --complete revokes every old-CA agent certificate, signs the gateway server certificate again with the new CA, and deletes the old key.

  8. 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. --complete moves the server certificate to the new CA, and agents trust only the bundle their last renewal delivered.

  9. 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 list shows 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.status back to provisioning to force a re-enrollment. The enrollment secret flow, and its single-use guarantee, live in fleet provision and fleet enroll-host.
  • Do not disable mTLS or client-CA checking to keep the fleet running.
Rendered from the repository at build time. Edit docs/runbooks/gateway-ca-compromise.md to change it.