rtorrent_selinux(8)

πŸ“¦ version 20250627+git412.dbf877ab7, in opensuse-leap 16.0

🌸 rtorrent_selinux β€” your bestie's guide to SELinux & rtorrent ✨

Okay so picture this: it's giving manual page, but from the SELinux Policy rtorrent manual, and I'm about to walk you through it like we're texting at 2am. No cap, this is the whole thing β€” every flag, every path, every boolean. Buckle up, bestie πŸ’–


πŸŽ€ NAME πŸŽ€

rtorrent_selinux β€” the Security Enhanced Linux Policy for all the rtorrent processes. Iconic behavior only.


πŸ¦‹ DESCRIPTION πŸ¦‹

Security-Enhanced Linux is out here securing the rtorrent processes via flexible mandatory access control. Periodt.

The rtorrent processes execute with the rtorrent_t SELinux type. You can vibe-check if you have these processes running by executing the ps command with the -Z qualifier.

For example:

ps -eZ | grep rtorrent_t

Literally just run that and see what's up πŸ”₯


🌈 ENTRYPOINTS 🌈

The rtorrent_t SELinux type can be entered via the rtorrent_exec_t file type.

The default entrypoint paths for the rtorrent_t domain are the following:

/usr/bin/rtorrent

That's the main character path right there πŸ‘‘


πŸ’œ PROCESS TYPES πŸ’œ

SELinux defines process types (domains) for each process running on the system. It's a whole thing.

You can see the context of a process using the -Z option to ps.

Policy governs the access confined processes have to files. The SELinux rtorrent policy is very flexible allowing users to setup their rtorrent processes in as secure a method as possible.

The following process types are defined for rtorrent:

  • rtorrent_t
Note: semanage permissive -a rtorrent_t can be used to make the process type rtorrent_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So like... it's not a free pass, bestie, the receipts still show up 😭

✨ BOOLEANS ✨

SELinux policy is customizable based on least access required. The rtorrent policy is extremely flexible and has several booleans that allow you to manipulate the policy and run rtorrent with the tightest access possible. Love that for us.

If you want to enable necessary permissions for rutorrent, you must turn on the rtorrent_enable_rutorrent boolean. Disabled by default.

setsebool -P rtorrent_enable_rutorrent 1

If you want to allow rtorrent to execute helper scripts in home directories, you must turn on the rtorrent_exec_scripts boolean. Disabled by default.

setsebool -P rtorrent_exec_scripts 1

If you want to allow rtorrent to use send mails, you must turn on the rtorrent_send_mails boolean. Disabled by default.

setsebool -P rtorrent_send_mails 1

If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Enabled by default. (So if you want it on, you're already slaying β€” but here's the command anyway if you ever need to flip it back.)

setsebool -P nscd_use_shm 1

πŸ’… PORT TYPES πŸ’…

SELinux defines port types to represent TCP and UDP ports.

You can see the types associated with a port by using the following command:

semanage port -l

Policy governs the access confined processes have to these ports. SELinux rtorrent policy is very flexible allowing users to setup their rtorrent processes in as secure a method as possible.

The following port types are defined for rtorrent:

  • rtorrent_port_t

🌸 MANAGED FILES 🌸

The SELinux process type rtorrent_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. (SELinux is not out here overriding DAC, okay? It's not that kind of party.)

cifs_t

(no default paths listed, it's just vibes)

ecryptfs_t

/home/[^/]+/.Private(/.*)?
/home/[^/]+/.ecryptfs(/.*)?

fusefs_t

/run/user/[0-9]+/gvfs

httpd_sys_content_t

/srv/([^/]*/)?www(/.*)?
/var/www(/.*)?
/etc/htdig(/.*)?
/srv/gallery2(/.*)?
/var/lib/trac(/.*)?
/var/lib/htdig(/.*)?
/var/www/icons(/.*)?
/usr/share/glpi(/.*)?
/usr/share/htdig(/.*)?
/usr/share/drupal.*
/usr/share/z-push(/.*)?
/var/www/svn/conf(/.*)?
/usr/share/icecast(/.*)?
/var/lib/cacti/rra(/.*)?
/usr/share/ntop/html(/.*)?
/usr/share/nginx/html(/.*)?
/usr/share/doc/ghc/html(/.*)?
/usr/share/openca/htdocs(/.*)?
/usr/share/selinux-policy[^/]*/html(/.*)?

httpd_sys_rw_content_t

/etc/rt(/.*)?
/etc/glpi(/.*)?
/etc/horde(/.*)?
/etc/drupal.*
/etc/z-push(/.*)?
/var/lib/svn(/.*)?
/var/www/svn(/.*)?
/etc/owncloud(/.*)?
/var/www/html(/.*)?/uploads(/.*)?
/var/www/html(/.*)?/wp-content(/.*)?
/var/www/html(/.*)?/wp_backups(/.*)?
/var/www/html(/.*)?/sites/default/files(/.*)?
/var/www/html(/.*)?/sites/default/settings.php
/etc/mock/koji(/.*)?
/etc/nextcloud(/.*)?
/var/lib/drupal.*
/etc/zabbix/web(/.*)?
/var/lib/moodle(/.*)?
/var/log/z-push(/.*)?
/var/spool/gosa(/.*)?
/etc/WebCalendar(/.*)?
/usr/share/joomla(/.*)?
/var/lib/dokuwiki(/.*)?
/var/lib/httpd/md(/.*)?
/var/lib/owncloud(/.*)?
/var/spool/viewvc(/.*)?
/var/lib/nextcloud(/.*)?
/var/lib/pootle/po(/.*)?
/var/lib/phpMyAdmin(/.*)?
/var/www/moodledata(/.*)?
/srv/gallery2/smarty(/.*)?
/var/www/moodle/data(/.*)?
/var/lib/graphite-web(/.*)?
/var/log/shibboleth-www(/.*)?
/var/www/gallery/albums(/.*)?
/var/www/html/owncloud/data(/.*)?
/var/www/html/nextcloud/apps(/.*)?
/var/www/html/nextcloud/data(/.*)?
/var/www/html/nextcloud/config(/.*)?
/usr/share/wordpress-mu/wp-content(/.*)?
/usr/share/wordpress/wp-content/upgrade(/.*)?
/usr/share/wordpress/wp-content/uploads(/.*)?
/var/www/html/configuration.php

nfs_t

(no default paths listed, still valid tho)

tmp_t

/sandbox(/.*)?
/tmp
/usr/tmp
/var/tmp
/var/tmp
/tmp-inst
/var/tmp-inst
/var/tmp/tmp-inst
/var/tmp/vi.recover

(Yes, /var/tmp is listed twice in the original β€” not me, I'm just the messenger πŸ’€)

user_home_t

/home/[^/]+/.+

🧚 FILE CONTEXTS 🧚

SELinux requires files to have an extended attribute to define the file type.

You can see the context of a file using the -Z option to ls.

Policy governs the access confined processes have to these files. SELinux rtorrent policy is very flexible allowing users to setup their rtorrent processes in as secure a method as possible.

STANDARD FILE CONTEXT

SELinux defines the file context types for the rtorrent, if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.

semanage fcontext -a -t rtorrent_exec_t '/srv/rtorrent/content(/.*)?'
restorecon -R -v /srv/myrtorrent_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. It's giving pattern-matching queen πŸ‘‘

The following file types are defined for rtorrent:

  • rtorrent_exec_t β€” Set files with the rtorrent_exec_t type, if you want to transition an executable to the rtorrent_t domain.
Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. So like, chcon is the quick fix, semanage fcontext + restorecon is the committed relationship. Choose wisely πŸ’–

⭐ COMMANDS ⭐

semanage fcontext can also be used to manipulate default file context mappings.

semanage permissive can also be used to manipulate whether or not a process type is permissive.

semanage module can also be used to enable/disable/install/remove policy modules.

semanage port can also be used to manipulate the port definitions.

semanage boolean can also be used to manipulate the booleans.

system-config-selinux is a GUI tool available to customize SELinux policy settings. For when you want to point and click instead of typing, no judgment 🫢


πŸ“ AUTHOR πŸ“

This manual page was auto-generated using sepolicy manpage. Not me writing my own bio, the robots did it πŸ€–


🌈 SEE ALSO 🌈

  • selinux(8) β€” the whole SELinux universe
  • rtorrent(8) β€” the app itself, the moment
  • semanage(8) β€” your policy-manipulation bestie
  • restorecon(8) β€” the one that actually applies the labels
  • chcon(1) β€” the quick-and-temporary label changer
  • sepolicy(8) β€” the policy introspection tool
  • setsebool(8) β€” the boolean flipper

That's the whole page, bestie. Every path, every boolean, every note. You're now officially caught up on rtorrent_selinux(8). This beauty was served up by rtorrent, dated 26-10-06, and filed under rtorrent_selinux(8). Go forth and SELinux responsibly βœ¨πŸ’…

πŸ“¦ where this page comes from