Skip to contentSkip to conversation

Add hardening settings to uuidd.service

RFC/PATCH Applied Andreas Henriksson 2 participants 5 messages Nov 12, 2018 – Nov 29, 2018 Util-Linux package

lore
Share & tools
lore
#0 lore raw

This limits what the uuid daemon has access to when it runs.

Further improving this with additional option or making things even tighter is most likely possible.

---
 misc-utils/uuidd.service.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
misc-utils/uuidd.service.in +1 -2
index 45f1f7334..dd38b645c 100644
@@ -17,8 +17,7 @@ ProtectKernelModules=yes
 ProtectControlGroups=yes
 RestrictAddressFamilies=AF_UNIX
 MemoryDenyWriteExecute=yes
-SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-eve
-nt @network-io
+SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-event @network-io
 
 [Install]
 Also=uuidd.socket
Signature · 1 line
2.19.1
maintainer
#1 lore raw

misc-utils/uuidd.service.in ProtectKernelModules=yes · line 20

Quoted 11 lines · Andreas Henriksson
misc-utils/uuidd.service.in +1 -2
index 45f1f7334..dd38b645c 100644
@@ -17,8 +17,7 @@ ProtectKernelModules=yes
 ProtectControlGroups=yes
 RestrictAddressFamilies=AF_UNIX
 MemoryDenyWriteExecute=yes
-SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-eve
-nt @network-io
+SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-event @network-io

Not sure, maybe I have miss some another your patch or you forgot to send any patch, but we have no Protect* and Restrict* setting in the uuidd.service.in yet. The current upstream is:

https://github.com/karelzak/util-linux/blob/master/misc-utils/uuidd.service.in

:-)

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 2 lines · Karel Zak

Not sure, maybe I have miss some another your patch or you forgot to send any patch, [...]

Yeah, I already noticed my screwup here .... Don't have the git tree available right now but will send a v2 (with the submitted fixup squashed into previous change) ASAP.

Sorry for not looking properly on what I actually submitted.

Regards,
Andreas Henriksson

#3 lore raw

PATCH v2 1/1 Add hardening settings to uuidd.service

In reply to Andreas Henriksson

This limits what the uuid daemon has access to when it runs.

Further improving this with additional option or making things even tighter is most likely possible.

---
 misc-utils/uuidd.service.in | 11 +++++++++++
 1 file changed, 11 insertions(+)
misc-utils/uuidd.service.in +11 -0
index 531672765..dd38b645c 100644
@@ -7,6 +7,17 @@ ExecStart=@usrsbin_execdir@/uuidd --socket-activation
 Restart=no
 User=uuidd
 Group=uuidd
+ProtectSystem=strict
+ProtectHome=yes
+PrivateDevices=yes
+PrivateNetwork=yes
+PrivateUsers=yes
+ProtectKernelTunables=yes
+ProtectKernelModules=yes
+ProtectControlGroups=yes
+RestrictAddressFamilies=AF_UNIX
+MemoryDenyWriteExecute=yes
+SystemCallFilter=@default @file-system @basic-io @system-service @signal @io-event @network-io
 
 [Install]
 Also=uuidd.socket
Signature · 1 line
2.19.2
maintainer Applied
#4 lore raw
Quoted 2 lines · Andreas Henriksson
 misc-utils/uuidd.service.in | 11 +++++++++++
 1 file changed, 11 insertions(+)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com