mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-09 09:24:24 +01:00
runtime: Pass SELinux policy for containers to the agent
Pass SELinux policy for containers to the agent if `disable_guest_selinux` is set to `false` in the runtime configuration. The `container_t` type is applied to the container process inside the guest by default. Users can also set a custom SELinux policy to the container process using `guest_selinux_label` in the runtime configuration. This will be an alternative configuration of Kubernetes' security context for SELinux because users cannot specify the policy in Kata through Kubernetes's security context. To apply SELinux policy to the container, the guest rootfs must be CentOS that is created and built with `SELINUX=yes`. Fixes: #4812 Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
This commit is contained in:
@@ -76,6 +76,7 @@ type RuntimeConfigInfo struct {
|
||||
type RuntimeInfo struct {
|
||||
Config RuntimeConfigInfo
|
||||
Path string
|
||||
GuestSeLinuxLabel string
|
||||
Experimental []exp.Feature
|
||||
Version RuntimeVersionInfo
|
||||
Debug bool
|
||||
@@ -186,6 +187,7 @@ func getRuntimeInfo(configFile string, config oci.RuntimeConfig) RuntimeInfo {
|
||||
SandboxCgroupOnly: config.SandboxCgroupOnly,
|
||||
Experimental: config.Experimental,
|
||||
DisableGuestSeccomp: config.DisableGuestSeccomp,
|
||||
GuestSeLinuxLabel: config.GuestSeLinuxLabel,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user