qm_selinux - Man Page

Security Enhanced Linux Policy for the qm processes

Description

Security-Enhanced Linux secures the qm processes via flexible mandatory access control.

The qm processes execute with the qm_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 qm_t

Entrypoints

The qm_t SELinux type can be entered via the qm_file_type file type.

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

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 psbP

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

The following process types are defined for qm:

qm_t, qm_container_t, qm_container_kvm_t, qm_container_init_t, qmail_clean_t, qmail_inject_t, qmail_local_t, qmail_lspawn_t, qmail_queue_t, qmail_remote_t, qmail_rspawn_t, qmail_send_t, qmail_smtpd_t, qmail_splogger_t, qmail_start_t, qmail_tcp_env_t

Note: semanage permissive -a qm_t can be used to make the process type qm_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated.

Booleans

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

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

Managed Files

The SELinux process type qm_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.

cgroup_t

/sys/fs/cgroup

initrc_tmp_t

mnt_t

/mnt(/[^/]*)?
/mnt(/[^/]*)?
/rhev(/[^/]*)?
/rhev/[^/]*/.*
/media(/[^/]*)?
/media(/[^/]*)?
/media/.hal-.*
/var/run/media(/[^/]*)?
/afs
/net
/misc
/rhev

net_conf_t

/etc/hosts[^/]*
/etc/yp.conf.*
/etc/denyhosts.*
/etc/hosts.deny.*
/etc/resolv.conf.*
/etc/.resolv.conf.*
/etc/resolv-secure.conf.*
/var/run/cloud-init(/.*)?
/var/run/systemd/network(/.*)?
/etc/sysconfig/networking(/.*)?
/etc/sysconfig/network-scripts(/.*)?
/etc/sysconfig/network-scripts/.*resolv.conf
/var/run/NetworkManager/resolv.conf.*
/etc/ethers
/etc/ntp.conf
/var/run/systemd/resolve/resolv.conf
/var/run/systemd/resolve/stub-resolv.conf
/var/run/NetworkManager/no-stub-resolv.conf

qm_file_type

security_t

/selinux

tmp_t

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

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 lsbP

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

STANDARD FILE CONTEXT

SELinux defines the file context types for the qm, 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 qm_file_t '/srv/qm/content(/.*)?'
restorecon -R -v /srv/myqm_content

Note: SELinux often uses regular expressions to specify labels that match multiple files.

The following file types are defined for qm:

qm_container_file_t

- Set files with the qm_container_file_t type, if you want to treat the files as qm container content.

qm_container_kvm_var_run_t

- Set files with the qm_container_kvm_var_run_t type, if you want to store the qm container kvm files under the /run or /var/run directory.

qm_container_ro_file_t

- Set files with the qm_container_ro_file_t type, if you want to treat the files as qm container ro content.

Paths:

/usr/lib/qm/rootfs/var/lib/containers/storage/overlay(/.*)?, /usr/lib/qm/rootfs/var/lib/containers/storage/overlay2(/.*)?, /usr/lib/qm/rootfs/var/lib/containers/storage/overlay-images(/.*)?, /usr/lib/qm/rootfs/var/lib/containers/storage/overlay-layers(/.*)?, /usr/lib/qm/rootfs/var/lib/containers/storage/overlay2-images(/.*)?, /usr/lib/qm/rootfs/var/lib/containers/storage/overlay2-layers(/.*)?

qm_container_var_lib_t

- Set files with the qm_container_var_lib_t type, if you want to store the qm container files under the /var/lib directory.

qm_file_t

- Set files with the qm_file_t type, if you want to treat the files as qm content.

qmail_alias_home_t

- Set files with the qmail_alias_home_t type, if you want to store qmail alias files in the users home directory.

Paths:

/var/qmail/alias(/.*)?, /var/qmail/alias

qmail_clean_exec_t

- Set files with the qmail_clean_exec_t type, if you want to transition an executable to the qmail_clean_t domain.

qmail_etc_t

- Set files with the qmail_etc_t type, if you want to store qmail files in the /etc directories.

Paths:

/var/qmail/owners(/.*)?, /var/qmail/control(/.*)?

qmail_exec_t

- Set files with the qmail_exec_t type, if you want to transition an executable to the qmail_t domain.

qmail_inject_exec_t

- Set files with the qmail_inject_exec_t type, if you want to transition an executable to the qmail_inject_t domain.

qmail_keytab_t

- Set files with the qmail_keytab_t type, if you want to treat the files as kerberos keytab files.

qmail_local_exec_t

- Set files with the qmail_local_exec_t type, if you want to transition an executable to the qmail_local_t domain.

qmail_lspawn_exec_t

- Set files with the qmail_lspawn_exec_t type, if you want to transition an executable to the qmail_lspawn_t domain.

qmail_queue_exec_t

- Set files with the qmail_queue_exec_t type, if you want to transition an executable to the qmail_queue_t domain.

qmail_remote_exec_t

- Set files with the qmail_remote_exec_t type, if you want to transition an executable to the qmail_remote_t domain.

qmail_rspawn_exec_t

- Set files with the qmail_rspawn_exec_t type, if you want to transition an executable to the qmail_rspawn_t domain.

qmail_send_exec_t

- Set files with the qmail_send_exec_t type, if you want to transition an executable to the qmail_send_t domain.

qmail_smtpd_exec_t

- Set files with the qmail_smtpd_exec_t type, if you want to transition an executable to the qmail_smtpd_t domain.

qmail_splogger_exec_t

- Set files with the qmail_splogger_exec_t type, if you want to transition an executable to the qmail_splogger_t domain.

qmail_spool_t

- Set files with the qmail_spool_t type, if you want to store the qmail files under the /var/spool directory.

qmail_start_exec_t

- Set files with the qmail_start_exec_t type, if you want to transition an executable to the qmail_start_t domain.

qmail_tcp_env_exec_t

- Set files with the qmail_tcp_env_exec_t type, if you want to transition an executable to the qmail_tcp_env_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.

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.

Author

This manual page was auto-generated using sepolicy manpage .

See Also

selinux(8), qm(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8), qm_container_selinux(8), qm_container_selinux(8), qm_container_init_selinux(8), qm_container_init_selinux(8), qm_container_kvm_selinux(8), qm_container_kvm_selinux(8)

Info

23-04-12 SELinux Policy qm