init_selinux(8)

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

✨ 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_t can be used to make the process type init_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. 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 init audit_control capability, you must turn on the init_audit_control boolean. Enabled by default. Run setsebool -P init_audit_control 1.
  • init_create_dirs β€” If you want to enable init create, setattr, mounton on non_security_file_type, you must turn on the init_create_dirs boolean. Enabled by default. Run setsebool -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 the deny_bluetooth boolean. Disabled by default. Run setsebool -P deny_bluetooth 1.
  • fips_mode β€” If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. Run setsebool -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 the nagios_run_sudo boolean. Disabled by default. Run setsebool -P nagios_run_sudo 1.
  • nis_enabled β€” If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. Run setsebool -P nis_enabled 1.
  • secure_mode_insmod β€” If you want to disable kernel module loading, you must turn on the secure_mode_insmod boolean. Disabled by default. Run setsebool -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 the xen_use_qemu_for_dom0_disk_backend boolean. Disabled by default. Run setsebool -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 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 ✨

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 confused
  • init(8) β€” the actual init program this whole policy is about
  • semanage(8) β€” the tool for managing all this policy stuff
  • restorecon(8) β€” for when file labels get messy (they will)
  • chcon(1) β€” change a file's context by hand, lowkey risky, use it carefully
  • sepolicy(8) β€” policy inspection, very demure, very mindful
  • setsebool(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