From 75e05f09fb6e32ac0f584eeef6be6f75b353274e69bec74c52a4a9174a47bfbe Mon Sep 17 00:00:00 2001 From: Lars Vogdt Date: Fri, 29 Oct 2021 14:02:17 +0000 Subject: [PATCH] Accepting request 923531 from home:jsegitz:branches:systemdhardening:network:utilities 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/923531 OBS-URL: https://build.opensuse.org/package/show/network:utilities/memcached?expand=0&rev=86 --- harden_memcached.service.patch | 18 ++++++++++++++++++ memcached.changes | 8 ++++++++ memcached.service | 13 +++++++++++++ memcached.spec | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 harden_memcached.service.patch diff --git a/harden_memcached.service.patch b/harden_memcached.service.patch new file mode 100644 index 0000000..f39a3db --- /dev/null +++ b/harden_memcached.service.patch @@ -0,0 +1,18 @@ +Index: memcached-1.6.9/scripts/memcached.service +=================================================================== +--- memcached-1.6.9.orig/scripts/memcached.service ++++ memcached-1.6.9/scripts/memcached.service +@@ -41,6 +41,13 @@ CapabilityBoundingSet=CAP_SETGID CAP_SET + # Restricts the set of socket address families accessible to the processes + # of this unit. Protects against vulnerabilities such as CVE-2016-8655 + RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX ++# added automatically, for details please see ++# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort ++ProtectHome=true ++ProtectHostname=true ++ProtectClock=true ++ProtectKernelLogs=true ++# end of automatic additions + + + # Some security features are not in the older versions of systemd used by diff --git a/memcached.changes b/memcached.changes index c44c81c..e3def22 100644 --- a/memcached.changes +++ b/memcached.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 6 12:01:19 UTC 2021 - Johannes Segitz + +- Added hardening to systemd service(s) (bsc#1181400). Added patch(es): + * harden_memcached.service.patch + Modified: + * memcached.service + ------------------------------------------------------------------- Fri Jun 4 13:18:29 UTC 2021 - Callum Farmer diff --git a/memcached.service b/memcached.service index 4290b82..532a8e6 100644 --- a/memcached.service +++ b/memcached.service @@ -3,6 +3,19 @@ Description=memcached daemon After=network.target [Service] +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +ProtectSystem=full +ProtectHome=true +PrivateDevices=true +ProtectHostname=true +ProtectClock=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +# end of automatic additions EnvironmentFile=/etc/sysconfig/memcached ExecStart=/usr/sbin/memcached -u $MEMCACHED_USER $MEMCACHED_PARAMS diff --git a/memcached.spec b/memcached.spec index 44deb32..9baf479 100644 --- a/memcached.spec +++ b/memcached.spec @@ -40,6 +40,7 @@ Source2: %{name}.sysconfig Source3: memcached-rpmlintrc Source4: memcached.service Source5: system-user-memcached.conf +Patch0: harden_memcached.service.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: cyrus-sasl-devel @@ -87,6 +88,7 @@ This package contains development files %prep %setup -q +%patch0 -p1 %build autoreconf -fi