Skip to content

v0.3.0

Choose a tag to compare

@wushilin wushilin released this 27 Sep 10:24
· 20 commits to master since this release

Security hardening and supervisor fixes. Some existing configurations stop loading after the upgrade. Read "Before upgrading" first.

Before upgrading

  • Auto-service directories must be root-controlled. An auto-service directory owned by (or writable by) the service user is now skipped with an auto_service_dir_not_root_controlled warning. Its service stops on the next load. Such a directory can never hold a trusted definition, because the user can rename any root-owned file, even its own log, into service.yml. To migrate, move the definition to config_directory and point process.working_directory at the old directory:
    sudo cp dropins/<app>/service.yml conf.d/<app>.yaml && sudo chown root: conf.d/<app>.yaml
    # then add under process:   working_directory: /path/to/dropins/<app>
    A config_directory definition with the same name takes precedence over the skipped directory, with no conflict error.
  • Definition files must be root-owned and have a single hard link. They may not be writable by others, and may be group-writable only if the group is root.
  • Provisioning refuses setuid/setgid modes and paths containing ...
  • max_cpu must be 10m–1024 cores.
  • Durations are capped at 30 days.
  • User flags may only contain [a-z0-9_.:-].
  • Admin actions whose program or script arguments a non-root user could modify are refused at run time. The daemon logs a warning at startup. command[0] must be absolute and may not be env.
  • Web console bcrypt hashes above cost 16 are rejected.

Security

  • Root no longer follows symlinks below the root-controlled part of a path when it writes, rotates, prunes or views logs, provisions, reads @file:// values or writes admin-action logs. Root-placed symlinks are resolved one hop at a time, and every directory along the way is trust-checked.
  • Provisioning works through pinned file descriptors. That covers the recursive chown and setting the capability via fsetxattr (the setcap binary is no longer needed). It refuses hard-linked targets.
  • Rotated logs are gzipped in-process. gzip -f used to follow symlinks.
  • The provisioning marker can no longer hang or exhaust the daemon (FIFO, sparse file).
  • Web console:
    • bcrypt verification concurrency is capped;
    • a source that fails 10 times is locked out, with backoff up to 15 min;
    • the dummy hash's cost matches the configured users' cost, so response time no longer reveals which usernames exist;
    • anti-framing, nosniff and no-referrer headers are sent;
    • HTTPS now shuts down gracefully;
    • systemctl option injection through unit names is closed.
  • pmctl/processmaster neutralise terminal escape sequences in service logs and events when printing to a TTY.
  • The control socket has a 10 s request timeout and a 256-connection cap. Requests that would start processes are refused during shutdown.
  • Admin actions run in per-id cgroups, one run per id at a time.

Fixes

  • A service that exits immediately after being started (boot, manual start or restart, reload) is now handled by its restart policy (backoff, then FAILED after the tolerance) instead of being marked FAILED on the first attempt.
  • A service that exited a few milliseconds after being observed running could be left RUNNING forever with nothing running and no restart: the exit waiter was not attached. Found by the new scenario tests on GitHub's faster runners.
  • A manual start of a FAILED service gets a fresh restart budget.
  • Stopping during a backoff cancels the pending restart.
  • update no longer double-starts a crashing service.
  • Provisioning is re-applied automatically when a target changes (e.g. a redeployed binary loses cap_net_bind_service). Old markers trigger one re-run.
  • logs -f no longer stops after 64 MiB.
  • Out-of-range numbers no longer cause panics or overflows.
  • A cgroup.name with a leading / works.
  • The embedded build time/host is no longer frozen at whenever build.rs last changed.

Build and test

  • GitHub Actions workflow: tests, root-only supervisor scenarios, static musl builds for x86_64 and aarch64, and release assets on tags.
  • tests/supervisor_scenarios.rs runs real daemons against real cgroups: crash loops, daemonizing, SIGTERM-immune, fan-out and more.