# Root, because publishing writes where the services read from. What it # publishes where, and which checks run as whom, is only ever read from the # root-owned /etc/midas/hub.conf; what it takes from the hub's user is read # refusing a symbolic link at every level, and what it writes is written # relative to a destination directory opened the same way (src/deploy.rs). [Unit] Description=midas publish (install built deploys, as root) After=midas-hub.service [Service] Type=oneshot ExecStart=/usr/local/bin/midas hub deploy-publish TimeoutStartSec=30min PrivateTmp=yes ProtectHome=read-only ProtectKernelTunables=yes ProtectKernelModules=yes ProtectControlGroups=yes # Root with only what installing files and running the checks as another # user takes: no raw sockets, no modules, no mounts, no ptrace. NoNewPrivileges=yes RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 RestrictNamespaces=yes RestrictRealtime=yes LockPersonality=yes SystemCallFilter=@system-service SystemCallErrorNumber=EPERM CapabilityBoundingSet=CAP_CHOWN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_FSETID CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_KILL CAP_AUDIT_WRITE CAP_SYS_RESOURCE