From 4f230652ec1609559c25dcb021042a65610668d8 Mon Sep 17 00:00:00 2001 From: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com> Date: Tue, 26 Sep 2023 05:47:12 +0300 Subject: [PATCH] Add SELinux as platform Make sure SELinux variables are not checked when no selinux is enabled The effect of the above missing is that rules checls remediation will attempt changes to the system, but those were not applicable. Also the change communicates with a side effect we observed in https://github.com/OpenSCAP/openscap/issues/1959 --- .../system/selinux/selinux-booleans/group.yml | 2 +- .../applicability/oval/selinux_is_enabled.xml | 32 +++++++++++++++++++ shared/applicability/selinux.yml | 3 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 shared/applicability/oval/selinux_is_enabled.xml create mode 100644 shared/applicability/selinux.yml diff --git a/linux_os/guide/system/selinux/selinux-booleans/group.yml b/linux_os/guide/system/selinux/selinux-booleans/group.yml index b252e476d6e..0215d5ba37c 100644 --- a/linux_os/guide/system/selinux/selinux-booleans/group.yml +++ b/linux_os/guide/system/selinux/selinux-booleans/group.yml @@ -2,7 +2,7 @@ documentation_complete: true title: 'SELinux - Booleans' -platform: not osbuild +platform: not osbuild and selinux description: |- Enable or Disable runtime customization of SELinux system policies diff --git a/shared/applicability/oval/selinux_is_enabled.xml b/shared/applicability/oval/selinux_is_enabled.xml new file mode 100644 index 00000000000..4c972c687af --- /dev/null +++ b/shared/applicability/oval/selinux_is_enabled.xml @@ -0,0 +1,32 @@ + + + + SELinux status check + + multi_platform_all + + Check if System has SELinux enabled. + + + + + + + + + + + + + + /etc/selinux/config + ^SELINUX=(.*)$ + 1 + + + + ^(enforcing|permissive)$ + + diff --git a/shared/applicability/selinux.yml b/shared/applicability/selinux.yml new file mode 100644 index 00000000000..286b30e228b --- /dev/null +++ b/shared/applicability/selinux.yml @@ -0,0 +1,3 @@ +name: cpe:/a:selinux +title: SELinux enabled on system +check_id: selinux_is_enabled