virtual_image_context(5)

πŸ’– virtual_image_context β€” the SELinux virtual machine image context config file πŸ’–

okay bestie, so you know that file virtual_image_context(5)? yeah, the SELinux one, living under the SELinux configuration section? this is her moment. she's serving image contexts and we're gonna read every line together, no skimming, no cap. πŸŽ€


🌸 NAME 🌸

virtual_image_context β€” the SELinux virtual machine image context configuration file. that's it, that's the whole name, and she ate. πŸ’…


✨ DESCRIPTION ✨

so the virtual_image_context file is literally a whole list of image contexts, and its whole job is to be used by the SELinux-aware virtualization API libvirt. yes, that libvirt β€” the one from libvirtd(8). iykyk. πŸ¦‹

and if you ever need to find where this file is actually living on your system, selinux_virtual_image_context_path(3) will hand you the active policy path to it. she's basically a map to the treasure. πŸ—ΊοΈ

the default virtual image context file is:

/etc/selinux/{SELINUXTYPE}/contexts/virtual_image_context

where {SELINUXTYPE} is the entry you pull out of the selinux configuration file config β€” and yeah, that one's documented in selinux_config(5) if you wanna go deeper. πŸ‘‘


🧚 FILE FORMAT 🧚

each line in the file is one entry, and the entry looks like this:

user:role:type[:range]

and here's what's going on with each piece:

  • user, role, type, range β€” a user, a role, a type, and an optional range (that's the MCS/MLS one, for the fancy crowd), all separated by colons (:) β€” and together they can be used as a virtual image context. periodt. πŸ’…

🌈 EXAMPLE 🌈

# ./contexts/virtual_image_context
system_u:object_r:svirt_image_t:s0
system_u:object_r:svirt_content_t:s0

look at those contexts just sitting there being iconic. no notes. ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

selinux(8), libvirtd(8), selinux_virtual_image_context_path(3), selinux_config(5)

like, go read them too, bestie, they're all connected. 🫢


lowkey a whole slay of a manual page, fr fr. stay safe out there and keep your contexts correct. πŸ’–

Security Enhanced Linux β€” 28-Nov-2011 β€” virtual_image_context(5) 🌸 mwah, that's the version and date, signing off, ily, bye bestie! πŸŽ€βœ¨