From c9cc2b83f178283d45f40924ecafce960179b40d5b02f357a7d3b8623284c816 Mon Sep 17 00:00:00 2001 From: Andreas Vetter Date: Thu, 16 Dec 2021 10:19:47 +0000 Subject: [PATCH] Accepting request 933485 from home:jsegitz:branches:systemdhardening:security:Stunnel 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/933485 OBS-URL: https://build.opensuse.org/package/show/security:Stunnel/stunnel?expand=0&rev=145 --- harden_stunnel.service.patch | 24 ++++++++++++++++++++++++ stunnel.changes | 6 ++++++ stunnel.spec | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 harden_stunnel.service.patch diff --git a/harden_stunnel.service.patch b/harden_stunnel.service.patch new file mode 100644 index 0000000..52529b9 --- /dev/null +++ b/harden_stunnel.service.patch @@ -0,0 +1,24 @@ +Index: stunnel-5.60/tools/stunnel.service.in +=================================================================== +--- stunnel-5.60.orig/tools/stunnel.service.in ++++ stunnel-5.60/tools/stunnel.service.in +@@ -4,6 +4,19 @@ After=syslog.target network-online.targe + Wants=syslog.target network-online.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 + ExecStart=@bindir@/stunnel + Type=forking + diff --git a/stunnel.changes b/stunnel.changes index aa37f66..6f909db 100644 --- a/stunnel.changes +++ b/stunnel.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 24 08:51:33 UTC 2021 - Johannes Segitz + +- Added hardening to systemd service(s) (bsc#1181400). Added patch(es): + * harden_stunnel.service.patch + ------------------------------------------------------------------- Tue Aug 17 10:35:45 UTC 2021 - Andreas Vetter diff --git a/stunnel.spec b/stunnel.spec index 16eb4e9..d7f383b 100644 --- a/stunnel.spec +++ b/stunnel.spec @@ -53,6 +53,7 @@ Source4: stunnel.rc Source7: stunnel.README # PATCH-FIX-UPSTREAM Fix service file, so it ensure we are starting after network is really up! Patch1: stunnel-5.59_service_always_after_network.patch +Patch2: harden_stunnel.service.patch BuildRequires: libopenssl-devel BuildRequires: tcpd-devel BuildRequires: zlib-devel @@ -89,6 +90,7 @@ This package contains additional documentation for the stunnel program. %patch1 -p1 chmod -x %{_builddir}/stunnel-%{version}/tools/ca.* chmod -x %{_builddir}/stunnel-%{version}/tools/importCA.* +%patch2 -p1 %build sed -i 's/-m 1770//g' tools/Makefile.in