Skip to content

Commit

Permalink
[WIP] add selinux-policies packages
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed May 3, 2021
1 parent 95aeb1d commit 7b54025
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/cos/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ requires:
- name: cos-features
category: system
version: ">=0"
- name: "refpolicy"
#- name: "refpolicy"
#category: "system"
#version: ">=0"
- name: "selinux-policies"
category: "system"
version: ">=0"

Expand Down
2 changes: 1 addition & 1 deletion packages/installer/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "installer"
category: "utils"
version: "0.6.33"
version: "0.6.34"
3 changes: 2 additions & 1 deletion packages/installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ do_copy()
{
echo "Copying cOS.."

rsync -aqz --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' ${DISTRO}/ ${TARGET}
rsync -aqzAX --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' ${DISTRO}/ ${TARGET}
if [ -n "$COS_INSTALL_CONFIG_URL" ]; then
OEM=${TARGET}/oem/99_custom.yaml
get_url "$COS_INSTALL_CONFIG_URL" $OEM
chmod 600 ${OEM}
fi
setfiles -r ${TARGET} ${TARGET}/etc/selinux/targeted/contexts/files/file_contexts ${TARGET}
mkdir -p $TARGET/usr/local/cloud-config
cat > $TARGET/usr/local/cloud-config/90_after_install.yaml <<EOF
# Execute this stage in the boot phase:
Expand Down
3 changes: 2 additions & 1 deletion packages/installer/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ upgrade() {
args=
fi
luet util unpack $args $UPGRADE_IMAGE /usr/local/tmp/rootfs
rsync -aqz --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' /usr/local/tmp/rootfs/ /tmp/upgrade
rsync -aqzAX --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' /usr/local/tmp/rootfs/ /tmp/upgrade
setfiles -r ${TARGET} ${TARGET}/etc/selinux/targeted/contexts/files/file_contexts ${TARGET}
rm -rf /usr/local/tmp/rootfs
fi

Expand Down
21 changes: 21 additions & 0 deletions packages/selinux-policies/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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
- 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}}
- rm -rf /.autorelabel
4 changes: 4 additions & 0 deletions packages/selinux-policies/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: "selinux-policies"
category: "system"
version: "0.0.3"

0 comments on commit 7b54025

Please sign in to comment.