summarylogtreecommitdiffstats
path: root/tbamud.service
blob: e6c24b86d514f06a8dc825b49dbff9bf18708642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
[Unit]
Description=tbaMUD Server
After=network.target
Requires=network.target

[Service]
Type=simple
WorkingDirectory=/var/lib/tbamud
ExecStartPre=/usr/bin/chown -R tbamud:tbamud /var/lib/tbamud
ExecStart=/usr/bin/tbamud -q 4000
Restart=always
RestartSec=5

User=tbamud
Group=tbamud
PermissionsStartOnly=true

# Logging
StandardOutput=journal
StandardError=journal
StandardInput=null

# Networking
RestrictAddressFamilies=AF_INET AF_INET6
IPAccounting=yes

# Filesystem sandbox
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
ProcSubset=pid
ProtectProc=ptraceable
ReadWritePaths=/var/lib/tbamud

# User separation
DynamicUser=no
PrivateUsers=no

# Devices and kernel
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes

# Capabilities
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
NoNewPrivileges=yes

# Misc hardening
ProtectHostname=yes
ProtectClock=yes
ProtectControlGroups=yes
RestrictNamespaces=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RemoveIPC=yes

# System call filtering
SystemCallFilter=@system-service
SystemCallFilter=~@resources @privileged
SystemCallArchitectures=native

# Crash handling via journald/coredumpctl
LimitCORE=infinity

[Install]
WantedBy=multi-user.target