Attester

The attesterThe program on each server. It collects facts and reports them as evidence; it never decides whether the server passes. runs on each audited server. It reads the deployed files, installed packages and running processes, and reports them as evidence when the verifierThe program in CI that sends a nonce, fetches references itself, compares, and writes the report. asks. This page covers installing the release binary, giving it the permissions it needs, the SSH forced commandAn SSH authorized_keys option that runs one fixed command whatever the client asks for. The verifier's key can only run the attester., the Ansible role, the local commands, and how PM2 and git-based deploys are checked.

Install the release binary#

Releases publish single executables (Node.js with the bundled CLI) for linux-x64, linux-arm64 and darwin-arm64, a SHA256SUMS file, an install.sh script, and build provenance for each file.

Install a pinned version by hand:

Shell
VERSION=<version>
curl -fsSLO "https://github.com/auditstatus/auditstatus.com/releases/download/v${VERSION}/auditstatus-linux-x64"
curl -fsSLO "https://github.com/auditstatus/auditstatus.com/releases/download/v${VERSION}/SHA256SUMS"
sha256sum --check --ignore-missing SHA256SUMS
gh attestation verify auditstatus-linux-x64 --repo auditstatus/auditstatus.com
sudo install -o root -g root -m 0755 auditstatus-linux-x64 /usr/local/bin/auditstatus

Or use the installer, which checks the binary against SHA256SUMS before it installs it:

Shell
curl -fsSLO https://github.com/auditstatus/auditstatus.com/releases/latest/download/install.sh
AUDITSTATUS_VERSION=<version> bash install.sh
VariableDefaultMeaning
AUDITSTATUS_VERSIONthe latest releaseThe release to install, for example 2.0.2.
AUDITSTATUS_BIN_DIR/usr/local/binWhere to install auditstatus.

Run the release binary on servers, not the npm package. The verifier compares the attester's own executable with the release's SHA256SUMS (policy.unverifiedAuditor, fail by default), and an npm installation runs a Node.js binary that is not in that list.

Permissions: capabilities or root#

The attester reads other users' processes (their environment, memory maps and executable pages) and files. It needs either root or two file capabilities. With the capabilities, the binary can read files other local users cannot, so let only root and the verifier's account run it (create the account first, as below). Set the group and mode first: changing the owner or group clears file capabilities.

Shell
sudo chgrp auditstatus /usr/local/bin/auditstatus
sudo chmod 0750 /usr/local/bin/auditstatus
sudo setcap cap_sys_ptrace,cap_dac_read_search+ep /usr/local/bin/auditstatus

/proc/<pid>/environ and /proc/<pid>/mem are readable only by the process owner, so reading them for another user needs CAP_DAC_READ_SEARCH as well as CAP_SYS_PTRACE. Without root or these capabilities, doctor warns that only this user's processes can be inspected, and process checks that cannot run make the result inconclusive, never passing.

A non-root process with capabilities is locked down so that the account running it cannot borrow them:

  • Only the attester commands run: ssh, serve, collect, check, doctor (attester role), tpm-enroll and monitor. Anything else fails with "with capabilities, only the attester commands are available".
  • Only /etc/auditstatus/config.yml is read, and it must be owned by root.
  • ima.log must be under /sys/kernel/security/, monitor.log under /var/log/, and confidential.entry under /sys/kernel/config/tsm/.
  • The release binary runs with --disable-sigusr1 and a SIGUSR1 handler, so the signal cannot open the Node.js inspector. Node.js also ignores NODE_OPTIONS in a process with file capabilities.

Running as root works too. In both cases the configuration file must not be writable by group or others. Without capabilities, a file owned by the current user is also accepted.

The configuration file#

The attester reads /etc/auditstatus/config.yml by default (--config for another file, except with capabilities). auditstatus init writes a starting one as auditstatus/attester.config.yml. Check a file before installing it:

Shell
auditstatus validate --role attester --config attester.config.yml

A minimal configuration:

YAML
version: 2
services:
  - name: web
    root: /var/www/production/current
    user: deploy

See Configuration for every setting.

The SSH forced command#

The verifier connects as a dedicated account whose key may only run the attester. Create the account (add it to the tss group if the server has a TPMTrusted Platform Module: a chip with keys that cannot be exported and registers (PCRs) that can be extended but never set.):

Shell
sudo useradd --system --create-home --shell /bin/sh auditstatus

Add the verifier's public key to ~auditstatus/.ssh/authorized_keys with a forced command and restrict (no forwarding, no TTY):

Text
command="/usr/local/bin/auditstatus ssh",restrict ssh-ed25519 AAAA... audit-status

Keep ~auditstatus/.ssh and authorized_keys owned by root, so the account cannot replace its own keys. The forced command reads the requested operation from SSH_ORIGINAL_COMMAND and accepts only:

OperationWhat it returns
check <nonce>Evidence for this nonceA random value the verifier chooses for one run, so that an old answer cannot be replayed. (64 lowercase hex characters).
enrollThe TPM's attestation key and endorsement key; it creates the attestation key if there is none. See Hardware evidence.
activate <credential>The secret in a credential the verifier encrypted to the endorsement key, proving both keys are in the same TPM.

Anything else prints auditstatus: this key may only run "check <64 hex nonce>", "enroll" or "activate <credential>" and exits with 2.

On the verifier side, pin each server's host key in known_hosts (see Verifier).

Commands on the server#

CommandOptionsWhat it does
auditstatus doctor--config file, --role attester (default), --jsonChecks that this server can produce complete evidence, and prints a fix: line for each problem. Exits 1 while any check fails.
auditstatus check--config file, --jsonCollects evidence with a random nonce and prints a summary: services, commits, packages, processes, hardware evidence, monitor, and process findings. Exits 1 on critical process findings and 3 when checks could not run. It is not a verification.
auditstatus collect--config file, --nonce hexPrints the full evidence as JSON (with a random nonce unless given).
auditstatus tpm-enroll--config filePrints the TPM enrollment (the same as the enroll operation).
auditstatus monitor--config fileRuns bpftrace and records every program and library loaded. Runs as a service; see Monitor.
auditstatus serve--config file, --listen 127.0.0.1:8740Answers the three operations over HTTP on a loopback address, for Kubernetes. The verifier's kubernetes.port must be the port given here. See Kubernetes.
auditstatus ssh--config fileThe forced command.

Run them as the account the verifier uses, so they see what the verifier will see:

Shell
sudo -u auditstatus auditstatus doctor
sudo -u auditstatus auditstatus check

doctor checks, in order: the configuration; permissions (root, or CAP_SYS_PTRACE and CAP_DAC_READ_SEARCH); for each directory service, that the root exists and is a git checkout or a release with .attestium-manifest.json, the installed packages found, and that at least one process runs from it as the configured user with every check able to run (each such process is checked, and their runtimes named); the Docker socket or crictl for container services, and the running containers each one selects (none is a warning); the dpkg database; the TPM and its attestation key; the IMAIntegrity Measurement Architecture: the Linux kernel hashes files as they are used, logs each hash and extends PCR 10. log; configfs-tsm for confidential VMs; and the monitor log and bpftrace.

The Ansible role#

ansible/roles/auditstatus_attester installs the attester the same way on many servers. Use the playbook in ansible/attester.yml as a start:

Shell
ansible-playbook -i inventory ansible/attester.yml
YAML
- name: Install the Audit Status attester
  hosts: all
  become: true
  roles:
    - role: auditstatus_attester
      vars:
        auditstatus_sha256: "<SHA-256 of auditstatus-linux-x64 from SHA256SUMS>"
        auditstatus_verifier_keys:
          - ssh-ed25519 AAAA... verifier
        auditstatus_config:
          version: 2
          services:
            - name: web
              root: /var/www/app/current
              user: deploy
        auditstatus_tpm: true
VariableDefaultMeaning
auditstatus_version2.0.2The release to install.
auditstatus_sha256(required)The SHA-256 of the binary for this machine's architecture, from the release's SHA256SUMS.
auditstatus_archarm64 on aarch64, else x64The binary's architecture.
auditstatus_urlthe release download URLWhere to download the binary.
auditstatus_bin/usr/local/bin/auditstatusWhere to install it.
auditstatus_userauditstatusThe account the verifier connects as.
auditstatus_verifier_keys[]Public keys allowed to run the attester (and nothing else).
auditstatus_capabilitiestrueSet cap_sys_ptrace,cap_dac_read_search+ep on the binary.
auditstatus_config{version: 2, services: []}The content of /etc/auditstatus/config.yml. At least one service is required.
auditstatus_tpm_grouptssThe group that owns the TPM device.
auditstatus_tpmfalseAdd the account to auditstatus_tpm_group.
auditstatus_monitorfalseInstall bpftrace and the monitor service.

The role downloads the binary and checks its SHA-256, sets the capabilities, creates the account with a root-owned .ssh directory, writes authorized_keys with command="<auditstatus_bin> ssh",restrict for each key, writes the configuration after auditstatus validate --role attester accepts it, optionally installs the monitor, and finally prints the output of auditstatus doctor run as the account.

The monitor service#

packaging/systemd/auditstatus-monitor.service runs auditstatus monitor as root and writes /var/log/auditstatus/monitor.log. Enable it and set monitor.enabled: true in the configuration. See Monitor.

Git deploys and PM2#

Forward Email deploys with git and PM2: each server holds a git checkout of the public repository, installs dependencies from the lockfile, builds, and reloads the PM2 applications. Audit Status checks each part of that:

  • The checkout. Set root to the directory the application runs from. It may be a symbolic link (for example PM2 deploy's current); the attester resolves it. The attester reads the commit from .git without running git. The verifier requires the commit to be on the audited branch and every tracked file to match it. Files the commit's .gitignore ignores (.env, logs, uploads) are listed by top-level directory but not compared.
  • Dependencies. node_modules is compared, file by file, with the packages the lockfile at the commit pins.
  • Build output. Files the deploy generates and the repository ignores are compared with a build of the same commit, when the verifier configuration has a build section.
  • Every worker. The attester inspects every process of the service's user whose working directory is inside root. In PM2 cluster mode, each worker is its own Node.js process, and each is inspected: its runtime's injection vectors (NODE_OPTIONS, preloads, inspector flags and ports), its executable pages against the files, its libraries, tracer and open files. The PM2 daemon usually runs from another directory; it is listed in the report as another program of the same user, not inspected.
  • PM2 options. The node_args and interpreter_args PM2 starts an application with (from pm2_env, or the variables of fork mode) are checked for preloads and inspector flags. PM2 renames the processes it starts; a rewritten command line is accepted only for a child of the PM2 daemon.
  • PM2 itself. pm2, npm, corepack and pnpm installed next to the Node.js binary are compared with their references (runtimes.node.globalPackages).
  • The Node.js binary. A running official Node.js binary embeds its release URL; the verifier compares it with that official release (policy.unofficialNode).
  • Restarts. A tracked file, build output or file in node_modules written after a process started means the process may run code that is no longer on disk. That fails (policy.modifiedAfterStart) until the process restarts. Restoring the original contents does not hide it: Linux sets a file's status-change time on every change, and a file whose status alone changed (contents restored with an earlier modification time), or a directory whose entries changed (a file added and removed again), fails too (policy.metadataChangedAfterStart). PM2's own files are compared with the start of the PM2 daemon, which starts each worker through them: after upgrading PM2, run pm2 update.

Set minProcesses on the server in the verifier configuration to the number of workers you expect, so a server with fewer running is reported:

YAML
servers:
  - name: web1
    host: web1.example.com
    minProcesses: 4

A deploy in progress looks like tampering for a few minutes: files change under running processes, and a build runs. Set policy.retryAfterSeconds (for example 600) so a server that fails is collected again after that delay; the second result is reported, with what the first attempt found kept as a warning. See Verifier.

Edit this page on GitHub