Skip to content

Commit f2826ff

Browse files
authored
Merge pull request #54597 from ousleyp/cnv-20962
CNV-20962: SELinux updates, part 1
2 parents 87b502c + c3bd32c commit f2826ff

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

modules/virt-extended-selinux-policies-for-virt-launcher.adoc

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,32 @@
66
[id="virt-extended-selinux-policies-for-virt-launcher_{context}"]
77
= Extended SELinux policies for virt-launcher pods
88

9-
The `container_t` SELinux policy for virt-launcher pods is extended with the following rules:
9+
The `container_t` SELinux policy for `virt-launcher` pods is extended to enable essential functions of {VirtProductName}.
1010

11-
* `allow process self (tun_socket (relabelfrom relabelto attach_queue))`
12-
* `allow process sysfs_t (file (write))`
13-
* `allow process hugetlbfs_t (dir (add_name create write remove_name rmdir setattr))`
14-
* `allow process hugetlbfs_t (file (create unlink))`
11+
* The following policy is required for network multi-queue, which enables network performance to scale as the number of available vCPUs increases:
1512
16-
These rules enable the following virtualization features:
13+
** `allow process self (tun_socket (relabelfrom relabelto attach_queue))`
1714

18-
* Relabel and attach queues to its own TUN sockets, which is required to support network multi-queue. Multi-queue enables network performance to scale as the number of available vCPUs increases.
15+
* The following policy allows `virt-launcher` to read files under the `/proc` directory, including `/proc/cpuinfo` and `/proc/uptime`:
1916
20-
* Allows virt-launcher pods to write information to sysfs (`/sys`) files, which is required to enable Single Root I/O Virtualization (SR-IOV).
17+
** `allow process proc_type (file (getattr open read))`
2118

22-
* Read/write `hugetlbfs` entries, which is required to support huge pages. Huge pages are a method of managing large amounts of memory by increasing the memory page size.
19+
* The following policy allows `libvirtd` to relay network-related debug messages.
2320
21+
** `allow process self (netlink_audit_socket (nlmsg_relay))`
22+
+
23+
[NOTE]
24+
====
25+
Without this policy, any attempt to relay network debug messages is blocked. This might fill the node's audit logs with SELinux denials.
26+
====
27+
28+
* The following policies allow `libvirtd` to access `hugetblfs`, which is required to support huge pages:
29+
30+
** `allow process hugetlbfs_t (dir (add_name create write remove_name rmdir setattr))`
31+
** `allow process hugetlbfs_t (file (create unlink))`
32+
33+
* The following policies allow `virtiofs` to mount filesystems and access NFS:
34+
35+
** `allow process nfs_t (dir (mounton))`
36+
** `allow process proc_t (dir (mounton))`
37+
** `allow process proc_t (filesystem (mount unmount))`

virt/virt-additional-security-privileges-controller-and-launcher.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ include::modules/virt-additional-scc-for-kubevirt-controller.adoc[leveloffset=+1
2323
* xref:../authentication/managing-security-context-constraints.adoc#security-context-constraints-about_configuring-internal-oauth[Managing security context constraints]
2424
* xref:../authentication/using-rbac.adoc#using-rbac[Using RBAC to define and apply permissions]
2525
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/monitoring_and_managing_system_status_and_performance/index#optimizing-virtual-machine-network-performance_optimizing-virtual-machine-performance-in-rhel[Optimizing virtual machine network performance] in the {op-system-base-full} documentation
26+
* xref:../virt/virtual_machines/advanced_vm_management/virt-using-huge-pages-with-vms.adoc#virt-using-huge-pages-with-vms[Using huge pages with virtual machines]
2627
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/monitoring_and_managing_system_status_and_performance/index#configuring-huge-pages_monitoring-and-managing-system-status-and-performance[Configuring huge pages] in the {op-system-base} documentation

0 commit comments

Comments
 (0)