diff --git a/log2ram-daily.service b/log2ram-daily.service index a8e2933..fee0058 100644 --- a/log2ram-daily.service +++ b/log2ram-daily.service @@ -4,3 +4,20 @@ After=log2ram.service [Service] ExecStart=/bin/systemctl reload log2ram.service + +# Sandboxing +LockPersonality=true +MemoryDenyWriteExecute=true +NoNewPriviliges=true +PrivateDevices=true +PrivateNetwork=true + #May affect "Mail" in log2ram.conf. +ProtectClock=true +ProtectControlGroups=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectKernelModules=true +ProtectKernelTunables=true +RestrictSUIDSGID=true +ProtectSystem=strict +ProtectHome=true diff --git a/log2ram.service b/log2ram.service index 70c4681..130efb1 100644 --- a/log2ram.service +++ b/log2ram.service @@ -15,5 +15,25 @@ ExecReload= /usr/local/bin/log2ram write TimeoutStartSec=120 RemainAfterExit=yes +# Sandboxing +LockPersonality=true +MemoryDenyWriteExecute=true +NoNewPriviliges=true +PrivateDevices=true +PrivateNetwork=true + #May break "MAIL" in log2ram.conf if it points to non-local web address. +ProtectClock=true +ProtectControlGroups=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectKernelModules=true +ProtectKernelTunables=true +RestrictSUIDSGID=true +ProtectSystem=true + # ALT: ProtectSystem=full # needs rw whitelisting for /var/hdd.log/ +ProtectHome=true + #may cause breakage in situations wherein user has configured log2ram to also copy logs from $HOME. + #can probably fix with systemctl edit to whitelist relevant dirs. See: ReadWritePaths= + [Install] WantedBy=sysinit.target