#69 Update Systemd security settings
Opened 2 months ago by sundaram. Modified 2 months ago
rpms/ sundaram/openssh rawhide  into  rawhide

file modified
+5 -2
@@ -54,7 +54,7 @@ 

  Summary: An open source implementation of SSH protocol version 2

  Name: openssh

  Version: %{openssh_ver}

- Release: %{openssh_rel}%{?dist}.2

+ Release: %{openssh_rel}%{?dist}.3

  URL: http://www.openssh.com/portable.html

  #URL1: https://github.com/jbeverly/pam_ssh_agent_auth/

  Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
@@ -303,7 +303,7 @@ 

  %package -n pam_ssh_agent_auth

  Summary: PAM module for authentication with ssh-agent

  Version: %{pam_ssh_agent_ver}

- Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{?dist}.2

+ Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{?dist}.3

  License: BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND sprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant AND OpenSSL

  

  %description
@@ -739,6 +739,9 @@ 

  %endif

  

  %changelog

+ * Mon Mar 11 2024 Rahul Sundaram <sundaram@fedoraproject.org> - 9.6p1-1.3

+ - Update Systemd security settings as part of https://fedoraproject.org/wiki/Changes/SystemdSecurityHardening

+ 

  * Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 9.6p1-1.2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

  

file modified
+20
@@ -15,6 +15,26 @@ 

  KillMode=process

  Restart=on-failure

  RestartSec=42s

+ DevicePolicy=closed

This is definitely too strict and breaks chroot scenarios.

+ KeyringMode=private

+ LockPersonality=yes

+ MemoryDenyWriteExecute=yes

+ NoNewPrivileges=no

+ PrivateDevices=yes

+ PrivateTmp=no

+ ProtectClock=yes

+ ProtectControlGroups=yes

+ ProtectHome=no

I commented the lines below to see what exactly causes problems

+ ProtectHostname=yes

+ ProtectKernelLogs=yes

+ ProtectKernelModules=yes

+ ProtectKernelTunables=yes

+ ProtectProc=invisible

+ ProtectSystem=yes

+ ProcSubset=pid

+ RestrictRealtime=yes

+ RestrictSUIDSGID=yes

+ SystemCallArchitectures=native

  

  [Install]

  WantedBy=multi-user.target

file modified
+20
@@ -11,3 +11,23 @@ 

  EnvironmentFile=-/etc/sysconfig/sshd

  ExecStart=-/usr/sbin/sshd -i $OPTIONS

  StandardInput=socket

+ DevicePolicy=closed

+ KeyringMode=private

+ LockPersonality=yes

+ MemoryDenyWriteExecute=yes

+ NoNewPrivileges=no

+ PrivateDevices=yes

+ PrivateTmp=no

+ ProtectClock=yes

+ ProtectControlGroups=yes

+ ProtectHome=no

+ ProtectHostname=yes

+ ProtectKernelLogs=yes

+ ProtectKernelModules=yes

+ ProtectKernelTunables=yes

+ ProtectProc=invisible

+ ProtectSystem=yes

+ ProcSubset=pid

+ RestrictRealtime=yes

+ RestrictSUIDSGID=yes

+ SystemCallArchitectures=native

Hello, As part of https://fedoraproject.org/wiki/Changes/SystemdSecurityHardening which has been approved for Fedora 40, I am working on updating Systemd services to add additional hardening settings, please review this PR and let me know if you have any feedback. Everything here works with the default OpenSSH configuration.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/80e0c71746d240479b386d322850d7ef

1 new commit added

  • Systemd security settings
2 months ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/e62b987e50a7440d8d72a09ffff4f20f

rebased onto afdf4b2

2 months ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/ed00868bd6944f5281cfc664518adebd

This is definitely too strict and breaks chroot scenarios.

I commented the lines below to see what exactly causes problems