initrc_selinux(8)

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

πŸ’– NAME πŸ’–

ok so <pink>initrc_selinux</pink> β€” that's your initrc_selinux(8) page bestie, welcome β€” is literally the Security Enhanced Linux Policy for the initrc processes. that's the whole vibe. the manual name is initrc_selinux and the policy it's describing is initrc. slay.


✨ DESCRIPTION ✨

Security-Enhanced Linux secures the initrc processes via flexible mandatory access control. yeah. mandatory. not optional. it's giving "you WILL be confined" and honestly? iconic. πŸ‘‘

The initrc processes execute with the initrc_t SELinux type. so if u ever wanna know whether these processes are running on ur box, u run the ps command with the -Z qualifier β€” that's the flag that shows the security context. easy.

For example:

ps -eZ | grep initrc_t

that's it. that's the whole check. grep for the type, see what shows up, go about ur day. 🫢


πŸ¦‹ ENTRYPOINTS πŸ¦‹

okay so this is the big one. the initrc_t SELinux type can be entered via the following file types. there are... a LOT of them. like, a lot a lot. don't panic, just scroll. they're all here, every single one, no cap:

  • pki_ra_script_exec_t
  • apcupsd_initrc_exec_t
  • hddtemp_initrc_exec_t
  • rpcd_initrc_exec_t
  • amtu_initrc_exec_t
  • gpm_initrc_exec_t
  • glance_scrubber_initrc_exec_t
  • sssd_initrc_exec_t
  • arpwatch_initrc_exec_t
  • glance_api_initrc_exec_t
  • sysstat_initrc_exec_t
  • l2tpd_initrc_exec_t
  • boinc_initrc_exec_t
  • firewalld_initrc_exec_t
  • rabbitmq_initrc_exec_t
  • watchdog_initrc_exec_t
  • fsdaemon_initrc_exec_t
  • fetchmail_initrc_exec_t
  • gdomap_initrc_exec_t
  • saslauthd_initrc_exec_t
  • bitlbee_initrc_exec_t
  • postgresql_initrc_exec_t
  • snmpd_initrc_exec_t
  • ypbind_initrc_exec_t
  • antivirus_initrc_exec_t
  • pingd_initrc_exec_t
  • likewise_initrc_exec_t
  • vdagentd_initrc_exec_t
  • zoneminder_initrc_exec_t
  • isnsd_initrc_exec_t
  • cpuplug_initrc_exec_t
  • avahi_initrc_exec_t
  • shorewall_initrc_exec_t
  • automount_initrc_exec_t
  • snort_initrc_exec_t
  • lircd_initrc_exec_t
  • uucpd_initrc_exec_t
  • mpd_initrc_exec_t
  • condor_initrc_exec_t
  • cupsd_initrc_exec_t
  • postgrey_initrc_exec_t
  • cfengine_initrc_exec_t
  • conntrackd_initrc_exec_t
  • innd_initrc_exec_t
  • nis_initrc_exec_t
  • bacula_initrc_exec_t
  • kismet_initrc_exec_t
  • ntop_initrc_exec_t
  • pads_initrc_exec_t
  • wicked_initrc_exec_t
  • collectd_initrc_exec_t
  • slpd_initrc_exec_t
  • ricci_initrc_exec_t
  • openvpn_initrc_exec_t
  • ddclient_initrc_exec_t
  • nslcd_initrc_exec_t
  • NetworkManager_initrc_exec_t
  • sensord_initrc_exec_t
  • pcscd_initrc_exec_t
  • auditd_initrc_exec_t
  • mrtg_initrc_exec_t
  • ksmtuned_initrc_exec_t
  • blkmapd_initrc_exec_t
  • httpd_initrc_exec_t
  • foghorn_initrc_exec_t
  • icecast_initrc_exec_t
  • abrt_initrc_exec_t
  • zebra_initrc_exec_t
  • memcached_initrc_exec_t
  • nfsd_initrc_exec_t
  • asterisk_initrc_exec_t
  • bluetooth_initrc_exec_t
  • chronyd_initrc_exec_t
  • psad_initrc_exec_t
  • dovecot_initrc_exec_t
  • nscd_initrc_exec_t
  • irqbalance_initrc_exec_t
  • smokeping_initrc_exec_t
  • minissdpd_initrc_exec_t
  • rwho_initrc_exec_t
  • tgtd_initrc_exec_t
  • pki_tps_script_exec_t
  • kerberos_initrc_exec_t
  • crond_initrc_exec_t
  • entropyd_initrc_exec_t
  • mscan_initrc_exec_t
  • exim_initrc_exec_t
  • qpidd_initrc_exec_t
  • setrans_initrc_exec_t
  • puppetagent_initrc_exec_t
  • samba_initrc_exec_t
  • tcsd_initrc_exec_t
  • sshd_initrc_exec_t
  • spamd_initrc_exec_t
  • kdump_initrc_exec_t
  • portreserve_initrc_exec_t
  • syslogd_initrc_exec_t
  • squid_initrc_exec_t
  • afs_initrc_exec_t
  • couchdb_initrc_exec_t
  • sslh_initrc_exec_t
  • tor_initrc_exec_t
  • mon_statd_initrc_exec_t
  • polipo_initrc_exec_t
  • drbd_initrc_exec_t
  • dhcpc_helper_exec_t
  • initrc_exec_t
  • cyphesis_initrc_exec_t
  • zabbix_initrc_exec_t
  • jabberd_initrc_exec_t
  • prelude_initrc_exec_t
  • varnishd_initrc_exec_t
  • cgconfig_initrc_exec_t
  • callweaver_initrc_exec_t
  • apmd_initrc_exec_t
  • dictd_initrc_exec_t
  • denyhosts_initrc_exec_t
  • sanlock_initrc_exec_t
  • rhnsd_initrc_exec_t
  • rhsmcertd_initrc_exec_t
  • rngd_initrc_exec_t
  • portmap_initrc_exec_t
  • lldpad_initrc_exec_t
  • cobblerd_initrc_exec_t
  • sblim_initrc_exec_t
  • minidlna_initrc_exec_t
  • openhpid_initrc_exec_t
  • hypervkvp_initrc_exec_t
  • dhcpd_initrc_exec_t
  • rtkit_daemon_initrc_exec_t
  • bin_t
  • radiusd_initrc_exec_t
  • pppd_initrc_exec_t
  • iwhd_initrc_exec_t
  • cgred_initrc_exec_t
  • dlm_controld_initrc_exec_t
  • rpcbind_initrc_exec_t
  • cyrus_initrc_exec_t
  • clvmd_initrc_exec_t
  • acct_initrc_exec_t
  • postfix_initrc_exec_t
  • radvd_initrc_exec_t
  • redis_initrc_exec_t
  • certmonger_initrc_exec_t
  • glance_registry_initrc_exec_t
  • zabbix_agent_initrc_exec_t
  • pkcs_slotd_initrc_exec_t
  • keystone_initrc_exec_t
  • mcelog_initrc_exec_t
  • oracleasm_initrc_exec_t
  • uuidd_initrc_exec_t
  • canna_initrc_exec_t
  • sendmail_initrc_exec_t
  • soundd_initrc_exec_t
  • slapd_initrc_exec_t
  • dspam_initrc_exec_t
  • glusterd_initrc_exec_t
  • mysqlmanagerd_initrc_exec_t
  • certmaster_initrc_exec_t
  • usr_t
  • svnserve_initrc_exec_t
  • ciped_initrc_exec_t
  • munin_initrc_exec_t
  • wdmd_initrc_exec_t
  • iodined_initrc_exec_t
  • named_initrc_exec_t
  • mdadm_initrc_exec_t
  • tuned_initrc_exec_t
  • distccd_initrc_exec_t
  • mysqld_initrc_exec_t
  • varnishlog_initrc_exec_t
  • roundup_initrc_exec_t
  • cluster_initrc_exec_t
  • fcoemon_initrc_exec_t
  • shell_exec_t
  • neutron_initrc_exec_t
  • nagios_initrc_exec_t
  • cvs_initrc_exec_t
  • puppetmaster_initrc_exec_t
  • fail2ban_initrc_exec_t
  • ftpd_initrc_exec_t
  • iptables_initrc_exec_t
  • ulogd_initrc_exec_t
  • ipsec_initrc_exec_t
  • cmirrord_initrc_exec_t
  • gpsd_initrc_exec_t
  • vnstatd_initrc_exec_t
  • mongod_initrc_exec_t
  • ctdbd_initrc_exec_t
  • virtd_initrc_exec_t
  • ccs_initrc_exec_t
  • ntpd_initrc_exec_t
  • virtlogd_initrc_exec_t
  • osad_initrc_exec_t
  • privoxy_initrc_exec_t
  • vhostmd_initrc_exec_t
  • dnsmasq_initrc_exec_t

like?? that's 197 file types. 197!! my thumbs hurt just reading it. 😭 but look at them, all cozy in a list, that's the content, we keep the content. πŸ”₯

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

and finally the big one: all executables with the default executable label, usually chilling in /usr/bin and /usr/sbin β€” plus the entire guest list, which is honestly giving everyone's invited πŸ’…βœ¨:

/etc/rc.d/init.d/apcupsd
/etc/rc.d/init.d/hddtemp
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/amtu
/etc/rc.d/init.d/gpm
/etc/rc.d/init.d/openstack-glance-scrubber
/etc/rc.d/init.d/sssd
/etc/rc.d/init.d/arpwatch
/etc/rc.d/init.d/openstack-glance-api
/etc/rc.d/init.d/sysstat
/etc/rc.d/init.d/.*l2tpd
/etc/rc.d/init.d/boinc-client
/etc/rc.d/init.d/firewalld
/etc/rc.d/init.d/rabbitmq-server
/etc/rc.d/init.d/watchdog
/etc/rc.d/init.d/(smartd|smartmontools)
/etc/rc.d/init.d/fetchmail
/etc/rc.d/init.d/gdomap
/etc/rc.d/init.d/sasl
/etc/rc.d/init.d/bitlbee
/etc/rc.d/init.d/(se)?postgresql
/usr/share/postgresql/postgresql-script
/etc/rc.d/init.d/(snmpd|snmptrapd)
/etc/rc.d/init.d/ypbind
/etc/rc.d/init.d/clamd.*
/etc/rc.d/init.d/amavis
/etc/rc.d/init.d/amavisd-snmp
/etc/rc.d/init.d/whatsup-pingd
/etc/rc.d/init.d/lwiod
/etc/rc.d/init.d/lwsmd
/etc/rc.d/init.d/lsassd
/etc/rc.d/init.d/lwregd
/etc/rc.d/init.d/dcerpcd
/etc/rc.d/init.d/srvsvcd
/etc/rc.d/init.d/likewise
/etc/rc.d/init.d/eventlogd
/etc/rc.d/init.d/netlogond
/etc/rc.d/init.d/spice-vdagentd
/etc/rc.d/init.d/zoneminder
/etc/rc.d/init.d/isnsd
/etc/rc.d/init.d/cpuplugd
/etc/rc.d/init.d/avahi.*
/etc/rc.d/init.d/shorewall.*
/etc/rc.d/init.d/autofs
/etc/rc.d/init.d/snortd
/etc/rc.d/init.d/lirc
/etc/rc.d/init.d/uucp
/etc/rc.d/init.d/mpd
/etc/rc.d/init.d/condor
/etc/rc.d/init.d/cups
/etc/rc.d/init.d/postgrey
/etc/rc.d/init.d/((cf-serverd)|(cf-monitord)|(cf-execd))
/etc/rc.d/init.d/innd
/etc/rc.d/init.d/ypserv
/etc/rc.d/init.d/ypxfrd
/etc/rc.d/init.d/yppasswd
/etc/rc.d/init.d/bacula.*
/etc/rc.d/init.d/kismet.*
/etc/rc.d/init.d/ntop
/etc/rc.d/init.d/pads
/usr/bin/rcwicked.*
/etc/rc.d/init.d/collectd
/etc/rc.d/init.d/slpd
/etc/rc.d/init.d/ricci
/etc/rc.d/init.d/openvpn
/etc/rc.d/init.d/ddclient
/etc/rc.d/init.d/nslcd
/etc/rc.d/init.d/wicd
/etc/rc.d/init.d/sensord
/etc/rc.d/init.d/pcscd
/etc/rc.d/init.d/auditd
/etc/rc.d/init.d/mrtg
/etc/rc.d/init.d/ksmtuned
/etc/rc.d/init.d/blkmapd
/etc/init.d/cherokee
/etc/rc.d/init.d/httpd
/usr/bin/start_apache2
/etc/rc.d/init.d/lighttpd
/etc/rc.d/init.d/icecast
/etc/rc.d/init.d/abrt
/etc/rc.d/init.d/bgpd
/etc/rc.d/init.d/ripd
/etc/rc.d/init.d/isisd
/etc/rc.d/init.d/ospfd
/etc/rc.d/init.d/zebra
/etc/rc.d/init.d/babeld
/etc/rc.d/init.d/ospf6d
/etc/rc.d/init.d/ripngd
/etc/rc.d/init.d/memcached
/etc/rc.d/init.d/nfs
/etc/rc.d/init.d/asterisk
/etc/rc.d/init.d/dund
/etc/rc.d/init.d/pand
/etc/rc.d/init.d/bluetooth
/etc/rc.d/init.d/chronyd
/etc/rc.d/init.d/psad
/etc/rc.d/init.d/dovecot
/etc/rc.d/init.d/nscd
/etc/rc.d/init.d/irqbalance
/etc/rc.d/init.d/smokeping
/etc/rc.d/init.d/minissdpd
/etc/rc.d/init.d/rwhod
/etc/rc.d/init.d/tgtd
/etc/rc.d/init.d/kprop
/etc/rc.d/init.d/kadmind
/etc/rc.d/init.d/krb524d
/etc/rc.d/init.d/krb5kdc
/etc/rc.d/init.d/atd
/etc/rc.d/init.d/((audio-entropyd)|(haveged))
/etc/rc.d/init.d/MailScanner
/etc/rc.d/init.d/exim
/etc/rc.d/init.d/qpidd
/etc/rc.d/init.d/mcstrans
/etc/rc.d/init.d/puppet
/etc/rc.d/init.d/nmb
/etc/rc.d/init.d/smb
/etc/rc.d/init.d/winbind
/etc/rc.d/init.d/(tcsd|trousers)
/etc/rc.d/init.d/sshd
/etc/rc.d/init.d/mimedefang.*
/etc/rc.d/init.d/spamd
/etc/rc.d/init.d/pyzord
/etc/rc.d/init.d/spampd
/etc/rc.d/init.d/kdump
/etc/rc.d/init.d/portreserve
/etc/rc.d/init.d/rsyslog
/etc/rc.d/init.d/squid
/etc/rc.d/init.d/(open)?afs
/etc/rc.d/init.d/openafs-client
/etc/rc.d/init.d/couchdb
/etc/rc.d/init.d/sslh
/etc/rc.d/init.d/tor
/etc/rc.d/init.d/mon_statd
/etc/rc.d/init.d/polipo
/etc/rc.d/init.d/drbd
/etc/firestarter/firestarter.sh
/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
/etc/rc.d/init.d/cyphesis
/etc/rc.d/init.d/(zabbix|zabbix-server)
/etc/rc.d/init.d/jabberd
/etc/rc.d/init.d/prelude-lml
/etc/rc.d/init.d/prelude-manager
/etc/rc.d/init.d/prelude-correlator
/etc/rc.d/init.d/varnish
/etc/rc.d/init.d/cgconfig
/etc/rc.d/init.d/callweaver
/etc/rc.d/init.d/acpid
/etc/rc.d/init.d/dictd
/etc/rc.d/init.d/denyhosts
/etc/rc.d/init.d/sanlock
/etc/rc.d/init.d/rhnsd
/etc/rc.d/init.d/rhsmcertd
/etc/rc.d/init.d/rngd
/etc/rc.d/init.d/portmap
/etc/rc.d/init.d/lldpad
/etc/rc.d/init.d/cobblerd
/etc/rc.d/init.d/gatherer
/etc/rc.d/init.d/sblim-sfcbd
/etc/rc.d/init.d/minidlna
/etc/rc.d/init.d/openhpid
/etc/rc.d/init.d/hypervkvpd
/etc/rc.d/init.d/dhcpd(6)?
/etc/rc.d/init.d/dhcrelay(6)?
/etc/rc.d/init.d/rtkit-daemon
/etc/rc.d/init.d/radiusd
/etc/ppp/(auth|ip(v6|x)?)-(up|down)
/usr/libexec/ppp/(auth|ip(v6|x)?)-(up|down)
/etc/rc.d/init.d/ppp
/etc/rc.d/init.d/iwhd
/etc/rc.d/init.d/cgred
/etc/rc.d/init.d/rpcbind
/etc/rc.d/init.d/cyrus.*
/etc/rc.d/init.d/psacct
/etc/rc.d/init.d/postfix
/etc/rc.d/init.d/radvd
/etc/rc.d/init.d/redis
/etc/rc.d/init.d/certmonger
/etc/rc.d/init.d/openstack-glance-registry
/etc/rc.d/init.d/zabbix-agentd
/etc/rc.d/init.d/pkcsslotd
/etc/rc.d/init.d/openstack-keystone
/etc/rc.d/init.d/mcelog
/etc/rc.d/init.d/oracleasm
/etc/rc.d/init.d/uuidd
/etc/rc.d/init.d/canna
/etc/mail/system/sm-client.pre
/etc/rc.d/init.d/sendmail
/etc/rc.d/init.d/nasd
/etc/rc.d/init.d/slapd
/etc/rc.d/init.d/dspam
/etc/rc.d/init.d/gluster.*
/usr/bin/glusterd
/etc/rc.d/init.d/mysqlmanager
/etc/rc.d/init.d/certmaster
/opt/.*
/usr/.*
/hana(/.*)?
/emul/.*
/export(/.*)?
/ostree(/.*)?
/usr/doc(/.*)?/lib(/.*)?
/usr/inclu.e(/.*)?
/usr/share/rpm(/.*)?
/usr/share/doc(/.*)?/README.*
/usr/lib/modules(/.*)/vmlinuz
/usr/lib/modules(/.*)/sysctl.conf
/usr/lib/modules(/.*)/initramfs.img
/usr/lib/sysimage(/.*)?
/usr/lib/ostree-boot(/.*)?
/opt
/usr
/emul
/etc/rc.d/init.d/svnserve
/etc/rc.d/init.d/ciped.*
/etc/rc.d/init.d/munin-node
/etc/rc.d/init.d/wdmd
/etc/rc.d/init.d/((iodined)|(iodine-server))
/etc/rc.d/init.d/named
/etc/rc.d/init.d/unbound
/etc/rc.d/init.d/named-sdb
/etc/rc.d/init.d/mdmonitor
/etc/rc.d/init.d/tuned
/etc/rc.d/init.d/distccd
/etc/rc.d/init.d/mysqld
/etc/rc.d/init.d/varnishlog
/etc/rc.d/init.d/varnishncsa
/etc/rc.d/init.d/roundup
/etc/rc.d/init.d/openais
/etc/rc.d/init.d/corosync
/etc/rc.d/init.d/cpglockd
/etc/rc.d/init.d/heartbeat
/etc/rc.d/init.d/pacemaker
/etc/rc.d/init.d/rgmanager
/etc/rc.d/init.d/fcoe
/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
/etc/rc.d/init.d/neutron.*
/etc/rc.d/init.d/quantum.*
/etc/rc.d/init.d/nrpe
/etc/rc.d/init.d/nagios
/etc/rc.d/init.d/cvs
/etc/rc.d/init.d/puppetmaster
/etc/rc.d/init.d/vsftpd
/etc/rc.d/init.d/proftpd
/etc/rc.d/init.d/ip6?tables
/etc/rc.d/init.d/ebtables
/etc/rc.d/init.d/nftables
/etc/rc.d/init.d/ulogd
/etc/rc.d/init.d/ipsec
/etc/rc.d/init.d/racoon
/etc/rc.d/init.d/strongswan
/etc/rc.d/init.d/cmirrord
/etc/rc.d/init.d/gpsd
/etc/rc.d/init.d/vnstat
/etc/rc.d/init.d/mongod
/etc/rc.d/init.d/mongos
/etc/rc.d/init.d/ctdb
/etc/rc.d/init.d/libvirtd
/etc/rc.d/init.d/((ccs)|(ccsd))
/etc/rc.d/init.d/ntpd
/etc/rc.d/init.d/virtlogd
/etc/rc.d/init.d/osad
/etc/rc.d/init.d/privoxy
/etc/rc.d/init.d/vhostmd
/etc/rc.d/init.d/dnsmasq

okay that was a lot, drink some water bestie 🫢


✨ PROCESS TYPES ✨

okay so this is the part where SELinux gets ✨organized✨. it defines process types (aka domains) for each process running on the system. every single one. no cap.

you can literally peek at the context of a process using the -Z option to ps πŸ‘€

policy governs the access that confined processes have to files. and here's the slay: SELinux initrc policy is very flexible, allowing users to set up their initrc processes in as secure a method as possible. like, locked in but not annoying about it πŸ’…

the following process types are defined for initrc:

  • initrc_t β€” the one and only πŸ‘‘
Note: semanage permissive -a initrc_t can be used to make the process type initrc_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so you get the receipts either way, bestie 🧾✨

πŸŽ€ BOOLEANS πŸŽ€

SELinux policy is customizable based on least access required β€” very demure, very mindful. initrc policy is extremely flexible and has several booleans that allow you to manipulate the policy and run initrc with the tightest access possible πŸ”’πŸ’–


deny_execmem

if you want to deny user domains applications to map a memory region as both executable and writable… girl. this is dangerous 🚨 and the executable should be reported in bugzilla. you must turn on the deny_execmem boolean.

Disabled by default.

setsebool -P deny_execmem 1

mmap_low_allowed

if you want to control the ability to mmap a low area of the address space, as configured by /proc/sys/vm/mmap_min_addr, you must turn on the mmap_low_allowed boolean.

Disabled by default.

setsebool -P mmap_low_allowed 1

nis_enabled

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

secure_mode_insmod

if you want to disable kernel module loading, you must turn on the secure_mode_insmod boolean.

Disabled by default.

setsebool -P secure_mode_insmod 1

selinuxuser_execheap

if you want to allow unconfined executables to make their heap memory executable… doing this is a really bad idea πŸ’€ probably indicates a badly coded executable, but could indicate an attack. this executable should be reported in bugzilla. you must turn on the selinuxuser_execheap boolean.

Disabled by default.

setsebool -P selinuxuser_execheap 1

selinuxuser_execstack

if you want to allow unconfined executables to make their stack executable… this should never, ever be necessary 😭 probably indicates a badly coded executable, but could indicate an attack. this executable should be reported in bugzilla. you must turn on the selinuxuser_execstack boolean.

Disabled by default.

setsebool -P selinuxuser_execstack 1
bestie if you're turning either of those last two on for a reason, that reason is a bug report 🫢 report it

πŸ¦‹ MANAGED FILES πŸ¦‹

the SELinux process type initrc_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. SELinux isn't out here overriding your normal perms, it's just doing its own vibe check on top πŸ˜ŒπŸ’…
  • file_type β€” all files on the system
all files on the system

FILE CONTEXTS πŸ’–

SELinux is literally built on files having an extended attribute that defines the file type, bestie β€” no cap.

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

STANDARD FILE CONTEXT πŸŽ€

SELinux defines the file context types for the initrc. If you wanted to store files with these types in 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 initrc_exec_t '/srv/initrc/content(/.*)?'
restorecon -R -v /srv/myinitrc_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. πŸ¦‹

The following file types are defined for initrc:

🌸 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 πŸ”Ž

Mwah πŸ’– β€” this whole vibe is from the initrc page, source/version initrc_selinux(8), dated 26-10-06. Catch you in the group chat, bestie! πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from