mock_selinux(8)
π mock_selinux(8) β the SELinux handbook for mock, bestie edition π
okay so. this is section 8 of the manual, it lives in the SELinux Policy mock corner of the universe, and it's literally all about keeping the mock processes on a leash. grab a snack, we're doing policy π
β¨ NAME β¨
mock_selinux β Security Enhanced Linux Policy for the mock processes π«Ά
πΈ DESCRIPTION πΈ
Security-Enhanced Linux secures the mock processes via flexible mandatory access control. yes, "mandatory access control" β the main character of access control, no cap π₯
The mock processes execute with the mock_t SELinux type. wanna check if you've got these processes running? run the ps command with the -Z qualifier. it's giving detective era π
For example:
ps -eZ | grep mock_t
π¦ ENTRYPOINTS π¦
so how does something even get into the mock_t SELinux type? through the mock_exec_t file type, periodt β¨
The default entrypoint paths for the mock_t domain are the following:
/usr/bin/mock, /usr/libexec/mock/mock
π 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 mock policy is very flexible, allowing users to setup their mock processes in as secure a method as possible. lowkey iconic of it.
The following process types are defined for mock:
mock_t, mock_build_t
Note:semanage permissive -a mock_tcan be used to make the process typemock_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so likeβ¦ it's chill about it, but it's still watching you π
π BOOLEANS π
SELinux policy is customizable based on least access required. mock policy is extremely flexible and has several booleans that allow you to manipulate the policy and run mock with the tightest access possible. tightest access = the slay-est access, fr fr π
If you want to allow mock to read files in home directories, you must turn on the mock_enable_homedirs boolean. Disabled by default.
setsebool -P mock_enable_homedirs 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
If you want to support NFS home directories, you must turn on the use_nfs_home_dirs boolean. Enabled by default. (look at her, already on β¨)
setsebool -P use_nfs_home_dirs 1
If you want to support SAMBA home directories, you must turn on the use_samba_home_dirs boolean. Disabled by default.
setsebool -P use_samba_home_dirs 1
π MANAGED FILES π
The SELinux process type mock_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Not me reminding you: the process's UID still needs to have DAC permissions π (SELinux isn't doing all the work for you, bestie)
cifs_tkrb5_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
lvm_lock_t
/etc/lvm/lock(/.*)?
/run/lock/lvm(/.*)?
/run/lock/dmraid(/.*)?
mock_cache_t
/var/cache/mock(/.*)?
mock_tmp_tmock_var_lib_t
/var/lib/mock(/.*)?
mock_var_run_tmount_var_run_t
/run/mount(/.*)?
/dev/.mount(/.*)?
/run/davfs2(/.*)?
/var/cache/davfs2(/.*)?
nfs_trpm_tmp_trpm_var_cache_t
/var/adm/mount(/.*)?
/var/cache/dnf(/.*)?
/var/cache/yum(/.*)?
/var/cache/zypp(/.*)?
/var/spool/up2date(/.*)?
/var/cache/PackageKit(/.*)?
rpm_var_lib_t
/var/lib/dnf(/.*)?
/var/lib/rpm(/.*)?
/var/lib/yum(/.*)?
/usr/lib/YaST2(/.*)?
/var/lib/YaST2(/.*)?
/var/lib/PackageKit(/.*)?
/usr/lib/sysimage/dnf(/.*)?
/usr/lib/sysimage/rpm(/.*)?
/var/lib/alternatives(/.*)?
/var/lib/rpmrebuilddb.*(/.*)?
/usr/lib/sysimage/libdnf5(/.*)?
/run/rpmdb
sysfs_t
/sys(/.*)?
systemd_passwd_var_run_t
/run/systemd/ask-password(/.*)?
/run/systemd/ask-password-block(/.*)?
user_home_t
/home/[^/]+/.+
π§ FILE CONTEXTS π§
SELinux requires files to have an extended attribute to define the file type. yeah, files have labels. we been knew π
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 mock policy is very flexible, allowing users to setup their mock processes in as secure a method as possible.
β STANDARD FILE CONTEXT β
SELinux defines the file context types for the mock. 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 mock_exec_t '/srv/mock/content(/.*)?'
restorecon -R -v /srv/mymock_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies, this one's for you π―
The following file types are defined for mock:
π mock_build_exec_t
- Set files with the
mock_build_exec_ttype, if you want to transition an executable to themock_build_tdomain.
π mock_cache_t
- Set files with the
mock_cache_ttype, if you want to store the files under the/var/cachedirectory.
π mock_etc_t
- Set files with the
mock_etc_ttype, if you want to storemockfiles in the/etcdirectories.
π mock_exec_t
- Set files with the
mock_exec_ttype, if you want to transition an executable to themock_tdomain.
Paths:
/usr/bin/mock, /usr/libexec/mock/mock
π mock_tmp_t
- Set files with the
mock_tmp_ttype, if you want to storemocktemporary files in the/tmpdirectories.
π mock_var_lib_t
- Set files with the
mock_var_lib_ttype, if you want to store themockfiles under the/var/libdirectory.
π mock_var_run_t
- Set files with the
mock_var_run_ttype, if you want to store themockfiles 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 = vibes only, permanent = commit to it π«Ά
π₯ 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 booleanssystem-config-selinuxis a GUI tool available to customize SELinux policy settings. (a whole GUI, for the girlies who like buttons π)
π AUTHOR π
This manual page was auto-generated using sepolicy manpage. a bot wrote this and honestly? it ate.
π SEE ALSO π
selinux(8), mock(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8), mock_build_selinux(8), mock_build_selinux(8)
(yes, mock_build_selinux(8) shows up twice β that's not a typo on my end, it's literally in the list, and honestly? double the icon, double the slay ππ)
and that's the whole page, bestie π¦ this came to you from mock, dated 26-10-06, in true mock_selinux(8) fashion β go forth and label responsibly π
β¨
π¦ 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