aee224
%global debug_package   %{nil}
aee224
aee224
# container-selinux
f4c24d
%global git0 https://github.com/containers/container-selinux
7f7458
%global commit0 f958d0cee4099f79890247ec64b57502b3acdb9f
aee224
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
aee224
aee224
# container-selinux stuff (prefix with ds_ for version/release etc.)
aee224
# Some bits borrowed from the openstack-selinux package
aee224
%global selinuxtype targeted
aee224
%global moduletype services
aee224
%global modulenames container
aee224
aee224
# Usage: _format var format
aee224
# Expand 'modulenames' into various formats as needed
aee224
# Format must contain '$x' somewhere to do anything useful
aee224
%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
aee224
aee224
# Version of SELinux we were using
08ac5f
%global selinux_policyver 3.14.3-9.el8
aee224
aee224
Epoch: 2
f4c24d
Name: container-selinux
7f7458
Version: 2.124.0
7f7458
Release: 1%{?dist}
aee224
License: GPLv2
aee224
URL: %{git0}
aee224
Summary: SELinux policies for container runtimes
aee224
Source0: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
aee224
BuildArch: noarch
aee224
BuildRequires: git
aee224
BuildRequires: pkgconfig(systemd)
aee224
BuildRequires: selinux-policy >= %{selinux_policyver}
aee224
BuildRequires: selinux-policy-devel >= %{selinux_policyver}
aee224
# RE: rhbz#1195804 - ensure min NVR for selinux-policy
aee224
Requires: selinux-policy >= %{selinux_policyver}
aee224
Requires(post): selinux-policy-base >= %{selinux_policyver}
aee224
Requires(post): selinux-policy-targeted >= %{selinux_policyver}
aee224
Requires(post): policycoreutils >= 2.5-11
aee224
%if 0%{?rhel} > 7 || 0%{?fedora}
aee224
Requires(post): policycoreutils-python-utils
aee224
%else
aee224
Requires(post): policycoreutils-python
aee224
%endif
aee224
Requires(post): libselinux-utils
aee224
Requires(post): sed
aee224
Obsoletes: %{name} <= 2:1.12.5-14
aee224
Obsoletes: docker-selinux <= 2:1.12.4-28
aee224
Provides: docker-selinux = %{epoch}:%{version}-%{release}
aee224
Provides: docker-engine-selinux = %{epoch}:%{version}-%{release}
aee224
aee224
%description
aee224
SELinux policy modules for use with container runtimes.
aee224
aee224
%prep
f4c24d
%autosetup -Sgit -n %{name}-%{commit0}
aee224
aee224
%build
aee224
make
aee224
aee224
%install
aee224
# install policy modules
aee224
%_format MODULES $x.pp.bz2
aee224
install -d %{buildroot}%{_datadir}/selinux/packages
aee224
install -d -p %{buildroot}%{_datadir}/selinux/devel/include/services
aee224
install -p -m 644 %{modulenames}.if %{buildroot}%{_datadir}/selinux/devel/include/services
aee224
install -m 0644 $MODULES %{buildroot}%{_datadir}/selinux/packages
aee224
aee224
# remove spec file
aee224
rm -rf %{name}.spec
aee224
aee224
%check
aee224
7f7458
%pre
7f7458
%selinux_relabel_pre -s %{selinuxtype}
7f7458
aee224
%post
aee224
# Install all modules in a single transaction
aee224
if [ $1 -eq 1 ]; then
f4c24d
   %{_sbindir}/setsebool -P -N virt_use_nfs=1 virt_sandbox_use_all_caps=1
aee224
fi
aee224
%_format MODULES %{_datadir}/selinux/packages/$x.pp.bz2
aee224
%{_sbindir}/semodule -n -s %{selinuxtype} -r container 2> /dev/null
aee224
%{_sbindir}/semodule -n -s %{selinuxtype} -d docker 2> /dev/null
aee224
%{_sbindir}/semodule -n -s %{selinuxtype} -d gear 2> /dev/null
7f7458
%selinux_modules_install -s %{selinuxtype} $MODULES
aee224
. %{_sysconfdir}/selinux/config
aee224
sed -e "\|container_file_t|h; \${x;s|container_file_t||;{g;t};a\\" -e "container_file_t" -e "}" -i /etc/selinux/${SELINUXTYPE}/contexts/customizable_types
aee224
matchpathcon -qV %{_sharedstatedir}/containers || restorecon -R %{_sharedstatedir}/containers &> /dev/null || :
aee224
aee224
%postun
aee224
if [ $1 -eq 0 ]; then
7f7458
%selinux_modules_uninstall -s %{selinuxtype} %{modulenames} docker
aee224
fi
aee224
7f7458
%posttrans
7f7458
%selinux_relabel_post -s %{selinuxtype}
7f7458
aee224
#define license tag if not already defined
aee224
%{!?_licensedir:%global license %doc}
aee224
aee224
%files
aee224
%doc README.md
aee224
%{_datadir}/selinux/*
aee224
aee224
%changelog
7f7458
* Wed Dec 11 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.124.0-1
7f7458
- update to 2.124.0
7f7458
- Related: RHELPLAN-25138
7f7458
7f7458
* Fri Dec 06 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.123.0-2
7f7458
- implement spec file refactoring by Zdenek Pytela, namely:
7f7458
  Change the uninstall command in the %postun section of the specfile
7f7458
  to use the %selinux_modules_uninstall macro which uses priority 200.
7f7458
  Change the install command in the %post section if the specfile
7f7458
  to use the %selinux_modules_install macro.
7f7458
  Replace relabel commands with using the %selinux_relabel_pre and
7f7458
  %selinux_relabel_post macros.
7f7458
  Change formatting so that the lines are vertically aligned
7f7458
  in the %postun section.
7f7458
  (https://github.com/containers/container-selinux/pull/85)
7f7458
- Related: RHELPLAN-25138
7f7458
f4c24d
* Tue Nov 26 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.123.0-1
f4c24d
- update to 2.123.0
7f7458
- Related: RHELPLAN-25138
f4c24d
f4c24d
* Mon Nov 25 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.122.0-1
f4c24d
- update to 2.122.0
f4c24d
f4c24d
* Thu Nov 21 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.119.0-3.gita233788
7f7458
- update to master container-selinux - bug 1769469
7f7458
7f7458
* Tue Nov 19 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.119.0-2
7f7458
- fix post scriptlet - fail if semodule fails - bug 1729272
7f7458
7f7458
* Fri Nov 08 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.119.0-1
7f7458
- update to 2.119.0
f4c24d
f4c24d
* Thu Oct 17 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.116-1
7f7458
- update to 2.116, bug 1748519
f4c24d
08ac5f
* Tue Aug 13 2019 Jindrich Novy <jnovy@redhat.com> - 2:2.107-2
08ac5f
- Use at least selinux policy 3.14.3-9.el8,
08ac5f
  Resolves: #1728700
08ac5f
08ac5f
* Fri Jun 14 2019 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.107-1
08ac5f
- Resolves: #1720654 - rebase to v2.107
2ea28a
2ea28a
* Mon Mar 11 2019 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.89-1.git2521d0d
2ea28a
- bump to v2.89
2ea28a
aee224
* Tue Nov 13 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.75-1.git99e2cfd
aee224
- bump to v2.75
aee224
- built commit 99e2cfd
aee224
aee224
* Mon Oct 22 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.74-1
aee224
- Resolves: #1641655 - bump to v2.74
aee224
- built commit a62c2db
aee224
aee224
* Tue Sep 18 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 2:2.73-3
aee224
- tweak macro for fedora - applies to rhel8 as well
aee224
aee224
* Mon Sep 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 2:2.73-2
aee224
- moved changelog entries:
aee224
- Define spc_t as a container_domain, so that container_runtime will transition
aee224
to spc_t even when setup with nosuid.
aee224
- Allow container_runtimes to setattr on callers fifo_files
aee224
- Fix restorecon to not error on missing directory
aee224
aee224
* Thu Sep 6 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.69-3
aee224
- Make sure we pull in the latest selinux-policy
aee224
aee224
* Wed Jul 25 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.69-2
aee224
- Add map support to container-selinux for RHEL 7.5
aee224
- Dontudit attempts to write to kernel_sysctl_t
aee224
aee224
* Mon Jul 16 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.68-1
aee224
- Add label for /var/lib/origin
aee224
- Add customizable_file_t to customizable_types
aee224
aee224
* Sun Jul 15 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.67-1
aee224
- Add policy for container_logreader_t
aee224
aee224
* Thu Jun 14 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.66-1
aee224
- Allow dnsmasq to dbus chat with spc_t
aee224
aee224
* Sun Jun 3 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.64-1
aee224
- Allow containers to create all socket classes
aee224
aee224
* Thu May 24 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.62-1
aee224
- Label overlay directories under /var/lib/containers/ correctly
aee224
aee224
* Mon May 21 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.61-1
aee224
- Allow spc_t to load kernel modules from inside of container 
aee224
aee224
* Mon May 21 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.60-1
aee224
- Allow containers to list cgroup directories
aee224
- Transition for unconfined_service_t to container_runtime_t when executing container_runtime_exec_t.
aee224
aee224
* Mon May 21 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.58-2
aee224
- Run restorecon /usr/bin/podman in postinstall
aee224
aee224
* Fri May 18 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.58-1
aee224
- Add labels to allow podman to be run from a systemd unit file
aee224
aee224
* Mon May 7 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.57-1
aee224
- Set the version of SELinux policy required to the latest to fix build issues.
aee224
aee224
* Wed Apr 11 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.56-1
aee224
- Allow container_runtime_t to transition to spc_t over unlabeled files
aee224
aee224
* Mon Mar 26 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.55-1
aee224
    Allow iptables to read container state
aee224
    Dontaudit attempts from containers to write to /proc/self
aee224
    Allow spc_t to change attributes on container_runtime_t fifo files
aee224
aee224
* Thu Mar 8 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.52-1
aee224
- Add better support for writing custom selinux policy for customer container domains.
aee224
aee224
* Thu Mar 8 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.51-1
aee224
- Allow shell_exec_t as a container_runtime_t entrypoint
aee224
aee224
* Wed Mar 7 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.50-1
aee224
- Allow bin_t as a container_runtime_t entrypoint
aee224
aee224
* Fri Mar 2 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.49-1
aee224
- Add support for MLS running container runtimes
aee224
- Add missing allow rules for running systemd in a container
aee224
aee224
* Wed Feb 21 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.48-1
aee224
- Update policy to match master branch
aee224
- Remove typebounds and replace with nnp_transition and nosuid_transition calls
aee224
aee224
* Tue Jan 9 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.41-1
aee224
- Add support to nnp_transition for container domains
aee224
- Eliminates need for typebounds.
aee224
aee224
* Tue Jan 9 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.40-1
aee224
- Allow container_runtime_t to use user ttys
aee224
- Fixes bounds check for container_t
aee224
aee224
* Mon Jan 8 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.39-1
aee224
- Allow container runtimes to use interited terminals.  This helps
aee224
satisfy the bounds check of container_t versus container_runtime_t.
aee224
aee224
* Sat Jan 6 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.38-1
aee224
- Allow container runtimes to mmap container_file_t devices
aee224
- Add labeling for rhel push plugin
aee224
aee224
* Tue Dec 12 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.37-1
aee224
- Allow containers to use inherited ttys
aee224
- Allow ostree to handle labels under /var/lib/containers/ostree
aee224
aee224
* Mon Nov 27 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.36-1
aee224
- Allow containers to relabelto/from all file types to container_file_t
aee224
aee224
* Mon Nov 27 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.35-1
aee224
- Allow container to map chr_files labeled container_file_t
aee224
aee224
* Wed Nov 22 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.34-1
aee224
- Dontaudit container processes getattr on kernel file systems
aee224
aee224
* Sun Nov 19 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.33-1
aee224
- Allow containers to read /etc/resolv.conf and /etc/hosts if volume
aee224
- mounted into container.
aee224
aee224
* Wed Nov 8 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.32-1
aee224
- Make sure users creating content in /var/lib with right labels
aee224
aee224
* Thu Oct 26 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.31-1
aee224
- Allow the container runtime to dbus chat with dnsmasq
aee224
- add dontaudit rules for container trying to write to /proc
aee224
aee224
* Tue Oct 10 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.29-1
aee224
- Add support for lxcd
aee224
- Add support for labeling of tmpfs storage created within a container.
aee224
aee224
* Mon Oct 9 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.28-1
aee224
- Allow a container to umount a container_file_t filesystem
aee224
aee224
* Fri Sep 22 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.27-1
aee224
-  Allow container runtimes to work with the netfilter sockets
aee224
-  Allow container_file_t to be an entrypoint for VM's
aee224
-  Allow spc_t domains to transition to svirt_t
aee224
aee224
* Fri Sep 22 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.24-1
aee224
-     Make sure container_runtime_t has all access of container_t
aee224
aee224
* Thu Sep 7 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.23-1
aee224
- Allow container runtimes to create sockets in tmp dirs
aee224
aee224
* Tue Sep 5 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.22-1
aee224
- Add additonal support for crio labeling.
aee224
aee224
* Mon Aug 14 2017 Troy Dawson <tdawson@redhat.com> - 2.21-3
aee224
- Fixup spec file conditionals
aee224
aee224
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2:2.21-2
aee224
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
aee224
aee224
* Thu Jul 6 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.21-1
aee224
- Allow containers to execmod on container_share_t files.
aee224
aee224
* Thu Jul 6 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.20-2
aee224
- Relabel runc and crio executables
aee224
aee224
* Fri Jun 30 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2.20-1
aee224
- Allow container processes to getsession
aee224
aee224
* Wed Jun 14 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.19-2.1
aee224
- update release tag to isolate from 7.3
aee224
aee224
* Wed Jun 14 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2:2.19-1
aee224
- Fix mcs transition problem on stdin/stdout/stderr
aee224
- Add labels for CRI-O
aee224
- Allow containers to use tunnel sockets
aee224
aee224
* Tue Jun 06 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.15-1.1
aee224
- Resolves: #1451289
aee224
- rebase to v2.15
aee224
- built @origin/RHEL-1.12 commit 583ca40
aee224
aee224
* Mon Mar 20 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2:2.10-2.1
aee224
- Make sure we have a late enough version of policycoreutils
aee224
aee224
* Mon Mar 6 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2:2.10-1
aee224
- Update to the latest container-selinux patch from upstream
aee224
- Label files under /usr/libexec/lxc as container_runtime_exec_t
aee224
- Give container_t access to XFRM sockets
aee224
- Allow spc_t to dbus chat with init system
aee224
- Allow containers to read cgroup configuration mounted into a container
aee224
aee224
* Tue Feb 21 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.9-4
aee224
- Resolves: #1425574
aee224
- built commit 79a6d70
aee224
aee224
* Mon Feb 20 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.9-3
aee224
- Resolves: #1420591
aee224
- built @origin/RHEL-1.12 commit 8f876c4
aee224
aee224
* Mon Feb 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.9-2
aee224
- built @origin/RHEL-1.12 commit 33cb78b
aee224
aee224
* Fri Feb 10 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.8-2
aee224
-
aee224
aee224
* Tue Feb 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 2:2.7-1
aee224
- built origin/RHEL-1.12 commit 21dd37b
aee224
aee224
* Fri Jan 20 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.4-2
aee224
- correct version-release in changelog entries
aee224
aee224
* Thu Jan 19 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2:2.4-1
aee224
- Add typebounds statement for container_t from container_runtime_t
aee224
- We should only label runc not runc*
aee224
aee224
* Tue Jan 17 2017 Dan Walsh <dwalsh@fedoraproject.org> - 2:2.3-1
aee224
- Fix labeling on /usr/bin/runc.*
aee224
- Add sandbox_net_domain access to container.te
aee224
- Remove containers ability to look at /etc content
aee224
aee224
* Wed Jan 11 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.2-4
aee224
- use upstream's RHEL-1.12 branch, commit 56c32da for CentOS 7
aee224
aee224
* Tue Jan 10 2017 Jonathan Lebon <jlebon@redhat.com> - 2:2.2-3
aee224
- properly disable docker module in %%post
aee224
aee224
* Sat Jan 07 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.2-2
aee224
- depend on selinux-policy-targeted
aee224
- relabel docker-latest* files as well
aee224
aee224
* Fri Jan 06 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.2-1
aee224
- bump to v2.2
aee224
- additional labeling for ocid
aee224
aee224
* Fri Jan 06 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.0-2
aee224
- install policy at level 200
aee224
- From: Dan Walsh <dwalsh@redhat.com>
aee224
aee224
* Fri Jan 06 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:2.0-1
aee224
- Resolves: #1406517 - bump to v2.0 (first upload to Fedora as a
aee224
standalone package)
aee224
- include projectatomic/RHEL-1.12 branch commit for building on centos/rhel
aee224
aee224
* Mon Dec 19 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2:1.12.4-29
aee224
- new package (separated from docker)