Server agent

Non-root Linux monitoring agent

Installed as a service, the WatchTower15 agent needs root once, to install itself; after that it runs as its own login-less user under a hardened systemd unit, with two Linux capabilities that it uses only for reading and that would allow more, as the table below shows. It makes outbound HTTPS requests only, with no inbound port, and in a container it runs as the container's user instead.

Install once, run without root

The installer needs root once, to create a dedicated, login-less wt15-server-agent service user and the systemd unit. From then on the agent runs as that user, never as root, under a hardened unit, and no setuid binary can raise its privileges. The service user also belongs to the adm and systemd-journal groups, for reading the journal and conventional log files. The server's Security tab shows, in its Agent security section, the privileges each agent reports it actually holds; a host whose card reads None for its privileges was installed without the two capabilities, and running the install command again, as root and with the organisation token, adds them. Source: Server agent: the privilege model.

The systemd unit

# /etc/systemd/system/wt15-server-agent.service (excerpt)
[Service]
User=wt15-server-agent
NoNewPrivileges=yes
AmbientCapabilities=CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
CapabilityBoundingSet=CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
ProtectSystem=strict
ReadWritePaths=/var/lib/wt15-server-agent /var/log/wt15-server-agent.log
PrivateTmp=yes

The installer also writes a one-shot unit, wt15-server-agent-preflight.service, with the same user and exactly the same hardening, for the telemetry check it runs before the service is enabled. Source: Server agent: the privilege model.

What it can read and change

Capability or areaWhat the agent does with itWhat it would allow, or the limit
CAP_SYS_PTRACEReads other users' process details under /proc: per-process metrics, the process behind each listening port, each process's open-file count, and the disk usage reportIt would also allow attaching to other processes and changing their memory; the agent never does
CAP_DAC_READ_SEARCHReads files regardless of their permissions: other users' /proc entries and the log files your profile names, except the paths the agent never reads; lists the folders of a monitored volume for the disk usage report, without opening any fileIn effect, the agent can read any file on the host. A file a service reads as a parameter is read with this capability set aside, so the file's own permissions apply
FilesystemWrites its own state directory and its own log file (ProtectSystem=strict, ReadWritePaths)Every other path is read-only to it
PrivilegesHolds the two capabilities above (CapabilityBoundingSet)It can never acquire any other (not CAP_SYS_ADMIN, CAP_NET_RAW or CAP_NET_ADMIN, for example), nor gain privileges through setuid or setgid binaries (NoNewPrivileges=yes)
Open filesCounts each process's open files against its limitNo file name, socket address or command line is read or sent; full command lines are never sent
NetworkMakes outbound HTTPS requests to the WatchTower15 APINo inbound port
Changing the hostAsks for its own removal when WatchTower15 deletes its server: a root-owned path unit then runs the root-owned uninstall scriptNothing else: the agent, or anything that takes it over, can ask for nothing but its own removal

Sources: Server agent: the privilege model, Telemetry.

In a container

This page describes the service install. In a container there is no service: the install script runs the agent in the foreground, and the agent runs as the container's user, usually root inside the container, without the service's hardening (NoNewPrivileges=yes, ProtectSystem=strict, the two-capability bound): the container's own isolation is what contains it. Source: Installation: in a container.

How it talks to us

Sources: Server agent: how it talks to the backend, Installation: network requirements.

Credentials

At enrollment the agent stores its identity, including the secret it signs requests with, in /var/lib/wt15-server-agent/credentials.json. The file is owned by the wt15-server-agent service user and readable only by that user and root (mode 0600); the secret is stored as-is, so treat the file like a password. Source: Configuration: the credentials file.

Frequently asked questions

Does the agent run as root?

Installed as a service, no: only the installer runs as root, once, and the service runs as the login-less wt15-server-agent user. In a container it runs as the container's user, usually root inside the container, without the service's hardening.

Does it open a port?

No. It makes outbound HTTPS requests only; no inbound port is required.

Can it change anything on my server?

It never changes the host apart from asking for its own removal. It writes only its own state directory and its own log file; every other path is read-only to it.

What does it collect?

System metrics and information, such as per-process figures, listening ports and services, and the log files your profile names. It counts open files without reading or sending their names, socket addresses or command lines. Its disk usage reports name the folders and files that take the space, with their sizes and dates, and never open a file; each folder in /home is reported by its name and total size only. Its capabilities would let it read any file on the host (see the table above). The full list: Telemetry.

Where is its secret kept?

The agent secret it signs requests with is kept in /var/lib/wt15-server-agent/credentials.json, mode 0600, owned by the wt15-server-agent service user and readable only by that user and root.

Can I restrict it to fixed IP addresses?

Yes. Allow the three addresses api.watchtower15.com answers from in your egress firewall.

Monitor your first server.Get started