diff --git a/changes/bug12751-systemd-filesystem-sandbox b/changes/bug12751-systemd-filesystem-sandbox new file mode 100644 index 0000000000..0abaa4cf6f --- /dev/null +++ b/changes/bug12751-systemd-filesystem-sandbox @@ -0,0 +1,5 @@ + o Distribution: + - systemd unit file: only allow tor to write to /var/lib/tor + and /var/log/tor. The rest of the filesystem is accessible + for reading only. + Patch by intrigeri; resolves ticket 12751. diff --git a/contrib/dist/tor.service.in b/contrib/dist/tor.service.in index 2fe51c75d9..8c70ccc6e3 100644 --- a/contrib/dist/tor.service.in +++ b/contrib/dist/tor.service.in @@ -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