permissions/permissions.spec

139 lines
4.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package permissions
#
# Copyright (c) 2024 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/
#
Name: permissions
Version: 1699_20240513
Release: 0
Summary: SUSE Linux Default Permissions
# Maintained in github by the security team.
License: GPL-2.0-or-later
Group: Productivity/Security
URL: http://github.com/openSUSE/permissions
Accepting request 1152267 from home:fbonazzi:branches:Base:System - Update to version 1699_20240223: * chkstat: replace ProcMountState enum by simple bool member * chkstat: minor style, spelling and documentation fixes * chkstat: drop types.h header * chkstat: make ProcMountState a private type of ChkStat * chkstat: EntryProcessor: rename some member variables for improved readability * chkstat: get rid of EntryContext and incorporate it into EntryProcessor * chkstat: split-off EntryProcessor from Chkstat main class * chkstat: define _GNU_SOURCE via Makefile * chkstat: processEntries(): make loop variables const * chkstat: split up checkHaveProc() * chkstat: ProfileParser: fix a bug when applying capabilities in custom root * chkstat: ProfileParser: make adding the root to paths transparent * chkstat: ProfileParser: refactor the now reduced codebase * chkstat: split off separate ProfileParser * chkstat: ProfileEntry: mark dropXID() const to support const ProfileEntry use * chkstat: parseProfile(): improve badProfileLine() calls * chkstat: drop deprecated capability check * chkstat: also move expandProfilePaths() into new VariableExpansions class * chkstat: split off variable expansion logic into separate class * chkstat: loadVariableExpansions(): a bit of refactoring * chkstat: parseSysconfig(): bit of refactoring * chkstat: remove deprecated CHECK_PERMISSIONS logic * chkstat: move assorted types into dedicated header * chkstat: replace #include guards by #pragma once * chkstat: split off command line arguments from Chkstat main class * chkstat: drop SaneValueArg wrapper * chkstat: document new packages.d directory * chkstat: drop TODO regarding ProfileEntry being changed on-the-fly * chkstat: harmonize FileCapabilities API * chkstat: support /usr/share/permissions/package.d for per-package drop-ins * chkstat: minor coding style fixes * chkstat: improve readability for rstrip() to strip trailing slashes * chkstat: remove trailing slashes from paths found on the command line * chkstat: add warning messages for rare error situations * chkstat: open profiles right away without racy `access()` check. - Remove fix_version.sh, handle version with services OBS-URL: https://build.opensuse.org/request/show/1152267 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=333
2024-02-27 13:47:01 +01:00
Source: permissions-%{version}.tar.xz
Source2: permissions.rpmlintrc
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
BuildRequires: gcc-c++
BuildRequires: libacl-devel
BuildRequires: libcap-devel
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
BuildRequires: libcap-progs
BuildRequires: meson
BuildRequires: python-rpm-macros
BuildRequires: tclap
# test suite
BuildRequires: python3-base
Requires: permctl
Requires: permissions-config
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
Provides: aaa_base:%{_datadir}/permissions
%prep
Accepting request 1152267 from home:fbonazzi:branches:Base:System - Update to version 1699_20240223: * chkstat: replace ProcMountState enum by simple bool member * chkstat: minor style, spelling and documentation fixes * chkstat: drop types.h header * chkstat: make ProcMountState a private type of ChkStat * chkstat: EntryProcessor: rename some member variables for improved readability * chkstat: get rid of EntryContext and incorporate it into EntryProcessor * chkstat: split-off EntryProcessor from Chkstat main class * chkstat: define _GNU_SOURCE via Makefile * chkstat: processEntries(): make loop variables const * chkstat: split up checkHaveProc() * chkstat: ProfileParser: fix a bug when applying capabilities in custom root * chkstat: ProfileParser: make adding the root to paths transparent * chkstat: ProfileParser: refactor the now reduced codebase * chkstat: split off separate ProfileParser * chkstat: ProfileEntry: mark dropXID() const to support const ProfileEntry use * chkstat: parseProfile(): improve badProfileLine() calls * chkstat: drop deprecated capability check * chkstat: also move expandProfilePaths() into new VariableExpansions class * chkstat: split off variable expansion logic into separate class * chkstat: loadVariableExpansions(): a bit of refactoring * chkstat: parseSysconfig(): bit of refactoring * chkstat: remove deprecated CHECK_PERMISSIONS logic * chkstat: move assorted types into dedicated header * chkstat: replace #include guards by #pragma once * chkstat: split off command line arguments from Chkstat main class * chkstat: drop SaneValueArg wrapper * chkstat: document new packages.d directory * chkstat: drop TODO regarding ProfileEntry being changed on-the-fly * chkstat: harmonize FileCapabilities API * chkstat: support /usr/share/permissions/package.d for per-package drop-ins * chkstat: minor coding style fixes * chkstat: improve readability for rstrip() to strip trailing slashes * chkstat: remove trailing slashes from paths found on the command line * chkstat: add warning messages for rare error situations * chkstat: open profiles right away without racy `access()` check. - Remove fix_version.sh, handle version with services OBS-URL: https://build.opensuse.org/request/show/1152267 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=333
2024-02-27 13:47:01 +01:00
%autosetup
%build
%meson
%meson_build
%install
%meson_install
# Fix shebang in scripts: Remove dependency on /usr/bin/python3,
# making scripts to depends on the real python3 binary, not the link.
# (bsc#1212476)
for f in %{buildroot}/usr/lib/zypp/plugins/commit/*
do
[ -f $f ] && sed -i "1s@#\!.*python.*@#\!$(realpath %__python3)@" $f
done
%check
# will fail on qemu with unshare: unshare failed: Invalid argument
%if !0%{?qemu_user_space_build}
tests/regtest.py --skip-build %_vpath_builddir >/dev/null
%endif
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
%description
File and directory permission settings depending on the local security
settings. The local security setting ("easy", "secure", or "paranoid") can be
configured in /etc/sysconfig/security.
This package does not contain files, it just requires the necessary packages.
%files
%package config
Summary: SUSE Linux Default Permissions config files
Group: Productivity/Security
Requires(post): %fillup_prereq
Requires(post): permctl
#!BuildIgnore: group(trusted)
Requires(pre): group(trusted)
Accepting request 1152267 from home:fbonazzi:branches:Base:System - Update to version 1699_20240223: * chkstat: replace ProcMountState enum by simple bool member * chkstat: minor style, spelling and documentation fixes * chkstat: drop types.h header * chkstat: make ProcMountState a private type of ChkStat * chkstat: EntryProcessor: rename some member variables for improved readability * chkstat: get rid of EntryContext and incorporate it into EntryProcessor * chkstat: split-off EntryProcessor from Chkstat main class * chkstat: define _GNU_SOURCE via Makefile * chkstat: processEntries(): make loop variables const * chkstat: split up checkHaveProc() * chkstat: ProfileParser: fix a bug when applying capabilities in custom root * chkstat: ProfileParser: make adding the root to paths transparent * chkstat: ProfileParser: refactor the now reduced codebase * chkstat: split off separate ProfileParser * chkstat: ProfileEntry: mark dropXID() const to support const ProfileEntry use * chkstat: parseProfile(): improve badProfileLine() calls * chkstat: drop deprecated capability check * chkstat: also move expandProfilePaths() into new VariableExpansions class * chkstat: split off variable expansion logic into separate class * chkstat: loadVariableExpansions(): a bit of refactoring * chkstat: parseSysconfig(): bit of refactoring * chkstat: remove deprecated CHECK_PERMISSIONS logic * chkstat: move assorted types into dedicated header * chkstat: replace #include guards by #pragma once * chkstat: split off command line arguments from Chkstat main class * chkstat: drop SaneValueArg wrapper * chkstat: document new packages.d directory * chkstat: drop TODO regarding ProfileEntry being changed on-the-fly * chkstat: harmonize FileCapabilities API * chkstat: support /usr/share/permissions/package.d for per-package drop-ins * chkstat: minor coding style fixes * chkstat: improve readability for rstrip() to strip trailing slashes * chkstat: remove trailing slashes from paths found on the command line * chkstat: add warning messages for rare error situations * chkstat: open profiles right away without racy `access()` check. - Remove fix_version.sh, handle version with services OBS-URL: https://build.opensuse.org/request/show/1152267 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=333
2024-02-27 13:47:01 +01:00
Obsoletes: permissions-doc <= %{version}
BuildArch: noarch
%description config
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
The actual permissions configuration files, /usr/share/permissions/permission.*.
%files config
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
%defattr(644, root, root, 755)
%dir %{_datadir}/permissions
%dir %{_datadir}/permissions/permissions.d
Accepting request 780264 from home:mkraus:branches:Base:System - Update to version 20200228: * chkstat: fix readline() on platforms with unsigned char - Update to version 20200227: * remove capability whitelisting for radosgw * whitelist ceph log directory (bsc#1150366) * adjust testsuite to post CVE-2020-8013 link handling * testsuite: add option to not mount /proc * do not follow symlinks that are the final path element: CVE-2020-8013 * add a test for symlinked directories * fix relative symlink handling * include cpp compat headers, not C headers * Move permissions and permissions.* except .local to /usr/share/permissions * regtest: fix the static PATH list which was missing /usr/bin * regtest: also unshare the PID namespace to support /proc mounting * regtest: bindMount(): explicitly reject read-only recursive mounts * Makefile: force remove upon clean target to prevent bogus errors * regtest: by default automatically (re)build chkstat before testing * regtest: add test for symlink targets * regtest: make capability setting tests optional * regtest: fix capability assertion helper logic * regtests: add another test case that catches set*id or caps in world-writable sub-trees * regtest: add another test that catches when privilege bits are set for special files * regtest: add test case for user owned symlinks * regtest: employ subuid and subgid feature in user namespace * regtest: add another test case that covers unknown user/group config * regtest: add another test that checks rejection of insecure mixed-owner paths * regtest: add test that checks for rejection of world-writable paths * regtest: add test for detection of unexpected parent directory ownership * regtest: add further helper functions, allow access to main instance OBS-URL: https://build.opensuse.org/request/show/780264 OBS-URL: https://build.opensuse.org/package/show/Base:System/permissions?expand=0&rev=252
2020-03-02 14:50:40 +01:00
%{_datadir}/permissions/permissions
%{_datadir}/permissions/permissions.easy
%{_datadir}/permissions/permissions.secure
%{_datadir}/permissions/permissions.paranoid
%{_datadir}/permissions/variables.conf
%config(noreplace) %{_sysconfdir}/permissions.local
%{_fillupdir}/sysconfig.security
%{_mandir}/man5/permissions.5%{ext_man}
%post config
%{fillup_only -n security}
# apply all potentially changed permissions
%{_bindir}/permctl --system || :
%package -n permctl
Summary: SUSE Linux Default Permissions tool
Group: Productivity/Security
Provides: chkstat = %version-%release
Obsoletes: chkstat < %version-%release
%description -n permctl
Tool to check and set file permissions.
%files -n permctl
%{_bindir}/chkstat
%{_bindir}/permctl
%{_mandir}/man8/permctl.8%{ext_man}
%package -n permissions-zypp-plugin
BuildArch: noarch
Requires: permissions = %{version}
Requires: python3-zypp-plugin
Requires: libzypp(plugin:commit) = 1
Summary: A zypper commit plugin for calling permctl
Group: Productivity/Security
%description -n permissions-zypp-plugin
This package contains a plugin for zypper that calls `permctl --system` after
new packages have been installed. This is helpful for maintaining custom
entries in /etc/permissions.local.
%files -n permissions-zypp-plugin
%dir /usr/lib/zypp
%dir /usr/lib/zypp/plugins
%dir /usr/lib/zypp/plugins/commit
/usr/lib/zypp/plugins/commit/permissions.py
%changelog