5.3.2.3. 标签和类别
基于 KVM 的虚拟机实例使用自己的 SELinux 数据类型进行标记,称为 svirt_image_t。内核级别保护可防止未经授权的系统进程(如恶意软件)操作磁盘上的虚拟机镜像文件。虚拟机关闭后,镜像存储为 svirt_image_t,如下所示:
system_u:object_r:svirt_image_t:SystemLow image1 system_u:object_r:svirt_image_t:SystemLow image2 system_u:object_r:svirt_image_t:SystemLow image3 system_u:object_r:svirt_image_t:SystemLow image4
system_u:object_r:svirt_image_t:SystemLow image1
system_u:object_r:svirt_image_t:SystemLow image2
system_u:object_r:svirt_image_t:SystemLow image3
system_u:object_r:svirt_image_t:SystemLow image4
svirt_image_t 标签 在磁盘上唯一标识镜像文件,允许 SELinux 策略限制访问。当基于 KVM 的计算映像开机时,SELinux 会将随机数字标识符附加到镜像中。SELinux 能够为每个管理程序节点最多 524,288 个虚拟机分配数字标识符,但大多数 OpenStack 部署都不太可能遇到此限制。此示例显示 SELinux 类别标识符:
system_u:object_r:svirt_image_t:s0:c87,c520 image1 system_u:object_r:svirt_image_t:s0:419,c172 image2
system_u:object_r:svirt_image_t:s0:c87,c520 image1
system_u:object_r:svirt_image_t:s0:419,c172 image2