]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
systemd unit file: only allow tor to write to /var/lib/tor and /var/log/tor (#12751).
authorintrigeri <intrigeri@boum.org>
Wed, 27 Aug 2014 03:05:12 +0000 (03:05 +0000)
committerintrigeri <intrigeri@boum.org>
Wed, 27 Aug 2014 03:13:53 +0000 (03:13 +0000)
The rest of the filesystem is accessible for reading only. Still, quoting
systemd.exec(5):

  Note that restricting access with these options does not extend to submounts
  of a directory that are created later on.

contrib/dist/tor.service.in

index 2fe51c75d912d276e761359e42aaa645abc9d107..8c70ccc6e387dc9fbd79deb7c97a70aa808fcf28 100644 (file)
@@ -19,6 +19,9 @@ PrivateTmp = yes
 DeviceAllow = /dev/null rw
 DeviceAllow = /dev/urandom r
 InaccessibleDirectories = /home
+ReadOnlyDirectories = /
+ReadWriteDirectories = @LOCALSTATEDIR@/lib/tor
+ReadWriteDirectories = @LOCALSTATEDIR@/log/tor
 
 [Install]
 WantedBy = multi-user.target