Sync from SUSE:SLFO:Main k3s-selinux revision 23bfa2e227391b3e2f67e3805b6da625

This commit is contained in:
Adrian Schröter 2024-05-03 14:09:43 +02:00
commit d298e62567
6 changed files with 226 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

18
_service Normal file
View File

@ -0,0 +1,18 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/k3s-io/k3s-selinux</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="revision">v1.4.stable.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="changesgenerate">enable</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="match-tag">*stable*</param>
</service>
<service name="set_version" mode="disabled">
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/k3s-io/k3s-selinux</param>
<param name="changesrevision">ab5417df8189d40447ac9bddd35b612e0b57a1ab</param></service></servicedata>

BIN
k3s-selinux-1.4.stable.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

77
k3s-selinux.changes Normal file
View File

@ -0,0 +1,77 @@
-------------------------------------------------------------------
Tue Jun 13 11:08:04 UTC 2023 - kastl@b1-systems.de
- Update to version 1.4.stable.1:
* Remove filetranspattern for snapshot directory (#51)
-------------------------------------------------------------------
Wed May 31 04:47:53 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.3.stable.1:
* Update container-selinux in el8 (#48)
* Update the container-selinux requirement (#46)
* Fix el9 policy to resolve the conflict with newer
container-selinux version (#45)
* Remove max container-selinux version check in el9 (#44)
* Fix docker image for centos9 and build requirements (#43)
* Add el9 (#42)
- Add cento9 policy and update container-selinux epoch version
- Add el9 to drone
* more fixes to the upload rpms (#40)
* fix coreos policy repo (#39)
* Fix upload rpms for coreos (#38)
* Fix policies to work with the container-selinux > 2.189.0 (#37)
- Add slemicro and fedora coreos policies
- Add maximum version requirement for centos8 policy
- fix microos policy to work with the new container-selinux
- Add drone support for slemicro and fedora coreos
-------------------------------------------------------------------
Wed Sep 07 12:38:10 UTC 2022 - kastl@b1-systems.de
- Update to version 1.2.stable.2:
* Bump pip/setuptools version; switch to https for git clone
* Use SHA256 to sign packages instead of default SHA1
-------------------------------------------------------------------
Wed Mar 16 17:40:02 UTC 2022 - kastl@b1-systems.de
- Update to version 1.1.stable.1:
* fix centos 7
- remove file k3s.if as it is now included in a release
-------------------------------------------------------------------
Wed Mar 16 17:39:11 UTC 2022 - kastl@b1-systems.de
- Update to version 1.0.stable.1:
* centos 8 vault: side-step eol problems (#28)
* k3s-root: reduced executable privileges (#26)
-------------------------------------------------------------------
Wed Jan 26 11:52:45 UTC 2022 - Richard Brown <rbrown@suse.com>
- Add missing spec license/copyright
-------------------------------------------------------------------
Sun Jan 9 15:18:33 UTC 2022 - Johannes Kastl <kastl@b1-systems.de>
- add k3s.if as source file, as it is empty in v0.5.stable.1
- this was cherry-picked from the latest commit:
https://github.com/k3s-io/k3s-selinux/commit/7b982cf500e20c0adbad8a83cc27c43a79218aca
-------------------------------------------------------------------
Sun Jan 09 07:16:00 UTC 2022 - kastl@b1-systems.de
- create new package at version 0.5.stable.1
- Update to version 0.5.latest.1:
* mention rpm signing keys in the readme
* fix for over-broad container_runtime_exec_t (#25)
* el8: keep on truckin (#24)
* drone: publish sle artifacts (#22)
* support sles 15 with sle micro packages (#21)
* [migrate k3s-io] drone tweaks
* Make k3s-selinux conflict with rke2-selinux
* Build independent el7 and el8 RPMs for k3s-selinux
* Modify build script to put the source RPM where we expect, as well as generate the source RPM
* Initial k3s-selinux el7_8 work

101
k3s-selinux.spec Normal file
View File

@ -0,0 +1,101 @@
#
# spec file for package k3s-selinux
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define k3s_relabel_files() \
mkdir -p /var/lib/cni; \
mkdir -p /var/lib/kubelet/pods; \
mkdir -p /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots; \
mkdir -p /var/lib/rancher/k3s/data; \
mkdir -p /var/run/flannel; \
mkdir -p /var/run/k3s; \
restorecon -R -i /etc/systemd/system/k3s.service; \
restorecon -R -i /usr/lib/systemd/system/k3s.service; \
restorecon -R /var/lib/cni; \
restorecon -R /var/lib/kubelet; \
restorecon -R /var/lib/rancher; \
restorecon -R /var/run/k3s; \
restorecon -R /var/run/flannel
%define selinux_policyver 20210716-3.1
%define container_policyver 2.164.2-1.1
Name: k3s-selinux
Version: 1.4.stable.1
Release: 0
Summary: SELinux policy module for k3s
Group: System Environment/Base
License: Apache-2.0
URL: http://k3s.io/k3s-selinux
Source: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: container-selinux >= %{container_policyver}
BuildRequires: git
BuildRequires: selinux-policy >= %{selinux_policyver}
BuildRequires: selinux-policy-devel >= %{selinux_policyver}
Requires: policycoreutils
Requires: selinux-tools
Requires(post): selinux-policy-base >= %{selinux_policyver}, policycoreutils, container-selinux >= %{container_policyver}
Requires(postun):policycoreutils
Provides: %{name} = %{version}-%{release}
Obsoletes: k3s-selinux <= 0.5
Conflicts: rke2-selinux
%description
This package installs and sets up the SELinux policy security module for k3s.
%prep
%setup -q
%build
cd policy/microos
make -f /usr/share/selinux/devel/Makefile k3s.pp
%install
install -d %{buildroot}%{_datadir}/selinux/packages
install -m 644 policy/microos/k3s.pp %{buildroot}%{_datadir}/selinux/packages
install -d %{buildroot}%{_datadir}/selinux/devel/include/contrib
install -m 644 policy/microos/k3s.if %{buildroot}%{_datadir}/selinux/devel/include/contrib/
install -d %{buildroot}/etc/selinux/targeted/contexts/users/
%pre
%selinux_relabel_pre
%post
%selinux_modules_install %{_datadir}/selinux/packages/k3s.pp
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
%k3s_relabel_files
fi;
%postun
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall k3s
fi;
%posttrans
%selinux_relabel_post
%files
%attr(0600,root,root) %{_datadir}/selinux/packages/k3s.pp
%{_datadir}/selinux/devel/include/contrib/k3s.if
%changelog