Accepting request 922505 from home:jsegitz:branches:systemdhardening:network

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/922505
OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=75
This commit is contained in:
Dirk Mueller 2021-10-01 19:30:46 +00:00 committed by Git OBS Bridge
parent bc02180e38
commit 880cc896f5
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,24 @@
Index: keepalived-2.2.2/keepalived/keepalived.service.in
===================================================================
--- keepalived-2.2.2.orig/keepalived/keepalived.service.in
+++ keepalived-2.2.2/keepalived/keepalived.service.in
@@ -4,6 +4,19 @@ After=network-online.target syslog.targe
Wants=network-online.target @SNMP_SERVICE@
[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
Type=@SYSTEMD_SERVICE_TYPE@
PIDFile=@RUN_DIR@/run/keepalived.pid
KillMode=process

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 27 07:39:33 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
- Added hardening to systemd service(s) (bsc#1181400). Added patch(es):
* harden_keepalived.service.patch
-------------------------------------------------------------------
Wed Jul 21 12:03:14 UTC 2021 - Dirk Müller <dmueller@suse.com>

View File

@ -54,6 +54,7 @@ Source2: keepalive-rpmlintrc
Patch1: keepalive-init.patch
# PATCH-FIX-UPSTREAM: https://github.com/acassen/keepalived/pull/1915
Patch2: 1915.patch
Patch3: harden_keepalived.service.patch
BuildRequires: file-devel
BuildRequires: net-snmp-devel
BuildRequires: pkgconfig
@ -104,6 +105,7 @@ resilient infrastructures.
%patch1 -p1
%patch2 -p1
chmod 644 doc/samples/*
%patch3 -p1
%build
export STRIP=true