summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaman <perfinion@gentoo.org>2020-10-12 20:22:51 -0700
committerJason Zaman <perfinion@gentoo.org>2020-10-12 20:22:51 -0700
commit198726fcc4ff4420bbd8c32bb3e4754b1741ac0d (patch)
tree13f2dcafe4332840c845d0a394fd4c49d0f29f3a /sec-policy/selinux-base
parentdev-libs/libgit2: Bump to 1.1.0 (diff)
downloadgentoo-198726fcc4ff4420bbd8c32bb3e4754b1741ac0d.tar.gz
gentoo-198726fcc4ff4420bbd8c32bb3e4754b1741ac0d.tar.bz2
gentoo-198726fcc4ff4420bbd8c32bb3e4754b1741ac0d.zip
sec-policy: Release of SELinux policies 2.20200818-r1
Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Jason Zaman <perfinion@gentoo.org>
Diffstat (limited to 'sec-policy/selinux-base')
-rw-r--r--sec-policy/selinux-base/Manifest2
-rw-r--r--sec-policy/selinux-base/selinux-base-2.20200818-r1.ebuild155
2 files changed, 157 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest
index bff747369f3e..a7e61b604c37 100644
--- a/sec-policy/selinux-base/Manifest
+++ b/sec-policy/selinux-base/Manifest
@@ -1,4 +1,6 @@
DIST patchbundle-selinux-base-policy-2.20190201-r1.tar.bz2 426390 BLAKE2B 33e05e03e1e087f0bf460930f074108af5fa05688f7681ba3545530d21174be7d29e9035a7bc37e9acdbe3468680891f9865ad83188eb0f8fb9b9012252d6a1e SHA512 f2855a340f4ae7ba6c4cf0ec9445de7ca20f9fc0f11783992340ca2f073bbbf2d4999190f46f3910213dd1555e9578b3609284af6a7712b401053216c004ff7e
DIST patchbundle-selinux-base-policy-2.20190609-r1.tar.bz2 407664 BLAKE2B e6b6b56f990389365c062522582e2177bc3b70040c99948efad25737e69178f9f72149cc443cb9edacfdd1aa6bc29f637cc61939f66e5cc3841f83298b33c41e SHA512 16195b51bb414ac82821f93756b3b5d0ec206b7035a50379c1f796082d9c53b11369e15086e1e26521808944266364470c43dcfdd1818ba079fda1613b7ef9bd
+DIST patchbundle-selinux-base-policy-2.20200818-r1.tar.bz2 278147 BLAKE2B 1e63517f15ed297c3cc1ed068db30ef60c0ebb11790abb89a80cde44da882b9381a8eccc66378576d84c106af7e9f7fd9e65b76b8e6f5134b34a2b517f5bb7f1 SHA512 d688e3f9d5dceb8a8747025adeddcfdd923e39757ab5ad7b92be00b544e47f0aa0c47aaf5a71eb4d3f616743d3291b8a8babdedfa238913371d58be3fccd4812
DIST refpolicy-2.20190201.tar.bz2 552750 BLAKE2B d3cbdf5c5f8480cd36173d8cfbd2f55a6ad4a9f2176883dcc19eece6059114ca8700d07f8bd318d0430da253bb9e4e6a6e03f7a7db8a7964c95b00452aaab040 SHA512 c6568b679ad1a7c5c566b55291e86ce3784ee609c0091e5d465d41055724d950180780c7eedb3413351101b9182db51c7bce1816db1a9a17b3257861363efc6e
DIST refpolicy-2.20190609.tar.bz2 555882 BLAKE2B abc45d9c906e0c880b7c47b0fb8e33f4a277c73244e20e8a95c44452db817241110127a5f8a3347cfbf5e30bf91f9dd4e5dd826426eb88b383fdbff5963f5fcd SHA512 f05ca08d31e62b7bf7203d7b243cce9ba87dd68d13b30067b99a44d5007449078fa82d591faa88c2955d370a346e69faedc850c02bd77c5624a8c746a13467f3
+DIST refpolicy-2.20200818.tar.bz2 570896 BLAKE2B 502c00fec39e1b81e42de3f7f942623f8b3fbdeac19f9f01126722a368b7d4f70427d6e4a574754c4f2fa551e4bc75c912dbc515c004f0dcd5eb28ab416498f6 SHA512 e4b527bb7a87b9359fc42eb111d5008103f57c37128998ea0e21ec7b0b8607ffe3f67697450e4c51a0db172ece69083335b279bacef4b1bd0b7748b58caa99a7
diff --git a/sec-policy/selinux-base/selinux-base-2.20200818-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20200818-r1.ebuild
new file mode 100644
index 000000000000..bb95a29ae659
--- /dev/null
+++ b/sec-policy/selinux-base/selinux-base-2.20200818-r1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}"
+ EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy"
+
+ inherit git-r3
+else
+ SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2
+ https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2"
+
+ KEYWORDS="~amd64 -arm ~arm64 ~mips ~x86"
+fi
+
+IUSE="doc +unknown-perms systemd +ubac +unconfined"
+
+DESCRIPTION="Gentoo base policy for SELinux"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux"
+LICENSE="GPL-2"
+SLOT="0"
+
+RDEPEND=">=sys-apps/policycoreutils-2.8
+ virtual/udev"
+DEPEND="${RDEPEND}
+ sys-devel/m4
+ >=sys-apps/checkpolicy-2.8"
+
+S=${WORKDIR}/
+
+src_prepare() {
+ if [[ ${PV} != 9999* ]]; then
+ einfo "Applying SELinux policy updates ... "
+ eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch"
+ fi
+
+ eapply_user
+
+ cd "${S}/refpolicy" || die
+ emake bare
+}
+
+src_configure() {
+ [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
+
+ # Update the SELinux refpolicy capabilities based on the users' USE flags.
+
+ if use unknown-perms; then
+ sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \
+ || die "Failed to allow Unknown Permissions Handling"
+ sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \
+ || die "Failed to allow Unknown Permissions Handling"
+ fi
+
+ if ! use ubac; then
+ sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \
+ || die "Failed to disable User Based Access Control"
+ fi
+
+ if use systemd; then
+ sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \
+ || die "Failed to enable SystemD"
+ fi
+
+ echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die
+
+ # Prepare initial configuration
+ cd "${S}/refpolicy" || die
+ emake conf
+
+ # Setup the policies based on the types delivered by the end user.
+ # These types can be "targeted", "strict", "mcs" and "mls".
+ for i in ${POLICY_TYPES}; do
+ cp -a "${S}/refpolicy" "${S}/${i}" || die
+ cd "${S}/${i}" || die
+
+ #cp "${FILESDIR}/modules-2.20120215.conf" "${S}/${i}/policy/modules.conf"
+ sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die
+
+ sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \
+ "${S}/${i}/build.conf" || die "build.conf setup failed."
+
+ if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]];
+ then
+ # MCS/MLS require additional settings
+ sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \
+ || die "failed to set type to mls"
+ fi
+
+ if [ "${i}" == "targeted" ]; then
+ sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
+ "${S}/${i}/config/appconfig-standard/seusers" \
+ || die "targeted seusers setup failed."
+ fi
+
+ if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then
+ sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \
+ "${S}/${i}/config/appconfig-${i}/seusers" \
+ || die "policy seusers setup failed."
+ fi
+ done
+}
+
+src_compile() {
+ [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
+
+ for i in ${POLICY_TYPES}; do
+ cd "${S}/${i}" || die
+ emake base
+ if use doc; then
+ emake html
+ fi
+ done
+}
+
+src_install() {
+ [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs"
+
+ for i in ${POLICY_TYPES}; do
+ cd "${S}/${i}" || die
+
+ emake DESTDIR="${D}" install
+ emake DESTDIR="${D}" install-headers
+
+ echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die
+
+ echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die
+
+ # libsemanage won't make this on its own
+ keepdir "/etc/selinux/${i}/policy"
+
+ if use doc; then
+ docinto ${i}/html
+ dodoc -r doc/html/*;
+ fi
+
+ insinto /usr/share/selinux/devel;
+ doins doc/policy.xml;
+
+ done
+
+ docinto /
+ dodoc doc/Makefile.example doc/example.{te,fc,if}
+
+ doman man/man8/*.8;
+
+ insinto /etc/selinux
+ doins "${FILESDIR}/config"
+
+ insinto /usr/share/portage/config/sets
+ doins "${FILESDIR}/selinux.conf"
+}