Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formally add support for SELinux (Enforced mode) #1372

Closed
davidnuzik opened this issue Jan 31, 2020 · 7 comments
Closed

Formally add support for SELinux (Enforced mode) #1372

davidnuzik opened this issue Jan 31, 2020 · 7 comments
Assignees
Labels
kind/enhancement An improvement to existing functionality kind/internal os/centos

Comments

@davidnuzik
Copy link
Contributor

davidnuzik commented Jan 31, 2020

We need to expand our testing and identify any issues that prevent us from formally supporting SELinux (in enforced mode) on CentOS. Please note that SELinux is expected to work -- this issue is for tracking testing effort so we can formally support it.

We should review existing GitHub issues, but we need to execute some testing and identify any other issues. As needed, we'll need to resolve these issues so we may fully support SELinux on CentOS.

Formal CentOS (general OS) support is also needed, which is tracked separately here: #1371

@davidnuzik
Copy link
Contributor Author

@ShylajaDevadiga I have assigned this issue to you for now. This will require some testing and discovery. We need to identify any/all SELinux CentOS issues that prevent us from formally supporting CentOS with SELinux support in our next release. Work with me as needed.

@davidnuzik
Copy link
Contributor Author

As a reminder we must support IPv6 as well.

@westurner
Copy link
Contributor

westurner commented Feb 4, 2020

Is this more complicated than running tests in permissive mode, running audit2allow, and reviewing the generated policy for what needs to be relabled so that k3s will run with selinux in enforcing mode?

$ cat container.te | egrep '^\s*type'
typealias container_runtime_t alias docker_t;
type container_runtime_exec_t alias docker_exec_t;
type spc_t, container_domain;
type container_auth_t alias docker_auth_t;
type container_auth_exec_t alias docker_auth_exec_t;
type spc_var_run_t;
type container_var_lib_t alias docker_var_lib_t;
type container_home_t alias docker_home_t;
type container_config_t alias docker_config_t;
type container_lock_t alias docker_lock_t;
type container_log_t alias docker_log_t;
type container_runtime_tmp_t alias docker_tmp_t;
type container_runtime_tmpfs_t alias docker_tmpfs_t;
type container_var_run_t alias docker_var_run_t;
type container_plugin_var_run_t alias docker_plugin_var_run_t;
type container_unit_file_t alias docker_unit_file_t;
type container_devpts_t alias docker_devpts_t;
typealias container_ro_file_t alias { container_share_t docker_share_t };
type container_port_t alias docker_port_t;
	type cephfs_t;
		type systemd_logind_t;
	type container_t;
typeattribute container_t container_domain, container_net_domain;
	type cgroup_t;
	type usermodehelper_t;
		type sysctl_kernel_ns_last_pid_t;
	type iptables_t;
		type unconfined_service_t;
		type unconfined_service_exec_t;
typeattribute  container_userns_t sandbox_net_domain;
		type proc_t, proc_kcore_t;
		type sysctl_t, sysctl_irq_t;
typeattribute container_logreader_t container_net_domain;
		type sysadm_t, staff_t, user_t;
	type init_t;

...
rpm -ql setools-console
man sesearch
sesearch -A -s 'container_.*' -rs -t 'container_.*' -rt | grep 'container' | wc -l
sesearch -A -t 'spc_.*' -rt -s 'spc_.*' -rs | grep 'spc'
seinfo --all | egrep 'kubernetes|openshift|container|docker|spc_' | less
seinfo -a container_domain -x

@westurner
Copy link
Contributor

@cjellick
Copy link
Contributor

cjellick commented Feb 4, 2020

@westurner the main bit of work involves getting MCS label support into containerd (k3s's embedded contianer runtime): See this WIP PR from @ibuildthecloud:
containerd/cri#1246

@davidnuzik davidnuzik changed the title Add support for SELinux Add support for SELinux (Enforced mode) Feb 4, 2020
@davidnuzik davidnuzik changed the title Add support for SELinux (Enforced mode) Formally add support for SELinux (Enforced mode) Feb 5, 2020
@erikwilson
Copy link
Contributor

Merged #1448

@davidnuzik
Copy link
Contributor Author

Closing this issue in favor of #533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement An improvement to existing functionality kind/internal os/centos
Projects
None yet
Development

No branches or pull requests

5 participants