summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Vermeulen <swift@gentoo.org>2017-04-10 20:08:46 +0200
committerSven Vermeulen <swift@gentoo.org>2017-04-10 20:09:11 +0200
commitf53ac27438b156691fd7dd85449ad4bd7d19112a (patch)
tree421de4bfc1fca1470d381a755efe4fdd60efc280 /sec-policy/selinux-base
parentprofiles/package.mask: mask dev-db/redis-3.2.5-r2 / dev-db/redis-3.2.6-r2 for... (diff)
downloadgentoo-f53ac27438b156691fd7dd85449ad4bd7d19112a.tar.gz
gentoo-f53ac27438b156691fd7dd85449ad4bd7d19112a.tar.bz2
gentoo-f53ac27438b156691fd7dd85449ad4bd7d19112a.zip
sec-policy: Release of SELinux policies 2.20170204-r3
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'sec-policy/selinux-base')
-rw-r--r--sec-policy/selinux-base/Manifest1
-rw-r--r--sec-policy/selinux-base/selinux-base-2.20170204-r3.ebuild160
2 files changed, 161 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest
index 2f256bb5e489..fa6871257b2f 100644
--- a/sec-policy/selinux-base/Manifest
+++ b/sec-policy/selinux-base/Manifest
@@ -5,6 +5,7 @@ DIST patchbundle-selinux-base-policy-2.20161023-r3.tar.bz2 321394 SHA256 7652140
DIST patchbundle-selinux-base-policy-2.20161023-r4.tar.bz2 358553 SHA256 d105d5fbf2859d7f9766ef46ef29c3d71165b4f5ff9548bcbdeca5a1f76b0c27 SHA512 a99f3eda699eb4b040c19f51060a96a116a76aabda323d1a2d840f130c6ccfe34118645d296d48f855a2a2abb0ab6db686b37d02950012798796eafcebfdd781 WHIRLPOOL 849b0e88ed3f1f54de18c0c2edcc0fecd3968e30eb970aace41d0b79aa3d203b2bbcf96f4c564fed95e7b3c8e3b2f524e11c9942ab36e6d6c49431696925b8a8
DIST patchbundle-selinux-base-policy-2.20170204-r1.tar.bz2 327838 SHA256 66ca7d95e7af81f30dce42550f6dccba0cabc52fefa18747a552ef8caa892e4c SHA512 727dd11bc5a777388199fb1da67add940a6051cca874456cdc4bb65f567216481e70b92fcf37ac59cc48d907fbe87b67e97c3813c4c97d5f31b7c66b7246f166 WHIRLPOOL 6235b026ee9c9acff18923634b6047e155d836a3544ae8e5e4448cc198732629fc163e5374b0546187703afe020a3473d3e2bc3883533a96fe3537fa14487fa4
DIST patchbundle-selinux-base-policy-2.20170204-r2.tar.bz2 354083 SHA256 95a77b781be01ed29fe02df2b72fa1fe90e993c1a9513ccd94ad3f39d6170367 SHA512 ac907590cefdc69638fce25de481d3dce625f0f1511e0fa3d0bcc78b2a18c57c0bea392c225d314645b1aec5abbcedf67bfc50b66be8580447bbcac7223ea66d WHIRLPOOL d447bb2afb33d66c11db77b1b3401b9151394f3cc306a660efd4e858648a4f8d2c9b6281bc1c41f820103bd352bc47e933e2d84e0d351c4b6be038877b7f167e
+DIST patchbundle-selinux-base-policy-2.20170204-r3.tar.bz2 342266 SHA256 c5d99de3af1a6aec5aced5c4776ee47e15dbf467e116daa9d2df6f69653cf1c9 SHA512 df46b785a17c633d6fcd063b48258a362a0df13fcb71fb699b6c19281f4d647db43639e08e083157fcd49405c5c38c8408534decff99536d28ada64e9192d130 WHIRLPOOL 703c227d4490d9ba291089ac425c1e2924ad28644e5e7fbacbdc43c77eb7df6eaf776bef52b4019316f104ba29f06f90fc6222eb43106f7a9d678cf369eaf807
DIST refpolicy-2.20151208.tar.bz2 698182 SHA256 2dd2f45a7132137afe8302805c3b7839739759b9ab73dd1815c01afe34ac99de SHA512 cbefe117f143adea834065949e24e9fe86336c049e9e0518026597d5b0a18c482a9717422bd39b7fb0012d19df00365c969d87e1f13a7bb9dcb9996313ed6cf8 WHIRLPOOL cb843a602dde4234a62e6f92001bff689a457796215b015bcccce79e7aa73bfe875a82bdbdbf59236f218eb41aaf665fcc5753c42d86eb3ed1caa1b69ddc2efa
DIST refpolicy-2.20161023.tar.bz2 1768667 SHA256 14c9576e2cdf0ecf656134bc59cba99589dbba2895344d2fc226bdb5d8e541c7 SHA512 3201ca3c6cada1053343d3763d36072cf40afa46bf5343087a8254320879cb61fef539dc7742e04e5645d0c886b8f4bf552bf502e9716f7a3282efc0b0ed970d WHIRLPOOL 3f44955c3b13f5a6152d8ca8b75b3c8d52becc1c47b3b0126f5c86fbdad8bf6a1ae72c42e0b130352e139f987340b3c0d3d37aac5b80c5e3d731fcd666b88504
DIST refpolicy-2.20170204.tar.bz2 709965 SHA256 5e4daee61d89dfdc8c7bf369f81c99845931e337916dc6401e301c5de57ea336 SHA512 30deabb02a5bde51c463e3e89988d850cff51596c2e72733a064245dec152ea46317eea79550dbe82a7a0d327ec0bcfbd9474ff8a902507392df0da00df6397f WHIRLPOOL a6b6aa1265f3e7e78c6e8012f0cb8098e0727e77bfcf8165866e876b41c18648711c82d87750c081cc49e89b85be03ef3b420a2df25269e2ce070181af308ec6
diff --git a/sec-policy/selinux-base/selinux-base-2.20170204-r3.ebuild b/sec-policy/selinux-base/selinux-base-2.20170204-r3.ebuild
new file mode 100644
index 000000000000..29b2fee3bf1c
--- /dev/null
+++ b/sec-policy/selinux-base/selinux-base-2.20170204-r3.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+EAPI="6"
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="${SELINUX_GIT_REPO:-git://anongit.gentoo.org/proj/hardened-refpolicy.git 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://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files/refpolicy-${PV}.tar.bz2
+ https://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2"
+
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+fi
+
+IUSE="doc +open_perms +peer_perms systemd +ubac +unconfined"
+
+DESCRIPTION="Gentoo base policy for SELinux"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/selinux/"
+LICENSE="GPL-2"
+SLOT="0"
+
+RDEPEND=">=sys-apps/policycoreutils-2.3
+ virtual/udev"
+DEPEND="${RDEPEND}
+ sys-devel/m4
+ >=sys-apps/checkpolicy-2.3"
+
+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 peer_perms; then
+ sed -i -e '/network_peer_controls/d' \
+ "${S}/refpolicy/policy/policy_capabilities" || die
+ fi
+
+ if ! use open_perms; then
+ sed -i -e '/open_perms/d' \
+ "${S}/refpolicy/policy/policy_capabilities" || die
+ 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 || die "Make conf failed"
+
+ # 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 \
+ || die "${i} install failed."
+
+ emake DESTDIR="${D}" install-headers \
+ || die "${i} headers install failed."
+
+ 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"
+}