tmpreaper_selinux(8)

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

✨ tmpreaper_selinux β€” the SELinux glow-up for tmpreaper πŸ’…

Okay so bestie, welcome to the tmpreaper_selinux page from the SELinux Policy collection β€” it's giving security manual, it's giving "your processes are NOT the main character unless they're properly labeled," no cap. Let me walk you through it so you actually get it. 🫢


🌸 NAME 🌸

tmpreaper_selinux β€” Security Enhanced Linux Policy for the tmpreaper processes. Literally what it says on the tin, bestie.


πŸ¦‹ DESCRIPTION πŸ¦‹

Security-Enhanced Linux secures the tmpreaper processes via flexible mandatory access control. That's the whole vibe β€” SELinux is the bouncer, your processes need the right wristband.

The tmpreaper processes execute with the tmpreaper_t SELinux type. Wanna check if you've got these processes running? Run the ps command with the -Z qualifier, like this:

ps -eZ | grep tmpreaper_t

See? Easy. Slay. πŸ”₯


πŸ’– ENTRYPOINTS πŸ’–

The tmpreaper_t SELinux type can be entered via the tmpreaper_exec_t file type. That's the doorway, iykyk.

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

  • /usr/bin/tmpwatch
  • /usr/bin/tmpreaper
  • /etc/rc.d/init.d/mountall-bootclean.sh
  • /etc/rc.d/init.d/mountnfs-bootclean.sh

Those four. Memorize them if you want, or don't β€” the policy remembers for you. πŸ’…


πŸŽ€ PROCESS TYPES πŸŽ€

SELinux defines process types (domains) for each process running on the system. Yes, every single one. It's a lot, but it's iconic.

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

Policy governs the access confined processes have to files. SELinux tmpreaper policy is very flexible, allowing users to setup their tmpreaper processes in as secure a method as possible. Flexible AND secure? We love to see it. ✨

The following process types are defined for tmpreaper:

  • tmpreaper_t
Note: semanage permissive -a tmpreaper_t can be used to make the process type tmpreaper_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So it's chill about access but still snitches in the logs. πŸ™ˆ

🌈 BOOLEANS 🌈

SELinux policy is customizable based on least access required. tmpreaper policy is extremely flexible and has several booleans that allow you to manipulate the policy and run tmpreaper with the tightest access possible. It's giving "minimalism but make it security."

If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. It's 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. It's disabled by default.

setsebool -P nis_enabled 1

Two booleans, two little switches. Flip them wisely. 🧚


πŸ’œ MANAGED FILES πŸ’œ

The SELinux process type tmpreaper_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. But heads up β€” note the processes UID still need to have DAC permissions. SELinux isn't out here overriding classic Unix perms, it's just adding a layer of fabulous on top. ⭐

  • antivirus_db_t
    • /var/amavis(/.*)?
    • /var/clamav(/.*)?
    • /var/lib/clamd.*
    • /var/lib/amavis(/.*)?
    • /var/lib/clamav(/.*)?
    • /var/virusmails(/.*)?
    • /var/opt/f-secure(/.*)?
    • /var/spool/amavisd(/.*)?
    • /var/lib/clamav-unofficial-sigs(/.*)?
  • kismet_log_t
    • /var/log/kismet(/.*)?
  • 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
  • ntpd_log_t
    • /var/log/ntp.*
    • /var/log/xntpd.*
    • /var/log/ntpstats(/.*)?
    • /var/lib/ntp/var/log/ntp.*
    • /var/lib/ntp/var/log/xntpd.*
    • /var/lib/ntp/var/log/ntpstats(/.*)?
  • print_spool_t
    • /var/spool/lpd(/.*)?
    • /var/spool/cups(/.*)?
    • /var/spool/cups-pdf(/.*)?
  • rpm_var_cache_t
    • /var/adm/mount(/.*)?
    • /var/cache/dnf(/.*)?
    • /var/cache/yum(/.*)?
    • /var/cache/zypp(/.*)?
    • /var/spool/up2date(/.*)?
    • /var/cache/PackageKit(/.*)?

That's the full roster, bestie. Every path accounted for. No crumbs. πŸ“


πŸ”₯ FILE CONTEXTS πŸ”₯

SELinux requires files to have an extended attribute to define the file type. It's like a name tag but for files.

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 tmpreaper policy is very flexible, allowing users to setup their tmpreaper processes in as secure a method as possible.

🌟 STANDARD FILE CONTEXT 🌟

SELinux defines the file context types for the tmpreaper. 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 tmpreaper_exec_t '/srv/tmpreaper/content(/.*)?'
restorecon -R -v /srv/mytmpreaper_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. So yes, that regex-looking thing is on purpose. πŸ’…

The following file types are defined for tmpreaper:

  • tmpreaper_exec_t β€” Set files with the tmpreaper_exec_t type if you want to transition an executable to the tmpreaper_t domain.

Paths:

  • /usr/bin/tmpwatch
  • /usr/bin/tmpreaper
  • /etc/rc.d/init.d/mountall-bootclean.sh
  • /etc/rc.d/init.d/mountnfs-bootclean.sh
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 and semanage fcontext + restorecon is the whole commitment. Choose your energy. πŸŽ€

πŸ‘‘ 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 boolean can also be used to manipulate the booleans.

system-config-selinux is a GUI tool available to customize SELinux policy settings. For the besties who prefer buttons over typing. 😭


πŸ¦‹ AUTHOR πŸ¦‹

This manual page was auto-generated using sepolicy manpage. The script did the writing, I just did the glow-up. πŸ’–


🌈 SEE ALSO 🌈

selinux(8), tmpreaper(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)


And that's the whole page, bestie! This gem is from the tmpreaper manual, dated 26-10-06, and it's slated under version tmpreaper β€” periodt. Go forth and label responsibly. πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from