sendmail_selinux(8)

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

πŸ’Œ sendmail_selinux(8) β€” like, the whole SELinux tea for sendmail, bestie

okay so this is sendmail_selinux(8), the section 8 manual page all about the SELinux policy for sendmail. yes that sendmail. the mail one. grab a strawberry drink πŸ“ and let's get into it.


✨ NAME ✨

sendmail_selinux β€” Security Enhanced Linux Policy for the sendmail processes πŸ’…


🌸 DESCRIPTION 🌸

Security-Enhanced Linux secures the sendmail processes via flexible mandatory access control. like, it's giving bodyguard energy but for processes 🫢

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

For example:

ps -eZ | grep sendmail_t

that's literally it. run it. see what's up πŸ‘‘


πŸ¦‹ ENTRYPOINTS πŸ¦‹

The sendmail_t SELinux type can be entered via the mta_exec_type file type.

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

bestie. there is genuinely nothing listed here in the original. the list is empty. i'm not hiding it from you, it's just a vibe with no paths πŸ’€

πŸŽ€ PROCESS TYPES πŸŽ€

SELinux defines process types (domains) for each process running on the system.

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

Policy governs the access confined processes have to files. SELinux sendmail policy is very flexible, allowing users to set up their sendmail processes in as secure a method as possible. flexible AND secure, she contains multitudes ✨

The following process types are defined for sendmail:

  • sendmail_t
Note: semanage permissive -a sendmail_t can be used to make the process type sendmail_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, she's not blocking you anymore, but she IS still taking notes πŸ“

πŸ’œ BOOLEANS πŸ’œ

SELinux policy is customizable based on least access required. sendmail policy is extremely flexible and has several booleans that allow you to manipulate the policy and run sendmail with the tightest access possible. least privilege is the moment, 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 sendmail_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. yes, SELinux said yes but your UID still has to say yes too, it's a two-key situation πŸ”‘

cifs_t

(no paths listed for this one β€” she's pathless and mysterious 🧚)

dovecot_spool_t

/var/spool/dovecot(/.*)?

ecryptfs_t

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

etc_aliases_t

/etc/mail/.*.db
/etc/mail/aliases.*
/etc/postfix/aliases.*
/etc/aliases
/etc/aliases.db
/etc/aliases.lmdb

exim_spool_t

/var/spool/exim[0-9]?(/.*)?

fusefs_t

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

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

mail_home_rw_t

/root/Maildir(/.*)?
/root/.esmtp_queue(/.*)?
/var/lib/arpwatch/.esmtp_queue(/.*)?
/var/cache/ddclient/.esmtp_queue(/.*)?
/home/[^/]+/.maildir(/.*)?
/home/[^/]+/Maildir(/.*)?
/home/[^/]+/.esmtp_queue(/.*)?

mailman_data_t

/etc/mailman.*
/var/lib/mailman(/.*)?
/var/spool/mailman.*

mqueue_spool_t

/var/spool/(client)?mqueue(/.*)?
/var/spool/mqueue.in(/.*)?

nfs_t

(also no paths here, she's elusive πŸ¦‹)

sendmail_log_t

/var/log/mail(/.*)?
/var/log/sendmail.st.*

sendmail_var_lib_t

/var/lib/sendmail(/.*)?

sendmail_var_run_t

/run/sendmail(/.*)?
/run/smtpd.sock
/run/sm-client.pid
/var/spool/clientmqueue/sm-client.pid

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

⭐ STANDARD FILE CONTEXT ⭐

SELinux defines the file context types for the sendmail. 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. two-step glow-up: tell the database, then actually apply it πŸ’…

semanage fcontext -a -t sendmail_exec_t '/srv/sendmail/content(/.*)?'
restorecon -R -v /srv/mysendmail_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise πŸ™ˆ

The following file types are defined for sendmail:

  • sendmail_exec_t β€” Set files with the sendmail_exec_t type, if you want to transition an executable to the sendmail_t domain.

Paths:

/usr/bin/sendmail(.sendmail)?, /usr/bin/esmtp, /usr/bin/msmtp,
/usr/bin/rmail, /usr/bin/smtpd, /usr/bin/ssmtp, /usr/bin/msmtpd,
/usr/lib/sendmail, /usr/bin/esmtp-wrapper, /var/qmail/bin/sendmail,
/usr/bin/sendmail.postfix
  • sendmail_initrc_exec_t β€” Set files with the sendmail_initrc_exec_t type, if you want to transition an executable to the sendmail_initrc_t domain.

Paths:

/etc/mail/system/sm-client.pre, /etc/rc.d/init.d/sendmail
  • sendmail_keytab_t β€” Set files with the sendmail_keytab_t type, if you want to treat the files as kerberos keytab files. πŸ”‘
  • sendmail_log_t β€” Set files with the sendmail_log_t type, if you want to treat the data as sendmail log data, usually stored under the /var/log directory.

Paths:

/var/log/mail(/.*)?, /var/log/sendmail.st.*
  • sendmail_tmp_t β€” Set files with the sendmail_tmp_t type, if you want to store sendmail temporary files in the /tmp directories.
  • sendmail_var_lib_t β€” Set files with the sendmail_var_lib_t type, if you want to store the sendmail files under the /var/lib directory.
  • sendmail_var_run_t β€” Set files with the sendmail_var_run_t type, if you want to store the sendmail files under the /run or /var/run directory.

Paths:

/run/sendmail(/.*)?, /run/smtpd.sock, /run/sm-client.pid,
/var/spool/clientmqueue/sm-client.pid
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. chcon is a temporary vibe, semanage fcontext + restorecon is forever. periodt. πŸ’€

πŸ”₯ 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. yes bestie, a GUI, for when the terminal needs a little break ✨

πŸ‘‘ AUTHOR πŸ‘‘

This manual page was auto-generated using sepolicy manpage. a bot wrote this, and honestly? she ate πŸ€–πŸ’–


🌟 SEE ALSO 🌟

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


and that's the whole page, bestie!! mwah πŸ’‹

this cutie was brought to you by sendmail on 26-10-06, page sendmail_selinux(8) β€” go forth and label responsibly πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from