Documentationv2.4.2

NodeSentinel documentation

Security

Protect confidential data, agent access and privileged sources without granting unnecessary permissions.

Core rules

  • Never commit .env files, keys or host configurations.
  • Use at least twelve characters for the dashboard password and a unique strong key for each agent.
  • Use HTTPS and WebSocket over TLS for all network access.
  • Keep dashboard state and configuration files readable only by the service user.
  • Do not expose agent ports unnecessarily. Push agents require no inbound port.
  • Back up the state directory with encryption and test restoration.

Encrypted agent communication

Push agents authenticate with their agent name and X-Agent-Key. They verify the dashboard TLS certificate. wss:// is mandatory for remote connections; ws:// is accepted only for loopback connections.

The proxy between dashboard and agent must support WebSocket upgrades. Restrict the internal hop between proxy and dashboard as well, because keys and data are forwarded there.

Rotate keys

  1. Generate a new random key, for example with openssl rand -base64 32.
  2. Add it to the appropriate agent configuration in the dashboard.
  3. Restart the dashboard in a controlled manner.
  4. Update the agent and restart its service.
  5. Verify that no processes or logs still contain the old key.

Agent permissions

AccessPurposeDefault
Read-only /procCPU, RAM and kernel metricsOn
Read-only /Host filesystem usageOff
Docker socketContainer status, metrics and eventsOff, root-equivalent
JournalSSH and Fail2Ban eventsOff
NET_ADMIN and UFWFirewall statusOff
Fail2Ban socketFail2Ban status and eventsOff

Legacy HTTP agents

Older pull agents remain compatible when NODESENTINEL_HUB_URL is not set. Every request authenticates with X-Agent-Key. Outside loopback, TLS with certificate verification is mandatory.

bash
openssl req -x509 -newkey rsa:4096 -nodes -days 825 \
  -keyout agent.key -out agent.crt \
  -subj "/CN=homelab1.lan" \
  -addext "subjectAltName=DNS:homelab1.lan,IP:192.168.1.20"
chmod 600 agent.key

Distribute only agent.crt to the dashboard. Certificate verification cannot be disabled.

Trust boundaries

The Docker socket, write access to host paths, NET_ADMIN, and Fail2Ban or UFW helpers significantly change the security boundary. Run only trusted images and evaluate each source individually.