Install the agent

The agent runs once a day from a systemd timer (or cron), reads the package lists and settings of the server, and sends one report. You need an API key of scope agent: create an account, then a key.

Three steps

1. Download the install script

curl -fsSLO https://patchbrief.ch/install.sh

2. Read it

less install.sh

It is a POSIX shell script with comments in plain English. It prints every file it writes and every command it runs. Without Docker it checks the SHA-256 sums of the agent binary and of Trivy before it installs them; with Docker it pulls the agent image by its digest, so a changed image does not run.

3. Run it and paste your key

sudo sh install.sh

The installer asks for the key (it does not show what you paste), then for the server name (Enter takes the host name), runs a scan that sends nothing, shows a summary and asks whether to send the first report: answer y. The server appears on the dashboard within a minute of that report. The key stays off the command line, so it does not land in the shell history, the sudo log or the process list.

In a provisioning script, without a terminal, the installer asks nothing: give the key in a file (--key-file), on standard input (--key -) or in the PATCHBRIEF_KEY variable, add --yes to send the first report, and --name to choose the name. Without --name the server is called server- and six hex characters, such as server-3f9a1c; you can rename it on the dashboard.

sudo sh install.sh --key-file /root/patchbrief.key --name web-1 --yes

What the installer does

  • Checks that it runs as root on amd64 or arm64, and finds Docker or uses the static binary.
  • Writes /etc/patchbrief/agent.conf (mode 600: key, server name, app directories, upload address) and /etc/patchbrief/server-id (a random UUID).
  • Installs patchbrief-agent.service and patchbrief-agent.timer: once a day at a random time between 01:00 and 06:00 local time; a missed run follows after the next boot. Without systemd it adds a line to the crontab of root.
  • Each run has three steps in separate processes, so no step both reads host files and handles untrusted image data or the network. The wrapper (run.sh) first saves the running images with docker save into /var/lib/patchbrief/work (mode 700, removed after the run). Then the host step reads the host read-only without network; the image step reads only the saved images, as an unprivileged user without network; the report step gets only the results of the two and sends them. With Docker each step is its own container, and the Docker socket stays outside all three.
  • Without Docker, it downloads the static agent binary from https://patchbrief.ch/dl/agent/ and the Trivy release from GitHub.
  • Keeps the last report and the answer in /var/lib/patchbrief/, so you can read what was sent.

The agent only reads, sends one HTTPS request to one address, and does not take commands from us. What it collects

Try it once with Docker

To see the report of a server without installing anything, run the wrapper once with --dry-run: it prints the report and a summary, and sends nothing.

curl -fsSLO https://patchbrief.ch/run.sh
less run.sh
sudo sh run.sh scan --dry-run

Remove the agent

sudo sh install.sh --uninstall

It removes every file the installer created and lists each one. Then delete the server on the dashboard, which deletes its reports and findings.

Supported systems

  • Debian 11 to 13, Ubuntu 20.04 and later
  • RHEL, Rocky Linux and AlmaLinux 8 to 10, Amazon Linux 2023
  • Alpine 3.18 and later
  • amd64 and arm64; Docker is optional