Add systemd hardening options

This commit is contained in:
Gavin John
2024-06-27 10:44:02 +02:00
committed by xytovl
parent 9aa5ff638e
commit ffade1e48a
6 changed files with 306 additions and 44 deletions
+9
View File
@@ -0,0 +1,9 @@
[Unit]
Description=OpenXR streaming server
[Service]
Type=simple
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/wivrn-server --application
Restart=on-failure
RestartSec=0
PrivateTmp=true
+15
View File
@@ -4,3 +4,18 @@ Description=OpenXR streaming server
[Service]
Type=simple
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/wivrn-server
CapabilityBoundingSet=CAP_SYS_NICE
AmbientCapabilities=CAP_SYS_NICE
LockPersonality=true
NoNewPrivileges=true
PrivateTmp=true
ProtectClock=true
ProtectControlGroups=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=strict
RemoveIPC=true
RestrictNamespaces=true
RestrictSUIDSGID=true