Remove auditd and policy tool in guest 69/29569/2
authorNaoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Sun, 31 Dec 2023 15:34:40 +0000 (00:34 +0900)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 29 Jan 2024 12:01:29 +0000 (12:01 +0000)
The SELinux policy set at host in boot time, the guest container shall
not overwrite SELinux policy.  On the other hand, existing guest
integration install SELinux policy tool in guest.
The auditd has same issue. That shall work in host, shall not work in guest.

This patch fix these issue.

Bug-AGL: SPEC-5039

Change-Id: I3887d4f64d31a833f5e47fd9fb41e8fbbf6efe1e
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
meta-agl-ic-container/dynamic-layers/meta-selinux/recipes-security/packagegroups/packagegroup-agl-core-selinux-guest.bb [new file with mode: 0644]
meta-agl-ic-container/recipes-platform/images/guest-image-minimal.bb

diff --git a/meta-agl-ic-container/dynamic-layers/meta-selinux/recipes-security/packagegroups/packagegroup-agl-core-selinux-guest.bb b/meta-agl-ic-container/dynamic-layers/meta-selinux/recipes-security/packagegroups/packagegroup-agl-core-selinux-guest.bb
new file mode 100644 (file)
index 0000000..d58d901
--- /dev/null
@@ -0,0 +1,24 @@
+SUMMARY = "SELinux packages for container guest"
+DESCRIPTION = "SELinux packages required for AGL"
+LICENSE = "MIT"
+
+inherit packagegroup features_check
+
+REQUIRED_DISTRO_FEATURES = "selinux"
+
+PACKAGES = " \
+    packagegroup-agl-core-selinux-guest \
+"
+
+# The packagegroup-agl-core-selinux is including auditd.
+# But it shall run in host, shall not run in guest.
+# This package group remove from host only package from packagegroup-agl-core-selinux
+
+RDEPENDS:${PN} = " \
+    coreutils \
+    libsepol \
+    libselinux \
+    libselinux-bin \
+    libsemanage \
+    refpolicy \
+"
index ea66f24..8dcdb3f 100644 (file)
@@ -8,4 +8,12 @@ IMAGE_INSTALL += " \
     packagegroup-agl-container-feature-logging-guest \
 "
 
+FEATURE_PACKAGES_selinux:remove = " \
+    packagegroup-agl-core-selinux \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'packagegroup-agl-core-selinux-devel', '', d)} \
+"
+FEATURE_PACKAGES_selinux:append = " \
+    packagegroup-agl-core-selinux-guest \
+"
+
 NO_RECOMMENDATIONS = "1"