Architecture
The rule
The server never scans a machine from inside. Every machine, the server's own included, is scanned by its own agent, as root. The server, which faces the network, runs without root and stores results and checks them against the advisories. What it reads itself needs no root and no login: registry images, through the registry API, and the network targets you add, from the outside, by connecting to their ports.
Who runs as what
| Component | Runs as | Listens on | Reaches |
|---|---|---|---|
deaconguard-server | the deaconguard user, no root; systemd's NoNewPrivileges keeps it from ever gaining root, even through sudo | 0.0.0.0:8443 (HTTPS) for the dashboard, and 0.0.0.0:8444 for the agents | the distributions' advisory feeds, CISA KEV, EPSS and OSV; registries, network targets and notification channels only when you add them |
deaconguard-agent | root, so every check sees other users' processes, protected files and firewall rules, and live detection can load its watchers into the kernel | nothing | only its server, over HTTPS |
Why split them: the server is the part an attacker on your network can reach, so it holds no root. The parts with root, the agents, accept no connections at all; they ask their server for work. The install script gives the server's own machine an agent too, enrolled over 127.0.0.1, and the dashboard marks that host This server.
In a container, the same split holds: the server's image runs as a non-root user with no capabilities, and an agent in a container, such as one pod of a Kubernetes DaemonSet, runs as root with only the capabilities its checks need. It mounts its host's root filesystem read-only and runs each check chrooted there, with the host's own tools, so it reports on the host, not the container.
How agents reach the server
People open the dashboard on port 8443; agents connect to port 8444, which serves only the agent API, so each can be allowed from different networks (see which port agents use with each way of installing). An agent connects to the address in its enrollment token, so that address must lead to the server from the agent's machine:
| Agent | Server address in its token |
|---|---|
| On the server's own machine | https://127.0.0.1:8443, which the install script uses for it, or 127.0.0.1:8444 |
| On another machine | the server's address on that network, such as https://10.0.1.5:8444; preferably a private one |
| In the same Kubernetes cluster | the Service: https://deaconguard.deaconguard.svc:8444 |
| Outside the cluster | a private load balancer for the agent port: see Kubernetes |
127.0.0.1 and localhost only ever lead to the agent's own machine: a token with them works only for an agent next to the server. Enroll a machine warns about them.
You can leave the server's machine without an agent (--no-agent). It is then not scanned as root: adding it on the Hosts page has the server scan it without root, and its results show partial coverage.
Components
One binary, deaconguard, provides every role:
| Role | Service | Listens on | Data |
|---|---|---|---|
| Server | deaconguard-server | 0.0.0.0:8443 (dashboard) and 0.0.0.0:8444 (agents), HTTPS | /var/lib/deaconguard/ |
| Agent | deaconguard-agent | nothing | /etc/deaconguard/agent.json |
| Local mode | deaconguard serve | 127.0.0.1:7480 (HTTP) | ~/.local/share/deaconguard/ |
How a scan works
The agent never evaluates vulnerabilities itself. It sends the package list, and the server decides which packages are vulnerable. A modified agent could report false check results, but it can't supply its own vulnerability verdicts.
Enrollment
- An admin creates a token, one-time or reusable. The token contains the server's URL, the SHA-256 fingerprint of its certificate's public key, and a random secret.
- The agent connects to that URL, accepts only a certificate with that fingerprint, and presents the secret.
- The server checks the secret (it stores only its hash), marks a one-time token used or counts a use of a reusable one, and gives the agent its own credential.
- From then on the agent authenticates with that credential. Removing the host revokes it at once.
Certificate pinning
An agent accepts the server's certificate in one of two ways:
- Its public key matches the fingerprint from the enrollment token. This is how a self-signed certificate works safely: no certificate authority is involved, and a certificate re-issued for the same key keeps working.
- The agent machine's trusted certificate authorities vouch for it for the server's name, as a browser would. This lets you move the server to your own certificate, for example from your company CA or Let's Encrypt, without enrolling every agent again.
Anything else is refused, and the agent reports that the server's certificate doesn't match the one it enrolled with.
Because of the second rule, someone who could obtain a certificate for your server's name from a CA the agents trust could impersonate the server. In practice that means controlling the server's DNS name. If your server uses a public DNS name, protect that domain, for example with a CAA record and registrar lock.
What is stored
- Roles: the server checks each request against the account's role; the dashboard only hides what a role can't use.
- Passwords: PBKDF2 hashes.
- Two-step sign-in: authenticator keys in the database, as checking codes requires; recovery codes as SHA-256 hashes.
- Tokens and agent credentials: SHA-256 hashes on the server; the agent's own credential lives in
/etc/deaconguard/agent.json, readable by root only. - Sudo passwords: in memory for one scan only, never written or logged.
- Scan logs: steps, commands and timings, never command output or credentials.