Skip to content

Harden Backmaster systemd services - #4

Merged
SakuraIsayeki merged 1 commit into
mainfrom
hardening/systemd-dropin
Nov 8, 2026
Merged

SakuraIsayeki merged 1 commit into
mainfrom
hardening/systemd-dropin

Conversation

@SakuraIsayeki

Copy link
Copy Markdown
Member

Summary

Install a shared vendor systemd drop-in for both backup and health service templates. The existing service identities and configured backup, staging, and exporter paths remain unchanged.

  • CapabilityBoundingSet= removes Linux capabilities; LockPersonality=yes locks the execution domain.
  • ProtectKernelTunables=yes, ProtectKernelModules=yes, and ProtectControlGroups=yes restrict changes to host kernel and cgroup settings.
  • RestrictRealtime=yes blocks realtime scheduling and RestrictSUIDSGID=yes blocks setting set-ID file bits. The backup unit already had the latter; the shared drop-in also covers health checks.
  • Preserve process creation and network access for drivers, PostgreSQL clients, Consul, and exporters. Document the inherited path restrictions, custom-component exceptions, rollout, and rollback.

The sandbox applies to the services and their children, not manual CLI calls or PostgreSQL archive/restore commands running under the database service. It does not isolate data or other processes belonging to the same service account.

Validation

  • All existing shell test suites passed, including package build and checks that both installed drop-ins match the source.
  • Bash syntax checks and git diff --check passed.
  • systemd-analyze verify on systemd 257 loaded both template drop-ins with test copies using /bin/true in place of the unavailable installed executable.
  • ShellCheck was unavailable locally. This environment does not run systemd as PID 1, so no real sandboxed backup, health check, remote publication, or restore was run. Before relying on the upgrade, test the actual configured drivers/exporters and an isolated restore on a representative host.

@SakuraIsayeki
SakuraIsayeki force-pushed the hardening/systemd-dropin branch from 551f704 to db78616 Compare November 8, 2026 13:00
@SakuraIsayeki
SakuraIsayeki merged commit abffba9 into main Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant