init_selinux(8)
β¨ NAME β¨
Okay bestie, this is init_selinux(8) β the manual page for Security Enhanced Linux Policy for the init processes π
. Yes, it's giving SELinux main character energy, but for init. periodt.
π¦ DESCRIPTION π¦
Security-Enhanced Linux secures the init processes via flexible mandatory access control. That's the whole flex.
The init processes execute with the init_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. Like, vibe check your processes with this:
ps -eZ | grep init_t
πͺ ENTRYPOINTS πͺ
The init_t SELinux type can be entered via the shell_exec_t, init_exec_t file types.
The default entrypoint paths for the init_t domain are the following:
/usr/bin/d?ash, /usr/bin/ksh.*, /usr/bin/zsh.*, /usr/bin/esh,
/usr/bin/bash, /usr/bin/fish, /usr/bin/mksh, /usr/bin/sash,
/usr/bin/sesh, /usr/bin/tcsh, /usr/bin/yash, /usr/bin/bash2,
/usr/bin/smrsh, /usr/bin/nologin, /usr/bin/scponly, /usr/bin/scponlyc,
/usr/libexec/sesh, /usr/bin/git-shell, /usr/libexec/sudo/sesh,
/usr/bin/cockpit-bridge, /usr/libexec/cockpit-agent, /usr/libexec/git-core/git-shell,
/usr/bin/init(ng)?, /usr/lib/systemd/[^/]*, /usr/bin/systemd, /usr/bin/upstart
π PROCESS TYPES π
SELinux defines process types (domains) for each process running on the system. No cap.
You can see the context of a process using the -Z option to ps.
Policy governs the access confined processes have to files. SELinux init policy is very flexible, allowing users to setup their init processes in as secure a method as possible. Obsessed with the flexibility, ngl.
The following process types are defined for init: init_t, initrc_t.
Note:semanage permissive -a init_tcan be used to make the process typeinit_tpermissive. 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. init policy is extremely flexible and has several booleans that allow you to manipulate the policy and run init with the tightest access possible. Basically, bestie, these are the toggles π
init_audit_controlβ If you want to allow initaudit_controlcapability, you must turn on theinit_audit_controlboolean. Enabled by default. Runsetsebool -P init_audit_control 1.init_create_dirsβ If you want to enable init create, setattr, mounton onnon_security_file_type, you must turn on theinit_create_dirsboolean. Enabled by default. Runsetsebool -P init_create_dirs 1.deny_bluetoothβ If you want to deny all system processes and Linux users to use bluetooth wireless technology, you must turn on thedeny_bluetoothboolean. Disabled by default. Runsetsebool -P deny_bluetooth 1.fips_modeβ If you want to allow all domains to execute infips_mode, you must turn on thefips_modeboolean. Enabled by default. Runsetsebool -P fips_mode 1.nagios_run_sudoβ If you want to allow nagios/nrpe to call sudo from NRPE utils scripts, you must turn on thenagios_run_sudoboolean. Disabled by default. Runsetsebool -P nagios_run_sudo 1.nis_enabledβ If you want to allow system to run with NIS, you must turn on thenis_enabledboolean. Disabled by default. Runsetsebool -P nis_enabled 1.secure_mode_insmodβ If you want to disable kernel module loading, you must turn on thesecure_mode_insmodboolean. Disabled by default. Runsetsebool -P secure_mode_insmod 1.xen_use_qemu_for_dom0_disk_backendβ If you want to allow using qemu for xen dom0 disk backend, you must turn on thexen_use_qemu_for_dom0_disk_backendboolean. Disabled by default. Runsetsebool -P xen_use_qemu_for_dom0_disk_backend 1.
ποΈ MANAGED FILES ποΈ
The SELinux process type init_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. No cap, DAC still matters.
auditd_etc_t
/etc/audit(/.*)?
binfmt_misc_fs_t β no default paths listed on this page.
boolean_type β no default paths listed on this page.
bpf_t
/sys/fs/bpf
consolekit_log_t
/var/log/ConsoleKit(/.*)?
dosfs_t β no default paths listed on this page.
etc_aliases_t
/etc/mail/.*.db
/etc/mail/aliases.*
/etc/postfix/aliases.*
/etc/aliases
/etc/aliases.db
/etc/aliases.lmdb
faillog_t
/var/log/btmp.*
/run/faillock(/.*)?
/var/log/faillog.*
/var/log/tallylog.*
gnome_home_type β no default paths listed on this page.
init_tmp_t β no default paths listed on this page.
init_var_lib_t
/var/lib/systemd(/.*)?
/var/lib/private/systemd(/.*)?
initrc_state_t β no default paths listed on this page.
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
krb5_keytab_t
/var/kerberos/krb5(/.*)?
/etc/krb5.keytab
/etc/krb5kdc/kadm5.keytab
/var/kerberos/krb5kdc/kadm5.keytab
lastlog_t
/var/log/lastlog.*
/var/lib/lastlog(/.*)?
lockfile β no default paths listed on this page.
mnt_t
/mnt(/[^/]*)?
/mnt(/[^/]*)?
/rhev(/[^/]*)?
/rhev/[^/]*/.*
/media(/[^/]*)?
/media(/[^/]*)?
/run/media(/[^/]*)?
/media/.hal-.*
/afs
/net
/misc
/rhev
print_spool_t
/var/spool/lpd(/.*)?
/var/spool/cups(/.*)?
/var/spool/cups-pdf(/.*)?
random_seed_t
/var/lib/systemd/random-seed
svirt_file_type β no default paths listed on this page.
sysctl_type β no default paths listed on this page.
sysfs_t
/sys(/.*)?
systemd_home_t
/root/.local/share/systemd(/.*)?
/home/[^/]+/.local/share/systemd(/.*)?
systemd_networkd_tmpfs_t β no default paths listed on this page.
systemd_unit_file_type β no default paths listed on this page.
tmpfs_t
/dev/shm
/run/shm
/usr/lib/udev/devices/shm
udev_rules_t
/etc/udev/rules.d(/.*)?
/run/udev/rules.d(/.*)?
var_lib_nfs_t
/var/lib/nfs(/.*)?
var_lib_t
/opt/(.*/)?var/lib(/.*)?
/var/lib(/.*)?
/var/lib/ntp/var/lib(/.*)?
var_log_t
/var/log/.*
/nsr/logs(/.*)?
/var/webmin(/.*)?
/var/log/secure[^/]*
/opt/zimbra/log(/.*)?
/var/log/maillog[^/]*
/var/log/spooler[^/]*
/var/log/messages[^/]*
/usr/centreon/log(/.*)?
/var/spool/rsyslog(/.*)?
/var/axfrdns/log/main(/.*)?
/var/spool/bacula/log(/.*)?
/var/tinydns/log/main(/.*)?
/var/dnscache/log/main(/.*)?
/var/stockmaniac/templates_cache(/.*)?
/opt/Symantec/scspagent/IDS/system(/.*)?
/var/log
/var/log/dmesg
/var/log/syslog
/var/named/chroot/var/log
var_t
/nsr(/.*)?
/srv/.*
/var/.*
/opt/(.*/)?var
/opt/(.*/)?var/.*
/var/lib/ntp/var(/.*)?
/srv
/var
wtmp_t
/var/log/wtmp.*
wtmpdb_journal_t
/var/lib/wtmpdb/wtmp.db-journal
wtmpdb_t
/var/lib/wtmpdb(/.*)?
π 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 init policy is very flexible allowing users to setup their init processes in as secure a method as possible. It's giving label magic β¨.
π STANDARD FILE CONTEXT π
SELinux defines the file context types for the init. 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. Here's the exact glow-up:
semanage fcontext -a -t init_exec_t '/srv/init/content(/.*)?'
restorecon -R -v /srv/myinit_content
Note: SELinux often uses regular expressions to specify labels that match multiple files.
The following file types are defined for init:
init_exec_t β Set files with the init_exec_t type, if you want to transition an executable to the init_t domain.
Paths:
/usr/bin/init(ng)?, /usr/lib/systemd/[^/]*, /usr/bin/systemd, /usr/bin/upstart
init_tmp_t β Set files with the init_tmp_t type, if you want to store init temporary files in the /tmp directories.
init_var_lib_t β Set files with the init_var_lib_t type, if you want to store the init files under the /var/lib directory.
Paths:
/var/lib/systemd(/.*)?, /var/lib/private/systemd(/.*)?
init_var_run_t β Set files with the init_var_run_t type, if you want to store the init files under the /run or /var/run directory.
initctl_t β Set files with the initctl_t type, if you want to treat the files as initctl data.
Paths:
/dev/initctl, /run/initctl, /run/systemd/initctl/fifo
initrc_devpts_t β Set files with the initrc_devpts_t type, if you want to treat the files as initrc devpts data.
initrc_exec_t β Set files with the initrc_exec_t type, if you want to transition an executable to the initrc_t domain.
Paths:
/etc/init.d/.*, /etc/rc.d/rc.[^/]+, /etc/rc.d/init.d/.*,
/opt/nfast/sbin/init.d-ncipher, /usr/libexec/dcc/stop-.*,
/usr/libexec/dcc/start-.*, /usr/lib/systemd/fedora[^/]*,
/opt/nfast/scripts/init.d/(.*), /etc/rc.d/rc, /etc/X11/prefdm,
/usr/bin/startx, /usr/bin/sepg_ctl, /usr/bin/start-dirsrv,
/usr/bin/open_init_pty, /usr/bin/restart-dirsrv,
/etc/sysconfig/network-scripts/ifup-ipsec,
/usr/share/system-config-services/system-config-services-mechanism.py
initrc_state_t β Set files with the initrc_state_t type, if you want to treat the files as initrc state data.
initrc_tmp_t β Set files with the initrc_tmp_t type, if you want to store initrc temporary files in the /tmp directories.
initrc_var_log_t β Set files with the initrc_var_log_t type, if you want to treat the data as initrc var log data, usually stored under the /var/log directory.
initrc_var_run_t β Set files with the initrc_var_run_t type, if you want to store the initrc files under the /run or /var/run directory.
Paths:
/run/sysconfig(/.*)?, /run/utmp, /run/keymap, /run/numlock-on,
/run/setleds-on, /run/runlevel.dir, /run/setmixer_flag,
/run/bootsplashctl
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.
π οΈ 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 booleans.system-config-selinuxis a GUI tool available to customize SELinux policy settings.
π AUTHOR π
This manual page was auto-generated using sepolicy manpage .
β¨ SEE ALSO β¨
okay bestie, you're at the end of the page, congrats, you ate π β but like, this is a system and everything is connected, so here's your little reading list. go click around, it's giving β¨loreβ¨:
selinux(8)β the big mothership page, start here if you're confusedinit(8)β the actual init program this whole policy is aboutsemanage(8)β the tool for managing all this policy stuffrestorecon(8)β for when file labels get messy (they will)chcon(1)β change a file's context by hand, lowkey risky, use it carefullysepolicy(8)β policy inspection, very demure, very mindfulsetsebool(8)β flip those booleans, go off π
ngl the cross-references are the main character energy of man pages β iykyk π«Ά
and that's a wrap, bestie!! π this page is init_selinux(8), from the init source, version 26-10-06 (the date on it, october 26, 2006, an absolute icon of a timestamp fr fr). go forth, label your processes, and slay ππΈπ¦
π¦ 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