Management Node Log Access

Log access is an extra permission, beyond what a site's agent normally does for its management node. Without it, a connected management node runs upgrades, backups and health checks (counts and states, such as disk use, failed services and how many errors were logged), but cannot read the site's logs or its server's configuration files. With it, the management node may also read the logs and files listed below. The site's owner turns this on or off on the site's Management Node page (/admin/admin_management_node), under Extra permissions: logs and host configuration. It is off until the owner turns it on, and does nothing while the site is not connected.

It exists so that whoever runs the management node can see why something went wrong (a failed upgrade, a stuck service, a mail problem) without signing in to the server.

How it is enforced

The site's agent decides, on the site's own server. While the switch is off, the agent refuses every request for a log or a configuration file and tells the management node why, whatever the management node asks. It reads only the files and tables named on this page; there is no request that names a path or runs a query of the management node's choosing.

Before anything leaves the server, the agent masks passwords, tokens and the personal half of email addresses in what it sends.

What it may read

Site logs

The last 200 lines, and the previous day's copy:

  • Error log: logs/error.log
  • Scheduled tasks log: logs/cron_scheduled_tasks.log
  • AI worker log: logs/joinery_ai_worker.log
  • Install executor log: logs/install_executor.log
  • Host converger log: /var/log/joinery/host_converger.<site>.log (in a site container /var/lib/joinery/sites/<site>/host_converger.log; the journal on a host with a data root)
  • Pull log, on a server that follows git main: logs/follow_main.log
  • PostgreSQL cluster log
  • The web server's access log, rebuilt as time, method, path, status, size and duration only: no visitor address, referrer, browser or query string, and any part of a path that looks like a token is cut
The error log and the scheduled tasks log can also be counted: how many times each of a fixed list of problem markers (a fatal error, a permission refusal, mail sent unsigned and so on) appears since a given time.

Database logs

Any rows of the last week, 200 at a time, selected columns only:

  • Logins: who and when, not the address
  • Requests: feature, action, result and timing, not the address
  • Events
  • Form errors: the error and the page, not what was typed
  • Webhooks: provider, event and result, not the payload
  • Errors: the site's error table, with the message cut to 500 characters, never the stack trace
  • Outbox: when the site sent mail, which kind (its template, such as password reset or a payment reminder) and to which domain. Never an address, a subject or a body, and never the mail members write or forward themselves.
  • Mailbox, where the Mailbox plugin runs: how many messages each of the site's mail domains received in each hour and what became of them (stored, forwarded, rejected, filed as a report), as counts only; and the delivery reports from mail providers it filed (when, which provider, whether it could be read). Never who wrote, what about, or any address.

System service logs

The last 200 lines of:

  • Apache, PostgreSQL, cron, fail2ban and the Joinery agent
  • Unattended upgrades, apt-daily, apt-daily-upgrade, logrotate, fstrim, e2scrub_all and man-db
  • The mail apps gateway, where it runs

Host configuration files

The first 400 lines of:

  • fail2ban: /etc/fail2ban/jail.local, jail.d/joinery-sshd.local, jail.d/joinery-apache.local
  • Apache: /etc/apache2/apache2.conf, mods-available/mpm_event.conf, conf-available/joinery-remoteip.conf, conf-available/joinery-http2.conf, the site's sites-available files
  • PHP-FPM: /etc/php/*/fpm/php.ini
  • Logging: /etc/systemd/journald.conf.d/size-limit.conf, the site's /etc/logrotate.d file
  • Scheduled tasks: the site's, the agent's and certbot's files in /etc/cron.d/
  • Updates: /etc/apt/apt.conf.d/20auto-upgrades, 50unattended-upgrades
  • Docker: /etc/docker/daemon.json
  • Hardening: /etc/sysctl.d/99-security.conf
  • Mail: /etc/postfix/main.cf, master.cf, and the rspamd files in /etc/rspamd/local.d/ and override.d/options.inc

Never read or sent

  • Member addresses, submitted form contents and webhook payloads
  • Members' mail, files and other content
  • Files holding keys or passwords, such as the mail signing keys, the certificates and Globalvars_site.php
  • Who signed in to the server over SSH, or from where