Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions container.te
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
policy_module(container, 2.239.0)
policy_module(container, 2.240.0)

gen_require(`
class passwd rootok;
Expand Down Expand Up @@ -60,6 +60,13 @@ gen_tunable(container_use_dri_devices, true)
## </desc>
gen_tunable(container_manage_cgroup, false)

## <desc>
## <p>
## Allow containers to manipulate SELinux labels

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for this new tunable is a bit generic. "manipulate SELinux labels" could refer to many different permissions. For better clarity for administrators who might need to enable this, consider making it more specific to the permissions being granted (setexec and setfscreate).

A more descriptive comment could be:

## Allow containers to set the security context on process execution and file creation.

This more accurately reflects what enabling this tunable does.

## Allow containers to set the security context on process execution and file creation

## </p>
## </desc>
gen_tunable(container_modify_selinux_labels, false)

## <desc>
## <p>
## Determine whether container can
Expand Down Expand Up @@ -577,6 +584,10 @@ userdom_use_user_ptys(container_runtime_domain)
userdom_connectto_stream(container_runtime_domain)
allow container_domain init_t:socket_class_set { accept ioctl read getattr lock write append getopt };

tunable_policy(`container_modify_selinux_labels',`
allow container_domain self:process { setexec setfscreate};
')

tunable_policy(`virt_use_nfs',`
fs_manage_nfs_dirs(container_runtime_domain)
fs_manage_nfs_files(container_runtime_domain)
Expand Down Expand Up @@ -936,7 +947,7 @@ allow container_domain self:netlink_xfrm_socket create_socket_perms;
allow container_domain self:packet_socket create_socket_perms;
allow container_domain self:passwd rootok;
allow container_domain self:peer recv;
allow container_domain self:process { execmem execstack fork getattr getcap getpgid getsched getsession setcap setpgid setrlimit setsched sigchld sigkill signal signull sigstop setexec setfscreate};
allow container_domain self:process { execmem execstack fork getattr getcap getpgid getsched getsession setcap setpgid setrlimit setsched sigchld sigkill signal signull sigstop};
allow container_domain self:sem create_sem_perms;
allow container_domain self:shm create_shm_perms;
allow container_domain self:socket create_socket_perms;
Expand Down