-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds SELinux support to the system. Note this only installs some already packaged policies and enable them at install/upgrade time. Signed-off-by: David Cassany <[email protected]>
- Loading branch information
1 parent
24ad145
commit de13283
Showing
9 changed files
with
140 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: "installer" | ||
category: "utils" | ||
version: 0.6.33+5 | ||
version: 0.6.34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
requires: | ||
- name: "base" | ||
category: "distro" | ||
version: ">=0" | ||
|
||
steps: | ||
{{ if .Values.distribution }} | ||
{{if eq .Values.distribution "opensuse" }} | ||
- zypper ar https://download.opensuse.org/repositories/security:/SELinux/openSUSE_Leap_15.3/security:SELinux.repo | ||
- zypper --gpg-auto-import-keys in -y --allow-vendor-change --allow-downgrade selinux-policy audit selinux-tools python3-policycoreutils policycoreutils-python-utils container-selinux -libsemanage1 | ||
- zypper cc | ||
{{else if eq .Values.distribution "fedora" }} | ||
- dnf install -y container-selinux selinux-policy-targeted checkpolicy | ||
- dnf clean all | ||
- systemctl mask selinux-autorelabel.service && systemctl mask selinux-autorelabel-mark.service | ||
{{else if eq .Values.distribution "ubuntu" }} | ||
- apt-get install -y selinux-policy-default selinux-utils | ||
- apt-get clean | ||
{{end}} | ||
{{end}} | ||
- sed -i "s|^SELINUX=.*|SELINUX=permissive|g" /etc/selinux/config | ||
- rm -rf /.autorelabel | ||
{{ if .Values.distribution }} | ||
{{if eq .Values.distribution "opensuse" }} | ||
# Install cOS custom policy | ||
- checkmodule -M -m -o cOS.mod cOS.te && semodule_package -o cOS.pp -m cOS.mod | ||
- semodule -i cOS.pp | ||
{{end}} | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#==== cOS SELinux targeted policy module ======== | ||
# | ||
# Disclaimer: This module is definition is for illustration use only. It | ||
# has no guarantees of completeness, accuracy and usefulness. It should | ||
# not be used "as is". | ||
# | ||
|
||
|
||
module cOS 1.0; | ||
|
||
require { | ||
type init_t; | ||
type audisp_t; | ||
type getty_t; | ||
type unconfined_t; | ||
type initrc_t; | ||
type bin_t; | ||
type tmpfs_t; | ||
type wicked_t; | ||
type systemd_logind_t; | ||
type sshd_t; | ||
type lib_t; | ||
type unlabeled_t; | ||
type chkpwd_t; | ||
type unconfined_service_t; | ||
type usr_t; | ||
type local_login_t; | ||
type cert_t; | ||
type system_dbusd_t; | ||
class lnk_file read; | ||
class file { execmod getattr open read }; | ||
class dir { getattr read search watch }; | ||
} | ||
|
||
#============= audisp_t ============== | ||
allow audisp_t tmpfs_t:lnk_file read; | ||
|
||
#============= chkpwd_t ============== | ||
allow chkpwd_t tmpfs_t:file { getattr open read }; | ||
|
||
#============= getty_t ============== | ||
allow getty_t tmpfs_t:file { getattr open read }; | ||
|
||
#============= init_t ============== | ||
allow init_t cert_t:dir watch; | ||
allow init_t usr_t:dir watch; | ||
|
||
#============= initrc_t ============== | ||
|
||
#!!!! This avc can be allowed using the boolean 'selinuxuser_execmod' | ||
allow initrc_t bin_t:file execmod; | ||
|
||
#============= local_login_t ============== | ||
allow local_login_t tmpfs_t:file { getattr open read }; | ||
allow local_login_t tmpfs_t:lnk_file read; | ||
|
||
#============= sshd_t ============== | ||
allow sshd_t tmpfs_t:lnk_file read; | ||
|
||
#============= system_dbusd_t ============== | ||
allow system_dbusd_t lib_t:dir watch; | ||
allow system_dbusd_t tmpfs_t:lnk_file read; | ||
|
||
#============= systemd_logind_t ============== | ||
allow systemd_logind_t unlabeled_t:dir { getattr search }; | ||
|
||
#============= unconfined_service_t ============== | ||
|
||
#!!!! This avc can be allowed using the boolean 'selinuxuser_execmod' | ||
allow unconfined_service_t bin_t:file execmod; | ||
|
||
#============= unconfined_t ============== | ||
|
||
#!!!! This avc can be allowed using the boolean 'selinuxuser_execmod' | ||
allow unconfined_t bin_t:file execmod; | ||
|
||
#============= wicked_t ============== | ||
allow wicked_t tmpfs_t:dir read; | ||
allow wicked_t tmpfs_t:file { getattr open read }; | ||
allow wicked_t tmpfs_t:lnk_file read; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: "selinux-policies" | ||
category: "system" | ||
version: "0.0.6" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,5 +35,6 @@ packages: >- | |
haveged | ||
tar | ||
rsync | ||
timezone | ||
kernel_package: kernel-default |