Install the agent

You need an API key of scope agent: create an account, then a key. The installer sets up a systemd timer, or a cron line on systems without systemd, that runs the agent once a day.

Three steps

1. Download the install script

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

2. Read it

less install.sh

It is a POSIX shell script that prints each file it writes and each 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 an image that was changed after the release does not run.

3. Run it and paste your key

sudo sh install.sh

The installer asks for the key (it does not echo what you paste) and for the server name (Enter takes the host name). It then scans without sending, shows a summary and asks whether to send the first report; answer y. The server shows on the dashboard within a minute of that report. Because the key is not on the command line, it stays out of the shell history, the sudo log and the process list.

Without a terminal, as in a provisioning script, the installer does not ask anything. Give the key in a file (--key-file), on standard input (--key -) or in the variable VULNPOCALYPSE_KEY; add --yes to send the first report and --name to set the server name. Without --name the server is called server- and six hex characters, such as server-3f9a1c, and you can rename it on the dashboard.

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

What the installer does

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

The installer writes the files above and the timer or cron line; the agent writes its state and a copy of the last report to /var/lib/vulnpocalypse. Neither changes other files or settings of the server. The agent 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 before you install anything, run the wrapper once with --dry-run. It prints the report and a summary and does not send them.

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

Remove the agent

sudo sh install.sh --uninstall

The uninstaller removes every file the installer created and lists each one. Then delete the server on the dashboard to delete 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