From d73b34fb18878757c6e490726954345430efbdd5db9c475f52e2e6ee88fe9c05 Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Thu, 2 Dec 2021 09:25:39 +0000 Subject: [PATCH] Accepting request 932204 from home:jsegitz:branches:systemdhardening:security:SELinux Automatic systemd hardening effort by the security team. This has not been tested. For details please see https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort OBS-URL: https://build.opensuse.org/request/show/932204 OBS-URL: https://build.opensuse.org/package/show/security:SELinux/restorecond?expand=0&rev=23 --- harden_restorecond.service.patch | 20 ++++++++++++++++++++ restorecond.changes | 6 ++++++ restorecond.spec | 2 ++ 3 files changed, 28 insertions(+) create mode 100644 harden_restorecond.service.patch diff --git a/harden_restorecond.service.patch b/harden_restorecond.service.patch new file mode 100644 index 0000000..3cb2a40 --- /dev/null +++ b/harden_restorecond.service.patch @@ -0,0 +1,20 @@ +Index: restorecond-3.2/restorecond.service +=================================================================== +--- restorecond-3.2.orig/restorecond.service ++++ restorecond-3.2/restorecond.service +@@ -5,6 +5,15 @@ ConditionPathExists=/etc/selinux/restore + ConditionSecurity=selinux + + [Service] ++# added automatically, for details please see ++# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort ++ProtectHostname=true ++ProtectKernelTunables=true ++ProtectKernelModules=true ++ProtectKernelLogs=true ++ProtectControlGroups=true ++RestrictRealtime=true ++# end of automatic additions + Type=forking + ExecStart=/usr/sbin/restorecond + PIDFile=/run/restorecond.pid diff --git a/restorecond.changes b/restorecond.changes index 6052cf1..f894cb5 100644 --- a/restorecond.changes +++ b/restorecond.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 15 15:48:12 UTC 2021 - Johannes Segitz + +- Added hardening to systemd service(s) (bsc#1181400). Added patch(es): + * harden_restorecond.service.patch + ------------------------------------------------------------------- Thu Nov 11 14:17:58 UTC 2021 - Johannes Segitz diff --git a/restorecond.spec b/restorecond.spec index 70dce70..e8a62af 100644 --- a/restorecond.spec +++ b/restorecond.spec @@ -25,6 +25,7 @@ License: GPL-2.0-or-later Group: Productivity/Security URL: https://github.com/SELinuxProject/selinux.git Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz +Patch0: harden_restorecond.service.patch BuildRequires: dbus-1-glib-devel BuildRequires: libselinux-devel >= %{libselinux_ver} Requires: libselinux1 >= %{libselinux_ver} @@ -35,6 +36,7 @@ Daemon that watches for file creation and then sets the default SELinux file con %prep %setup -q +%patch0 -p1 %build export CFLAGS="%optflags"