summaryrefslogtreecommitdiff
path: root/roles/tor/files/tor.service
diff options
context:
space:
mode:
Diffstat (limited to 'roles/tor/files/tor.service')
-rw-r--r--roles/tor/files/tor.service29
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/tor/files/tor.service b/roles/tor/files/tor.service
new file mode 100644
index 0000000..d41767b
--- /dev/null
+++ b/roles/tor/files/tor.service
@@ -0,0 +1,29 @@
+[Unit]
+Description=Anonymizing overlay network for TCP
+After=network.target nss-lookup.target wg-quick@wgtor0.service
+
+[Service]
+Type=notify
+NotifyAccess=all
+ExecStartPre=/usr/bin/tor -f /etc/tor/torrc --verify-config
+ExecStart=/usr/bin/tor -f /etc/tor/torrc
+ExecReload=/bin/kill -HUP ${MAINPID}
+KillSignal=SIGINT
+TimeoutSec=60
+Restart=on-failure
+WatchdogSec=1m
+LimitNOFILE=32768
+
+# Hardening
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectHome=yes
+ProtectSystem=full
+ReadOnlyDirectories=/
+ReadWriteDirectories=-/var/lib/tor
+ReadWriteDirectories=-/var/log/tor
+NoNewPrivileges=yes
+CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE CAP_DAC_READ_SEARCH CAP_KILL
+
+[Install]
+WantedBy=multi-user.target