Bug 1301718 - allow setup with per-instance tor users (minimal change required)
Summary: allow setup with per-instance tor users (minimal change required)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: tor
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-25 19:38 UTC by nusenu
Modified: 2020-11-05 09:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-25 20:06:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description nusenu 2016-01-25 19:38:17 UTC
Description of problem:
I'm currently implementing per-instance tor-user support for Fedora/EPEL where every tor instance is run with a distinct system user (Debian comes with that out of the box).

Filesystem permissions and systemd hardening make it a bit hard on RPM based systems.
 
Default permissions:
drwxr-x---. 2 toranon root 4096 Jan 25 00:00 /var/lib/tor

The change that is required is minimal, adding the following like to the service file would do it: 

ReadWriteDirectories=/var/lib/tor-instances
(this is also the default per-instance datadir location on Debian)

Optionally also:
ReadWriteDirectories=/var/log/tor-instances


Note: I don't want every tor-instance account become a toranon group member because that would allow them to do more than they should.

/var/lib/tor-instances does not need to be created by the package.
I'll create it as needed with root:root 0755 permissions.

thanks!

ref
https://github.com/nusenu/ansible-relayor/issues/58

Comment 1 Jamie Nguyen 2016-01-25 20:06:25 UTC
It doesn't make sense to add ReadWriteDirectories for a directory that isn't part of the Tor package.

You can extend the Fedora service file using systemd snippets:
http://www.freedesktop.org/software/systemd/man/systemd.unit.html#id-1.11.3


Note You need to log in before you can comment on or make changes to this bug.