Skip to content

Commit

Permalink
Merge pull request #253 from containers/mls
Browse files Browse the repository at this point in the history
Patches for better MLS support
  • Loading branch information
rhatdan authored Jun 6, 2023
2 parents 2e44806 + ced0331 commit 08662f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions container.te
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
policy_module(container, 2.217.0)
policy_module(container, 2.218.0)

gen_require(`
class passwd rootok;
Expand Down Expand Up @@ -210,7 +210,7 @@ userdom_map_user_home_files(container_runtime_t)

manage_dirs_pattern(container_runtime_domain, container_config_t, container_config_t)
manage_files_pattern(container_runtime_domain, container_config_t, container_config_t)
files_etc_filetrans(container_runtime_domain, container_config_t, dir, "container")
files_etc_filetrans(container_runtime_domain, container_config_t, dir, "containers")

manage_dirs_pattern(container_runtime_domain, container_lock_t, container_lock_t)
manage_files_pattern(container_runtime_domain, container_lock_t, container_lock_t)
Expand Down Expand Up @@ -283,7 +283,7 @@ manage_sock_files_pattern(container_runtime_domain, container_var_lib_t, contain
manage_lnk_files_pattern(container_runtime_domain, container_var_lib_t, container_var_lib_t)
allow container_runtime_domain container_var_lib_t:dir_file_class_set { relabelfrom relabelto };
files_var_lib_filetrans(container_runtime_domain, container_var_lib_t, { dir file lnk_file })
files_var_filetrans(container_runtime_domain, container_var_lib_t, dir, "container")
files_var_filetrans(container_runtime_domain, container_var_lib_t, dir, "containers")

manage_dirs_pattern(container_runtime_domain, container_var_run_t, container_var_run_t)
manage_files_pattern(container_runtime_domain, container_var_run_t, container_var_run_t)
Expand All @@ -292,6 +292,7 @@ manage_sock_files_pattern(container_runtime_domain, container_var_run_t, contain
manage_lnk_files_pattern(container_runtime_domain, container_var_run_t, container_var_run_t)
files_pid_filetrans(container_runtime_domain, container_var_run_t, { dir file lnk_file sock_file })
files_tmp_filetrans(container_runtime_domain, container_var_run_t, { dir file lnk_file sock_file })
allow container_runtime_domain container_var_run_t:dir_file_class_set relabelfrom;

allow container_runtime_domain container_devpts_t:chr_file { relabelfrom rw_chr_file_perms setattr_chr_file_perms };
term_create_pty(container_runtime_domain, container_devpts_t)
Expand All @@ -313,6 +314,8 @@ kernel_read_all_sysctls(container_runtime_domain)
kernel_rw_net_sysctls(container_runtime_domain)
kernel_setsched(container_runtime_domain)
kernel_rw_all_sysctls(container_runtime_domain)
kernel_mounton_all_proc(container_runtime_domain)
fs_getattr_all_fs(container_runtime_domain)

domain_obj_id_change_exemption(container_runtime_t)
domain_subj_id_change_exemption(container_runtime_t)
Expand Down
2 changes: 1 addition & 1 deletion container_selinux.8
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ container policy stores data with multiple different file context types under th
.B STANDARD FILE CONTEXT
SELinux defines the file context types for the container, if you wanted to
store files with these types in a diffent paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.
store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.
.B semanage fcontext -a -t container_ro_file_t '/srv/mycontainer_content(/.*)?'
.br
Expand Down

0 comments on commit 08662f1

Please sign in to comment.