Skip to content

Host agent

Calls made by managed hosts themselves — heartbeats and login validation — authenticated by the host’s agent token, not a user.

POST/api/hosts/heartbeat
POST/api/hosts/posture

Agent heartbeat ​

POST/api/hosts/heartbeat

Called by the installed Shellius agent every 60 s via its systemd timer. Authentication: X-Agent-Token header, resolved by agentAuth (per-host token preferred; falls back to the legacy AGENT_SHARED_SECRET — see middleware/agentAuth.js). Per-host tokens resolve the server/org identity themselves, so the body's serverId/orgId are IGNORED in that mode — a stolen/legacy token (or a compromised host) can no longer forge another server's heartbeat by editing the request body. Legacy mode has no per-host identity to fall back on, so it keeps the old body-scoped lookup.

Authentication: none — the token in the request is the credential.

Request body

NameTypeRequiredNotes
agentIdstringYes
serverIdstringYes
orgIdstringYes
agentVersionstringNoMay be null.
hostnamestringNoMay be null.
ipAddressstringNoMay be null.
bash
curl -X POST "https://shellius.example.com/api/hosts/heartbeat" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "…",
    "serverId": "…",
    "orgId": "…"
  }'

200 OK

json
{ "success": true, "data": { … } }

Posture ​

POST/api/hosts/posture

This route parses its own body: the app-wide express.json() keeps express's 100kb default, which a legitimate snapshot can exceed. The larger parser is mounted HERE so only this endpoint accepts a bigger body, and it is still bounded — 256KB, the same number the Content-Length check below enforces.

Authentication: none.

Request body

NameTypeRequiredNotes
schemaVersionnumberNoDefault 1. 1–1.
scannerstringNoAt most 128 characters. May be null.
agentVersionstringNoAt most 64 characters. May be null.
collectedAtdateYesISO 8601.
hostnamestringNoAt most 512 characters. May be null.
collectorOkbooleanNoDefault true.
degradedReasonstringNoAt most 512 characters. May be null.
firewallobjectNo
listenersarrayNoDefault []. At most 500.
servicesarrayNoDefault []. At most 300.
serviceScanobjectNo
metricsobjectNoMay be null.
bash
curl -X POST "https://shellius.example.com/api/hosts/posture" \
  -H "Content-Type: application/json" \
  -d '{
    "collectedAt": "…"
  }'

200 OK

json
{ "success": true, "data": { … } }
Was this page helpful?No, tell us why