default_type(5)

πŸ’– default_type(5) β€” the SELinux default type config file πŸ’–

okay bestie, so this is a section 5 page (that's file formats, iykyk) from the SELinux configuration corner of the manual, and the file it's about is literally called default_type. no cap, it's a whole little config file that tells SELinux which type to grab when nobody said which one. πŸŽ€


✨ NAME ✨

default_type β€” the SELinux default type configuration file 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so the default_type file is just a little list of entries, and its whole job is letting SELinux-aware applications β€” like newrole(1), hi bestie β€” pick a default type for a role when nobody actually supplied one. it's giving "backup plan but make it policy". πŸ’…

selinux_default_type_path(3) is the one that'll hand you the active policy path to this file. and the default, default type file (yes, that many defaults) lives at:

/etc/selinux/{SELINUXTYPE}/contexts/default_type

where {SELINUXTYPE} is literally the entry pulled from the selinux configuration file config (peep selinux_config(5) for that whole situation πŸ‘€).

and then get_default_type(3) reads this file to figure out a type for the active policy. that's the whole vibe. 🌈


πŸŽ€ FILE FORMAT πŸŽ€

every single line inside the default_type file is formatted with role:type entries, where:

  • role β€” the SELinux role. periodt.
  • type β€” the domain type that gets returned for this role. ✨

πŸ’œ EXAMPLE πŸ’œ

# ./contexts/default_type
auditadm_r:auditadm_t
user_r:user_t

slay. two lines, two roles, done. πŸ‘‘


⭐ SEE ALSO ⭐


🫢 reminder bestie: {SELINUXTYPE} isn't a real directory name, it's a placeholder β€” swap in whatever your config file says. don't go typing braces into your filesystem, I'm begging 😭

and that's the page!! written by Security Enhanced Linux, dated 28-Nov-2011, and it's page default_type(5) ofc. mwah, go configure responsibly πŸ’–βœ¨πŸŽ€