diff --git a/harden_telegraf.service.patch b/harden_telegraf.service.patch new file mode 100644 index 0000000..97fa387 --- /dev/null +++ b/harden_telegraf.service.patch @@ -0,0 +1,24 @@ +Index: telegraf-1.19.0/scripts/telegraf.service +=================================================================== +--- telegraf-1.19.0.orig/scripts/telegraf.service ++++ telegraf-1.19.0/scripts/telegraf.service +@@ -4,6 +4,19 @@ Documentation=https://github.com/influxd + 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/default/telegraf + User=telegraf + ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS diff --git a/telegraf.changes b/telegraf.changes index 24808b2..b77e010 100644 --- a/telegraf.changes +++ b/telegraf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 24 14:18:31 UTC 2021 - Johannes Segitz + +- Added hardening to systemd service(s) (bsc#1181400). Added patch(es): + * harden_telegraf.service.patch + ------------------------------------------------------------------- Thu Jul 01 13:26:54 UTC 2021 - rpm@fthiessen.de diff --git a/telegraf.spec b/telegraf.spec index f92f81e..d518e5b 100644 --- a/telegraf.spec +++ b/telegraf.spec @@ -26,6 +26,7 @@ Group: System/Monitoring URL: https://github.com/influxdata/telegraf Source: %{name}-%{version}.tar.xz Source1: vendor.tar.xz +Patch0: harden_telegraf.service.patch BuildRequires: git-core BuildRequires: golang-packaging BuildRequires: systemd-rpm-macros @@ -41,6 +42,7 @@ easily add support for collecting metrics from local or remote services. %prep %setup -q %setup -q -T -D -a 1 +%patch0 -p1 %build # Build the binary.