Docs · Linux

Linux

On Linux the collector runs as a systemd service and records file activity with the kernel's fanotify interface.

Requirements

  • Root (sudo).
  • Linux kernel 5.9 or newer (Ubuntu 22.04+, Debian 12+, RHEL 9+ and most current distributions). On 5.0 to 5.8 the collector falls back to an older way of watching, not tested there; before 5.0 it cannot record.
  • / on ext4, xfs, btrfs (also a subvolume, as Fedora, openSUSE and SLES set it up) or an overlay (a container).
  • x86_64 or arm64. The binaries are static, so no libraries are needed.

Install

curl -fsSL https://<console>/collector/install.sh | sudo bash -s -- \
  --enroll-token <pse1....> --api-url <auth-api-url>

It downloads the collector for this architecture, checks it against the published checksums, enrolls the machine, and installs and starts the service. Its last line says whether the collector records: Started and recording, or a warning with the reason it cannot. --api-url is optional with a token from the EU or US console: the token says which region it belongs to.

OptionEffect
--enroll-token pse1....Enroll with this token. Leave it out to upgrade without re-enrolling
--api-url …The sign-in service address. Only needed for a token that doesn't name a region
--force-enrollEnroll again even if this one is already enrolled. With a token of the same organization the new identity replaces the old one: the machine counts once, and Manage → Machines shows the old one replaced
--version 1.0.0Install a specific version instead of the latest
--https-proxy http://host:portThe proxy this machine reaches the internet through, for the install's downloads and the collector (http://user:password@host:port with a login; none removes it). Without the option, a proxy set before stays. See Download → Network

Upgrade

With automatic updates on for your organization, the service updates itself: it replaces /usr/local/sbin/proofstream-collector with the checked new version, keeps the old one as proofstream-collector.prev and restarts. A timer, proofstream-collector-rollback-check, checks 15 minutes later that the new version is running and otherwise puts the old one back. If the machine restarts before then, the check runs 15 minutes after it is back up. A copy of the collector run by hand never replaces itself. See Download → Updating the collector. An automatic update also brings the service's own settings when they changed (such as those that keep it from doing anything it never needs): the collector that installs the update writes them, if it is later than 1.0.9. A machine on 1.0.9 or earlier gets them at the update after its next one, or when you run the install command on it again, as below. Both replace /etc/systemd/system/proofstream-collector.service, so put settings of your own in a drop-in (sudo systemctl edit proofstream-collector), which neither touches.

To update by hand, run the same command without --enroll-token. The machine keeps its identity. Re-running with a token also keeps a still-valid identity, and keeps a machine deactivated in Manage deactivated; add --force-enroll to enroll it again instead (it replaces the deactivated one). A token for another organization (or region) moves a machine that is deactivated or paused where it was without --force-enroll.

A machine that runs the product under its earlier name: the installer stops and removes it, its settings and its folders, so the machine never runs two collectors. Nothing carries over: install with a token.

Images and virtual machine templates

For machines made from one image (a golden image, a VM template, a cloud image), install the collector in the image without a token, and enroll each machine when it first boots, from cloud-init or a first-boot script:

curl -fsSL https://<console>/collector/install.sh | sudo bash -s -- --enroll-token <pse1....>

Each machine is then a machine of its own on Fleet.

An image made from an enrolled machine carries that machine's credential. From the collector after 1.0.9 a machine made from it notices when the collector starts that its credential was issued on another computer: it records, but uploads nothing until it is enrolled, and its log says so (Uploads paused). To have such machines enroll themselves, write the token to /etc/proofstream/enrollment-token (root's, mode 600) on each, from cloud-init for example: the collector enrolls the machine as a new one and removes the file, at once if it is there when the collector starts, else within the hour. Running the install command with a token on it works too. The machine the image was made from goes on as before. The collector tells the two apart by the hardware UUID a virtual machine gets anew from its hypervisor or cloud (/sys/class/dmi/id/product_uuid), so a new machine-id alone never stops a machine's uploads; a clone that kept the original's hardware UUID (a virtual machine imported with its old ID) is not noticed, and uploads as the original. What the image had waiting to upload when it was made is uploaded by each machine as its own: another reason to make the image before enrolling.

Where things are

Program/usr/local/sbin/proofstream-collector (proofstream-collector --version shows its version)
Serviceproofstream-collector (systemctl status proofstream-collector)
Identity and settings, root only/etc/proofstream (device-credentials.json, collector.env, and https-proxy when a proxy is set)
Upload queue and runs, root only/var/lib/proofstream
Log, root only/var/log/proofstream/collector.log (sudo tail -f …)

To change the collector's options, edit COLLECTOR_ARGS in /etc/proofstream/collector.env and sudo systemctl restart proofstream-collector. Reinstalling never overwrites that file. An option the collector doesn't know stops it with an error, so check the log after a restart.

To uninstall: sudo systemctl disable --now proofstream-collector, then remove the program, /etc/systemd/system/proofstream-collector.service and the three folders. Within 15 minutes of an update there is also a rollback check to remove: sudo systemctl disable --now proofstream-collector-rollback-check.timer, then remove /etc/systemd/system/proofstream-collector-rollback-check.service and /etc/systemd/system/proofstream-collector-rollback-check.timer, and run sudo systemctl daemon-reload. Deactivate the machine in Manage.

Edge cases

  • Only the filesystem / is on is watched. A /home of its own (as RHEL, Rocky and Alma set up on a large disk), a data disk or a network share is not: nothing opened there is recorded. The install warns about /home, /srv and /data: "WARNING: /home is a filesystem of its own, which the collector does not watch".
  • Every file open is recorded, not only reads. Linux tells the collector that a program opened a file, not what for, so a program that only wrote a file (a log, a download being saved) is listed too. Alert emails about a Linux machine therefore say "opened files in", not "read". A Mac records opens for reading only.
  • A folder that is only listed is recorded as that folder (ls, find, a backup scan that opens no file in it), so it counts for a folder to watch. Collectors up to 1.0.7 recorded only the files opened in it.
  • / on btrfs or an overlay (Fedora, openSUSE, SLES, Ubuntu, Debian or Arch installed on btrfs, a container): the kernel refuses fanotify's newer way of watching there, so the collector uses the older one and records as on any other machine, for about a third more CPU per file opened. Its log says which it uses (fanotify: watching / with file descriptors …). Collectors up to 1.0.9 recorded nothing on such a machine, which the console showed as interrupted. There, a file opened inside a container is recorded under the machine's own path for it; where / is itself an overlay that path often can't be found, and such an open is not recorded.
  • On btrfs, every subvolume of the filesystem / is on is watched, so a /home subvolume (as on Fedora) is recorded too.
  • "interrupted" on a Linux machine that cannot record (fanotify not available to the service, as in some containers, or a kernel older than 5.0): the collector stays running, reports interrupted and tries again by itself, after 5 seconds and then less and less often, up to once an hour, so it starts recording as soon as it can. Its log says why (fanotify could not watch / (…)). Collectors up to 1.0.9 were restarted every five seconds instead, uploading a report each time.
  • "WARNING: kernel … < 5.9" during install: the collector is not tested on a kernel that old. From 5.0 it falls back to an older way of watching; before 5.0 it cannot record. The end of the install says whether it records.
  • "WARNING: the collector started but cannot record: …" at the end of the install, with the reason (a container or sandbox that blocks fanotify, for example): the collector keeps running and tries again by itself (see "interrupted" above).
  • A run lasts until the service stops. A machine installed before this (whose collector started a new run every 16 hours, with a gap of a few seconds in what was recorded) gets it when its install command is run again, or with its automatic updates (Upgrade).
  • "opens missed (machine busy)" on a Fleet card: the kernel's event queue overflowed during a burst of activity. The collector keeps running; activity during the overflow is lost. See Missed opens.
  • "--https-proxy should be http://host:port …" during install: the collector can't use what was given (an https:// or socks5:// proxy, a path, an IPv6 address, a port out of range). Nothing was installed or changed.
  • "could not fetch … SHA256SUMS, so the download cannot be verified" during install: the list of checksums could not be downloaded, and the installer will not install as root what it cannot check. Run it again. Nothing was installed or changed.
  • The machine's name in the console is the host name with anything but letters, digits, dot, dash and underscore turned into a dash. Two machines with the same host name are still two machines: the console adds the start of each one's id (Fleet).
  • A machine where nothing happens still reports every five minutes.
  • "enrollment failed" with the server's reason (a mistyped, expired or revoked token; a token from another region's console with a wrong --api-url): nothing was changed, and a collector that was running before is started again.
  • The machine shows offline after a reboot: the service starts at boot and reports within 5 minutes.

This is the help built into the ProofStream console, as it is in the latest release. Something missing? Ask us.