virtual_domain_context(5)

πŸ’– virtual_domain_context β€” the SELinux girlies' VM domain context file πŸ’–

okay so bestie, you know virtual_domain_context? that's the manual page name AND the file name, we're doing double duty today, main character behavior fr fr. it's a (5) page, which means it's all about a config file, and it's the one that holds the SELinux virtual machine domain context list. let's get into it πŸ¦‹


✨ NAME ✨

virtual_domain_context β€” the SELinux virtual machine domain context configuration file, no cap, that's literally the whole vibe


🌸 DESCRIPTION 🌸

so the virtual_domain_context file is where you keep a whole list of domain contexts, and those contexts are up for grabs by the SELinux-aware virtualization API libvirt (peep libvirtd(8) for that one, iykyk).

if you ever need to know where this file actually lives in the active policy, selinux_virtual_domain_context_path(3) will hand you the path. the default virtual domain context file is:

/etc/selinux/{SELINUXTYPE}/contexts/virtual_domain_context

and <lavender>{SELINUXTYPE}is whatever entry you've got in the selinux configuration fileconfig(go look atselinux_config(5)`, she explains it πŸ’…).


πŸŽ€ FILE FORMAT πŸŽ€

every line in the file is one entry, and each entry goes a lil something like this:

user:role:type[:range]

breaking that down, bestie:

  • user role type range β€” that's a user, a role, a type and an optional range (the range one is for MCS/MLS, so only the fancy folks need it), all separated by colons (:) β€” and that whole combo is what gets used as a virtual domain context. slay.
ngl the range part is optional, so don't stress if you're not doing MCS/MLS. the colons though? not optional. those stay. πŸ™ˆ

🫢 EXAMPLE 🫢

here's what it looks like irl:

# ./contexts/virtual_domain_context
system_u:object_r:svirt_t:s0

look at her. iconic. ⭐


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie, you ate that πŸ“

this lil number came from Security Enhanced Linux, dated 28-Nov-2011 β€” and yes, virtual_domain_context(5) is the section-5 manual she lives in. go forth and configure responsibly πŸ’…βœ¨