File tree Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,45 @@ StartLimitIntervalSec=60
99
1010[Service]
1111Type=forking
12- PIDFile=@RUNSTATEDIR@/smartdns.pid
12+ DynamicUser=true
13+ RuntimeDirectory=smartdns
14+ LogsDirectory=smartdns
15+ CacheDirectory=smartdns
16+ PIDFile=/run/smartdns/smartdns.pid
1317EnvironmentFile=@SYSCONFDIR@/default/smartdns
14- ExecStart=@SBINDIR@/smartdns -p @RUNSTATEDIR@/smartdns.pid $SMART_DNS_OPTS
18+ LoadCredential=smartdns.conf:@SYSCONFDIR@/smartdns/smartdns.conf
19+ ExecStart=@SBINDIR@/smartdns -p $PIDFILE -c "${CREDENTIALS_DIRECTORY}/smartdns.conf" $SMART_DNS_OPTS
1520Restart=always
1621RestartSec=2
1722TimeoutStopSec=15
1823
24+ # Capabilities
25+ CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
26+ AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
27+
28+ # Hardening options
29+ DevicePolicy=closed
30+ LockPersonality=true
31+ MemoryAccounting=true
32+ MemoryDenyWriteExecute=true
33+ NoNewPrivileges=true
34+ PrivateDevices=true
35+ PrivateTmp=true
36+ ProcSubset=pid
37+ ProtectClock=true
38+ ProtectControlGroups=true
39+ ProtectHome=true
40+ ProtectHostname=true
41+ ProtectKernelLogs=true
42+ ProtectKernelModules=true
43+ ProtectKernelTunables=true
44+ ProtectProc=invisible
45+ ProtectSystem=strict
46+ RemoveIPC=true
47+ RestrictNamespaces=true
48+ RestrictRealtime=true
49+ RestrictSUIDSGID=true
50+
1951[Install]
2052WantedBy=multi-user.target
2153Alias=smartdns.service
You can’t perform that action at this time.
0 commit comments