mrtg_selinux(8)
π mrtg_selinux β the SELinux glow-up for your mrtg processes β¨
Okay bestie, so this one's called mrtg_selinux (section 8 of the manual, iykyk) and it's literally all about how Security-Enhanced Linux secures your mrtg processes. Buckle up, it's giving security realness. π«Ά
πΈ NAME πΈ
mrtg_selinux β Security Enhanced Linux Policy for the mrtg processes. No cap, that's the whole vibe.
β¨ DESCRIPTION β¨
So Security-Enhanced Linux secures the mrtg processes via flexible mandatory access control. Periodt. π
The mrtg processes execute with the mrtg_t SELinux type. Wanna check if you've got these processes running? Just execute the ps command with the -Z qualifier, fr fr.
For example:
ps -eZ | grep mrtg_t
That's it, that's the check. π
π¦ ENTRYPOINTS π¦
The mrtg_t SELinux type can be entered via the mrtg_exec_t file type. Main character energy right there. π
The default entrypoint paths for the mrtg_t domain are literally the following:
/usr/bin/mrtg
One path, one icon. Slay.
π₯ 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. SELinux mrtg policy is very flexible, allowing users to setup their mrtg processes in as secure a method as possible. Obsessed with the flexibility, ngl.
The following process types are defined for mrtg:
mrtg_t
π Note:semanage permissive -a mrtg_tcan be used to make the process typemrtg_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So like, permissive isn't a free pass β you still get the receipts.
π BOOLEANS π
SELinux policy is customizable based on least access required. The mrtg policy is extremely flexible and has several booleans that allow you to manipulate the policy and run mrtg with the tightest access possible. Lowkey iconic how much control you get. β¨
If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.
setsebool -P fips_mode 1
If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.
setsebool -P nis_enabled 1
Two booleans, two moods. Flip them with care. π§
π MANAGED FILES π
The SELinux process type mrtg_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 isn't doing all the work, bestie. π
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(/.*)?
That's a whole lotta web content paths. Ate. π
krb5_host_rcache_t
/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0
Kerberos cache realness. ποΈ
mrtg_lock_t
/run/lock/mrtg(/.*)?
/run/lock/mrtg-rrd(/.*)?
/etc/mrtg/mrtg.ok
/run/lock/subsys/mrtg
Lock data, locked in. π
mrtg_tmp_t
(No default paths listed β it's giving mysterious. β¨)
mrtg_var_lib_t
/var/lib/mrtg(/.*)?
Library files go here, periodt.
mrtg_var_run_t
/run/mrtg.pid
Just the pid file, living its best life. π
π¦ FILE CONTEXTS π¦
SELinux requires files to have an extended attribute to define the file type. It's literally the whole system, no cap.
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 mrtg policy is very flexible, allowing users to setup their mrtg processes in as secure a method as possible. We love a flexible icon. π
STANDARD FILE CONTEXT
SELinux defines the file context types for the mrtg. 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. Big moves only. π₯
semanage fcontext -a -t mrtg_exec_t '/srv/mrtg/content(/.*)?'
restorecon -R -v /srv/mymrtg_content
πΈ Note: SELinux often uses regular expressions to specify labels that match multiple files. Regex girlies rise. π
The following file types are defined for mrtg:
mrtg_etc_tβ Set files with themrtg_etc_ttype, if you want to storemrtgfiles in the/etcdirectories.mrtg_exec_tβ Set files with themrtg_exec_ttype, if you want to transition an executable to themrtg_tdomain.mrtg_initrc_exec_tβ Set files with themrtg_initrc_exec_ttype, if you want to transition an executable to themrtg_initrc_tdomain.mrtg_lock_tβ Set files with themrtg_lock_ttype, if you want to treat the files asmrtglock data, stored under the/var/lockdirectory.
Paths:
/run/lock/mrtg(/.*)?, /run/lock/mrtg-rrd(/.*)?, /etc/mrtg/mrtg.ok,
/run/lock/subsys/mrtg
mrtg_log_tβ Set files with themrtg_log_ttype, if you want to treat the data asmrtglog data, usually stored under the/var/logdirectory.mrtg_tmp_tβ Set files with themrtg_tmp_ttype, if you want to storemrtgtemporary files in the/tmpdirectories.mrtg_var_lib_tβ Set files with themrtg_var_lib_ttype, if you want to store themrtgfiles under the/var/libdirectory.mrtg_var_run_tβ Set files with themrtg_var_run_ttype, if you want to store themrtgfiles under the/runor/var/rundirectory.
π Note: File context can be temporarily modified with thechconcommand. If you want to permanently change the file context you need to use thesemanage fcontextcommand. This will modify the SELinux labeling database. You will need to userestoreconto apply the labels. Temporary vs permanent β know the difference, bestie. It matters. π
π«Ά COMMANDS π«Ά
semanage fcontextcan also be used to manipulate default file context mappings.semanage permissivecan also be used to manipulate whether or not a process type is permissive.semanage modulecan also be used to enable/disable/install/remove policy modules.semanage booleancan also be used to manipulate the booleans.system-config-selinuxis a GUI tool available to customize SELinux policy settings. For the visual learners, we see you. π
π AUTHOR π
This manual page was auto-generated using sepolicy manpage. Auto-generated and still iconic, honestly.
π SEE ALSO π
selinux(8), mrtg(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)
Go read those if you wanna go deeper. Iykyk. πβ¨
And that's the whole page, bestie! This lil masterpiece is mrtg from 26-10-06, and yes, the page name is mrtg_selinux(8) because consistency is key. Stay secure, stay slay. πππ¦
π¦ where this page comes from
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms