crontab_selinux(8)

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

πŸ’… crontab_selinux(8) β€” the crontab SELinux tea πŸŽ€

okay bestie, so this is the crontab_selinux page, part of the SELinux Policy crontab manual. it's short, it's sweet, it's giving "here's exactly how the crontab processes get locked down" and honestly we're obsessed. let's get into it ✨


🌸 NAME 🌸

crontab_selinux β€” the Security Enhanced Linux policy for the crontab processes. that's it, that's the name, slay.


✨ DESCRIPTION ✨

Security-Enhanced Linux secures the crontab processes via flexible mandatory access control. yes bestie, the security is mandatory, the vibes are immaculate.

the crontab processes run with the crontab_t SELinux type. wanna check if you've got these processes running? just execute the ps command with the -Z qualifier, like this:

ps -eZ | grep crontab_t

that's the whole vibe check right there πŸ¦‹


πŸšͺ ENTRYPOINTS πŸšͺ

so the crontab_t SELinux type can be entered via the crontab_exec_t file type. it's giving "the door to the domain" and we love a clear entrance πŸ’«

the default entrypoint paths for the crontab_t domain are literally these:

/usr/bin/(f)?crontab, /usr/bin/at, /usr/bin/fcronsighup,
/usr/libexec/fcronsighup

πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (domains) for each process running on the system. yes, every single one gets a little domain of its own, main character energy fr fr.

you can see the context of a process using the -Z option to ps β€” same trick as before, it never misses.

policy governs the access confined processes have to files. the SELinux crontab policy is very flexible, allowing users to setup their crontab processes in as secure a method as possible. highkey the best of both worlds 🌈

the following process types are defined for crontab:

  • crontab_t
Note: semanage permissive -a crontab_t can be used to make the process type crontab_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it stops blocking but it still tells on you. the audacity πŸ’€

πŸŽ€ BOOLEANS πŸŽ€

SELinux policy is customizable based on least access required. the crontab policy is extremely flexible and has several booleans that let you manipulate the policy and run crontab with the tightest access possible. icon behavior, no cap.

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

πŸ“ MANAGED FILES πŸ“

the SELinux process type crontab_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. note: the process's UID still needs to have DAC permissions. SELinux isn't doing your whole job for you bestie, it's a team effort 🫢

  • crontab_tmp_t
  • faillog_t
/var/log/btmp.*
/run/faillock(/.*)?
/var/log/faillog.*
/var/log/tallylog.*
  • 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
  • var_auth_t
/var/ace(/.*)?
/var/rsa(/.*)?
/var/lib/abl(/.*)?
/var/lib/rsa(/.*)?
/var/lib/pam_ssh(/.*)?
/var/lib/pam_shield(/.*)?
/var/opt/quest/vas/vasd(/.*)?
/var/lib/google-authenticator(/.*)?

πŸ—‚οΈ FILE CONTEXTS πŸ—‚οΈ

SELinux requires files to have an extended attribute to define the file type. it's the file's little name tag at the party, iykyk πŸ’…

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

policy governs the access confined processes have to these files. the SELinux crontab policy is very flexible, allowing users to setup their crontab processes in as secure a method as possible. (yes we said it again, it's that flexible, periodt.)

⭐ STANDARD FILE CONTEXT ⭐

SELinux defines the file context types for the crontab. 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. the two-step glow-up, always:

semanage fcontext -a -t crontab_exec_t '/srv/crontab/content(/.*)?'
restorecon -R -v /srv/mycrontab_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. so the wildcards are doing a lot of heavy lifting, respect them πŸ™ˆ

the following file types are defined for crontab:

crontab_exec_t

  • set files with the crontab_exec_t type, if you want to transition an executable to the crontab_t domain.

paths:

/usr/bin/(f)?crontab, /usr/bin/at, /usr/bin/fcronsighup,
/usr/libexec/fcronsighup

crontab_tmp_t

  • set files with the crontab_tmp_t type, if you want to store crontab temporary files in the /tmp directories.
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: chcon = quick lil touch-up, semanage fcontext + restorecon = the permanent glow-up. don't mix them up bestie 😭

πŸ› οΈ COMMANDS πŸ› οΈ

here's the squad of tools that can also do stuff:

  • 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. (yes, a GUI, for the visual learners πŸ’–)

🌟 AUTHOR 🌟

this manual page was auto-generated using sepolicy manpage. no human author, just robot energy, and honestly? it ate πŸ€–βœ¨


πŸ”— SEE ALSO πŸ”—

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


and that's the whole page diva πŸ’œ this beauty came from source crontab, dated 26-10-06, and belongs to the crontab_selinux(8) manual β€” go forth and label your files correctly, mwah πŸŽ€πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from